import os

import cfgtools

create_table_parallel_order = None


def can_create_table_parallel_order():
    # type: (...) -> str

    global create_table_parallel_order

    if create_table_parallel_order is None:
        config = cfgtools.read(os.environ["LOADERCFG"])
        create_table_parallel_order = config.find_value(
            "Customizations.CanCreateTableParallelOrder",
            "false"
        )

    return create_table_parallel_order.lower() == "true"
