*************** Case 1 *************** select 1 as a, (select a) as b; *************** Case 2 *************** select 1 as a, (select a+a) as b; *************** Case 3 *************** select 1 as a, 2 as b, (select a) as c; *************** Case 4 *************** select 1 as a, 2 as b, (select a+a) as c; *************** Case 5 *************** select 1 as a, 2 as b, (select a+b) as c; *************** Case 6 *************** select 1 as a, 2 as a, (select a) as c; *************** Case 7 *************** select 1 as a, 2 as a, (select a+a) as c; *************** Case 8 *************** SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; *************** Case 9 *************** SELECT (select max(t1.c1) from t1) as field from t1 group by field; { "stmt_type":1, "table": [ { "table_id":1099511677777, "table_name":"t1", "alias_name":"", "synonym_name":"", "table_type":0, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":1099511677777, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ ], "column_flags":17179869184, "is_explicited_referece":false, "explicited_ref_count":0, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":1099511677777, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ ], "column_flags":17179869184, "is_explicited_referece":false, "explicited_ref_count":0, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":0, "expr_level":0, "expr_levels": [ 1 ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] }, "is_alias":true, "alias_name":"field", "expr_name":"(select max(t1.c1) from t1)", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":1099511677777, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":0, "expr_level":0, "expr_levels": [ 1 ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] } ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ { "stmt_type":1, "table": [ { "table_id":-2, "table_name":"t1", "alias_name":"t1", "synonym_name":"", "table_type":1, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":-2, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":-2, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ 1 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":-2, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":-2, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ 1 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":1, "expr_levels": [ 1 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":-2, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ 1 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, "is_alias":false, "alias_name":"max(t1.c1)", "expr_name":"max(t1.c1)", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":-2, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":1, "expr_levels": [ 1 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":-2, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ 1 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } } ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 10 *************** SELECT 1 FROM (SELECT c1 FROM t1) b HAVING (SELECT b.c1)=1; *************** Case 11 *************** SELECT c1 as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1); { "stmt_type":1, "table": [ { "table_id":1099511677777, "table_name":"t1", "alias_name":"", "synonym_name":"", "table_type":0, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":1099511677777, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":1099511677777, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, "is_alias":true, "alias_name":"a", "expr_name":"c1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":1099511677777, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ 1 ], "id":0, "expr_level":0, "expr_levels": [ 0 ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] } ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ { "stmt_type":1, "table": [ { "table_id":-2, "table_name":"t1", "alias_name":"t1", "synonym_name":"", "table_type":1, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":-2, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":-2, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ ], "column_flags":17179869184, "is_explicited_referece":false, "explicited_ref_count":0, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":-2, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":-2, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ ], "column_flags":17179869184, "is_explicited_referece":false, "explicited_ref_count":0, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, "is_alias":false, "alias_name":"1", "expr_name":"1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":-2, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ { "item_type":"T_OP_EQ", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"DECIMAL", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN", "IS_SIMPLE_COND" ], "rel_id": [ ], "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] } ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 12 *************** SELECT c1 as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING t1.a=1); *************** Case 13 *************** SELECT (SELECT 1) a, (select A); *************** Case 14 *************** SELECT 1 as a,(SELECT a+a) b,(SELECT b); *************** Case 15 *************** select 1 in (1, (1)); { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_QUESTIONMARK", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "IS_STATIC_PARAM", "CNT_CONST", "CNT_STATIC_PARAM", "IS_DYNAMIC_PARAM" ], "rel_id": [ ], "value": { "UNKNOWN":0 } }, "is_alias":false, "alias_name":"1 in (1, (1))", "expr_name":"1 in (1, (1))", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":true, "calculable_items": [ { "expression": { "item_type":"T_OP_IN", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_IN", "IS_CALCULABLE_EXPR", "IS_CONST_EXPR", "CNT_CONST", "CNT_IN", "CNT_CALCULABLE_EXPR" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, { "item_type":"T_OP_ROW", "result_type": { "meta": { "type":"", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":-1, "scale":-1 }, "flag":0, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST_EXPR", "CNT_CONST" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] } ] }, "idx":0 } ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 16 *************** select 1 in (1, (select 1)); { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_OP_IN", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_IN", "CNT_CONST", "CNT_IN", "CNT_SUB_QUERY" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, { "item_type":"T_OP_ROW", "result_type": { "meta": { "type":"", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":-1, "scale":-1 }, "flag":0, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "CNT_CONST", "CNT_SUB_QUERY" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":0, "expr_level":0, "expr_levels": [ ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] } ] } ] }, "is_alias":false, "alias_name":"1 in (1, (select 1))", "expr_name":"1 in (1, (select 1))", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, "is_alias":false, "alias_name":"1", "expr_name":"1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 17 *************** select 1 in ((select 1), (select 1)); { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_OP_IN", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_IN", "CNT_CONST", "CNT_IN", "CNT_SUB_QUERY" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, { "item_type":"T_OP_ROW", "result_type": { "meta": { "type":"", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":-1, "scale":-1 }, "flag":0, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "CNT_SUB_QUERY" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":0, "expr_level":0, "expr_levels": [ ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] }, { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":1, "expr_level":0, "expr_levels": [ ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] } ] } ] }, "is_alias":false, "alias_name":"1 in ((select 1), (select 1))", "expr_name":"1 in ((select 1), (select 1))", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, "is_alias":false, "alias_name":"1", "expr_name":"1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false }, { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, "is_alias":false, "alias_name":"1", "expr_name":"1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 18 *************** select 1 in ((select 1), (select 1), (select 1)); { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_OP_IN", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_IN", "CNT_CONST", "CNT_IN", "CNT_SUB_QUERY" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, { "item_type":"T_OP_ROW", "result_type": { "meta": { "type":"", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":-1, "scale":-1 }, "flag":0, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "CNT_SUB_QUERY" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":0, "expr_level":0, "expr_levels": [ ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] }, { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":1, "expr_level":0, "expr_levels": [ ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] }, { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":2, "expr_level":0, "expr_levels": [ ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] } ] } ] }, "is_alias":false, "alias_name":"1 in ((select 1), (select 1), (select 1))", "expr_name":"1 in ((select 1), (select 1), (select 1))", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, "is_alias":false, "alias_name":"1", "expr_name":"1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false }, { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, "is_alias":false, "alias_name":"1", "expr_name":"1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false }, { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, "is_alias":false, "alias_name":"1", "expr_name":"1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":2, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 19 *************** select 1 in (1, (select 1), (select c1 from t1)); { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_OP_IN", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_IN", "CNT_CONST", "CNT_IN", "CNT_SUB_QUERY" ], "rel_id": [ ], "expr_levels": [ 1 ], "children": [ { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, { "item_type":"T_OP_ROW", "result_type": { "meta": { "type":"", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":-1, "scale":-1 }, "flag":0, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "CNT_CONST", "CNT_SUB_QUERY" ], "rel_id": [ ], "expr_levels": [ 1 ], "children": [ { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":0, "expr_level":0, "expr_levels": [ ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] }, { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ ], "id":1, "expr_level":0, "expr_levels": [ 1 ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] } ] } ] }, "is_alias":false, "alias_name":"1 in (1, (select 1), (select c1 from t1))", "expr_name":"1 in (1, (select 1), (select c1 from t1))", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } }, "is_alias":false, "alias_name":"1", "expr_name":"1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false }, { "stmt_type":1, "table": [ { "table_id":1099511677777, "table_name":"t1", "alias_name":"", "synonym_name":"", "table_type":0, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":1099511677777, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ 1 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":1099511677777, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ 1 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":1, "expr_levels": [ 1 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false }, "is_alias":false, "alias_name":"c1", "expr_name":"c1", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":1099511677777, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 20 *************** select MAX(c1) c from t1 having (select c) > 0; { "stmt_type":1, "table": [ { "table_id":1099511677777, "table_name":"t1", "alias_name":"", "synonym_name":"", "table_type":0, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":1099511677777, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":1099511677777, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, "is_alias":true, "alias_name":"c", "expr_name":"MAX(c1)", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":1099511677777, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ { "item_type":"T_OP_GT", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":0, "calc_type": { "type":"DECIMAL", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_STATIC_PARAM", "CNT_SUB_QUERY" ], "rel_id": [ 1 ], "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ 1 ], "id":0, "expr_level":0, "expr_levels": [ 0 ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] }, { "item_type":"T_QUESTIONMARK", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "IS_STATIC_PARAM", "CNT_CONST", "CNT_STATIC_PARAM" ], "rel_id": [ ], "value": { "UNKNOWN":0 } } ] } ], "aggr_func": [ { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } } ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, "is_alias":false, "alias_name":"c", "expr_name":"c", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 21 *************** select MAX(c1) c from t1 group by (select c); *************** Case 22 *************** select MAX(c1) c from t1 order by (select c); { "stmt_type":1, "table": [ { "table_id":1099511677777, "table_name":"t1", "alias_name":"", "synonym_name":"", "table_type":0, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":1099511677777, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":1099511677777, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, "is_alias":true, "alias_name":"c", "expr_name":"MAX(c1)", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":1099511677777, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } } ], "order_by": [ { "expression": { "item_type":"T_REF_QUERY", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_SUB_QUERY", "CNT_SUB_QUERY" ], "rel_id": [ 1 ], "id":0, "expr_level":0, "expr_levels": [ 0 ], "output_column":1, "is_set":false, "column_types": [ { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } } ], "enum_set_values": [ ] }, "ascending":"ASC" } ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ { "stmt_type":1, "table": [ ], "joined_table": [ ], "partition_express": [ ], "column": [ ], "select": [ { "expression": { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, "is_alias":false, "alias_name":"c", "expr_name":"c", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":1, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 23 *************** select MAX(c1) c, (select c1 from t1 having c > 0) from t1; *************** Case 24 *************** select max(c1) b , (select b) from t1; *************** Case 25 *************** select max(c1) b from t1 having b > 0; { "stmt_type":1, "table": [ { "table_id":1099511677777, "table_name":"t1", "alias_name":"", "synonym_name":"", "table_type":0, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":1099511677777, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":1099511677777, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, "is_alias":true, "alias_name":"b", "expr_name":"max(c1)", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":1099511677777, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ { "item_type":"T_OP_GT", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":0, "calc_type": { "type":"DECIMAL", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN", "CNT_STATIC_PARAM", "CNT_AGG" ], "rel_id": [ 1 ], "expr_levels": [ 0 ], "children": [ { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, { "item_type":"T_QUESTIONMARK", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "IS_STATIC_PARAM", "CNT_CONST", "CNT_STATIC_PARAM" ], "rel_id": [ ], "value": { "UNKNOWN":0 } } ] } ], "aggr_func": [ { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } } ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 26 *************** select max(c1) b from t1 order by b; { "stmt_type":1, "table": [ { "table_id":1099511677777, "table_name":"t1", "alias_name":"", "synonym_name":"", "table_type":0, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":1099511677777, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":1099511677777, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, "is_alias":true, "alias_name":"b", "expr_name":"max(c1)", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":1099511677777, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } } ], "order_by": [ { "expression": { "item_type":"T_FUN_MAX", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16386, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_AGG", "CNT_COLUMN", "CNT_AGG" ], "rel_id": [ 1 ], "expr_level":0, "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } ], "distinct":false, "order_by": [ ], "separator_param_expr":null, "udf_meta": { "tenant_id":-1, "name":"", "ret":0, "dl":"", "type":0 } }, "ascending":"ASC" } ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":0, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 27 *************** select max(c1) b from t1 group by b; *************** Case 28 *************** SELECT MAX(c2) c, (SELECT c1 FROM t1 WHERE c2 = c) FROM t1 HAVING c2 = 10; *************** Case 29 *************** select c1, c2 as c1 from t1 group by c1; *************** Case 30 *************** select c1 as c1, c2 as c1 from t1 group by c1; *************** Case 31 *************** select c1, c2 as c1 from t1 order by c1; *************** Case 32 *************** select c1 as c1, c2 as c1 from t1 order by c1; *************** Case 33 *************** select c1, c2 as c1 from t1 having c1 > 0; *************** Case 34 *************** select c1 as c1, c2 as c1 from t1 having c1 > 0; *************** Case 35 *************** select c1, c2 as c1 from t1 having t1.c1 > 2; { "stmt_type":1, "table": [ { "table_id":1099511677777, "table_name":"t1", "alias_name":"", "synonym_name":"", "table_type":0, "ref_id":1099511677777, "database_name":"rongxuan", "for_update":false, "wait":-1, "mock_id":-1, "view_base_item":-1 } ], "joined_table": [ ], "partition_express": [ { "table_id":1099511677777, "index_tid":1099511677777, "part_expr": { "item_type":"T_OP_ADD", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":12, "scale":0 }, "flag":1, "calc_type": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN" ], "rel_id": [ ], "expr_levels": [ ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_INT", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "CNT_CONST" ], "rel_id": [ ], "value": { "BIGINT":1 } } ] }, "subpart_expr":null } ], "column": [ { "column_id":16, "table_id":1099511677777, "column":"c1", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":16, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false } }, { "column_id":17, "table_id":1099511677777, "column":"c2", "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "base_tid":1099511677777, "base_cid":17, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":0, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":17, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c2", "expr_level":0, "expr_levels": [ 0 ], "column_flags":0, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false } } ], "select": [ { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, "is_alias":false, "alias_name":"c1", "expr_name":"c1", "default": { "NULL":"NULL" } }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":0, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":17, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c2", "expr_level":0, "expr_levels": [ 0 ], "column_flags":0, "is_explicited_referece":true, "explicited_ref_count":1, "enum_set_values": [ ], "is_lob_column":false }, "is_alias":true, "alias_name":"c1", "expr_name":"c2", "default": { "NULL":"NULL" } } ], "distinct":false, "rollup":false, "nocycle":false, "from": [ { "table_id":1099511677777, "is_join":false } ], "start_with": [ ], "connect_by": [ ], "where": [ ], "group_by": [ ], "having": [ { "item_type":"T_OP_GT", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"DECIMAL", "collation":"binary", "coercibility":"NUMERIC" } }, "expr_info": [ "CNT_CONST", "CNT_COLUMN", "CNT_STATIC_PARAM", "IS_RANGE_COND" ], "rel_id": [ 1 ], "expr_levels": [ 0 ], "children": [ { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":11, "scale":0 }, "flag":16387, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511677777, "column_id":16, "database_name":"rongxuan", "table_name":"t1", "synonym_name":"", "column_name":"c1", "expr_level":0, "expr_levels": [ 0 ], "column_flags":17179869184, "is_explicited_referece":true, "explicited_ref_count":2, "enum_set_values": [ ], "is_lob_column":false }, { "item_type":"T_QUESTIONMARK", "result_type": { "meta": { "type":"BIGINT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":1, "precision":1, "scale":0 }, "flag":1, "calc_type": { "type":"NULL", "collation":"invalid_type", "coercibility":"INVALID" } }, "expr_info": [ "IS_CONST", "IS_STATIC_PARAM", "CNT_CONST", "CNT_STATIC_PARAM" ], "rel_id": [ ], "value": { "UNKNOWN":0 } } ] } ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "hint": { "read_static":false, "no_rewrite":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":-1, "join_ordered":false, "join_order": [ ], "merge_hint_ids": [ ], "hash_hint_ids": [ ], "no_hash_hint_ids": [ ], "nl_hint_ids": [ ], "part_hints": [ ], "use_late_materialization":-1, "log_level":"", "max_concurrent":-1, "only_concurrent_hint":false, "has_hint_exclude_concurrent":false, "parallel":-1, "use_px":1, "use join filter":false, "org_pq_distributes": [ ], "pq_distributes": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":true, "calculable_items": [ ] }, "extra_output_exprs": [ ], "current_level":0, "equal_sets": [ ], "pseudo_column_exprs": [ ], "child_stmts": [ ], "has_transformed_for_hierarchical_query":false, "is_hierarchical_query":false } *************** Case 36 *************** select c1 as cc, c2 from t1 having t1.cc > 2; *************** Case 37 *************** select c1 from t1 group by t2.c1;