def METHOD_NAME(mainTable,
                          window_defs:list, udf_defs, args,
                          downward=True, keep_index=True, is_sub_select=False):
    mainTable.init_table(args, window_defs, udf_defs, downward, keep_index)
    sql_string = SELECT_WINDOW_SQL
    sql_string = sql_string.replace("${WINDOW_EXPRS}", ", ".join([_.text for _ in mainTable.expressions]))
    if is_sub_select:
        sql_string = sql_string.replace("${INPUT_NAME}", mainTable.get_sub_sql())
    else:
        sql_string = sql_string.replace("${INPUT_NAME}", mainTable.name)
    sql_string = sql_string.replace("${WINDOW_DEF}", ",".join(_.get_window_def_string() for _ in window_defs))
    return QueryDesc(sql_string, mainTable.output_columns)