import sys
from datacloud.dev_utils.logging.logger import get_basic_logger
from datacloud.dev_utils.yt import yt_ops


logger = get_basic_logger(__name__)


def main():
    # provide YT path to table
    table = sys.argv[1]
    logger.info('Merge chunks for {}'.format(table))
    yt_ops.compress_table(
        table,
        combine_chunks=True)
    logger.info('Done')


if __name__ == '__main__':
    main()
