def clean_tables_name()

in flatten_join_nested_file.py [0:0]


def clean_tables_name(dynf_coll):

    global root_table
    global tables_to_join_map

    text_to_replace = root_table+"_"

    print('entering clean_tables_name root_table is: ', root_table)

    for df_name in dynf_coll.keys():

        if (df_name == root_table):
            tbl_name = root_table
            if len(dynf_coll.select(root_table).toDF().schema.names) == 1:
                tbl_name = dynf_coll.select(
                    root_table).toDF().schema.names[0]
                df_name = add_prefix(tbl_name, root_table)
                root_table = tbl_name

            tbl_join_lvl = 0
            has_child = True
            tables_to_join_map = {
                '0': {tbl_name: {'join_to_tbls': [], 'join_col': []}}}
        else:
            tbl_name = clean_name('table', df_name, '', [], text_to_replace)
            tbl_join_lvl = None
            has_child = False

        store_table_metadata(tbl_name, dynf_coll, df_name,
                             tbl_join_lvl, has_child)

    print('exiting clean_tables_name root_table is: ', root_table)