You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

318 lines
16 KiB

[
{
"Name": "TestGroupStringer",
"Cases": [
{
"SQL": "select b from t where a > 1 and b < 1",
"Result": [
"Group#0 Schema:[test.t.b]",
" Projection_3 input:[Group#1], test.t.b",
"Group#1 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TiKVSingleGather_5 input:[Group#2], table:t",
"Group#2 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" Selection_8 input:[Group#3], lt(test.t.b, 1)",
"Group#3 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TableScan_7 table:t, pk col:test.t.a, cond:[gt(test.t.a, 1)]"
]
},
{
"SQL": "select 3 * 10 + 1",
"Result": [
"Group#0 Schema:[Column#1]",
" Projection_2 input:[Group#1], 31->Column#1",
"Group#1 Schema:[]",
" TableDual_1 rowcount:1"
]
},
{
"SQL": "select t1.b from t t1, t t2 where t2.a=t1.b and t1.a > 10",
"Result": [
"Group#0 Schema:[test.t.b]",
" Projection_5 input:[Group#1], test.t.b",
"Group#1 Schema:[test.t.a,test.t.b,test.t.a]",
" Selection_4 input:[Group#2], eq(test.t.a, test.t.b), gt(test.t.a, 10)",
"Group#2 Schema:[test.t.a,test.t.b,test.t.a]",
" Join_3 input:[Group#3,Group#4], inner join",
"Group#3 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TiKVSingleGather_7 input:[Group#5], table:t1",
"Group#5 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TableScan_6 table:t1, pk col:test.t.a",
"Group#4 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TiKVSingleGather_9 input:[Group#6], table:t2",
" TiKVSingleGather_21 input:[Group#7], table:t2, index:e_d_c_str_prefix",
" TiKVSingleGather_19 input:[Group#8], table:t2, index:c_d_e_str",
" TiKVSingleGather_17 input:[Group#9], table:t2, index:f_g",
" TiKVSingleGather_15 input:[Group#10], table:t2, index:g",
" TiKVSingleGather_13 input:[Group#11], table:t2, index:f",
" TiKVSingleGather_11 input:[Group#12], table:t2, index:c_d_e",
"Group#6 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TableScan_8 table:t2, pk col:test.t.a",
"Group#7 Schema:[test.t.a]",
" IndexScan_20 table:t2, index:e_str, d_str, c_str",
"Group#8 Schema:[test.t.a]",
" IndexScan_18 table:t2, index:c_str, d_str, e_str",
"Group#9 Schema:[test.t.a]",
" IndexScan_16 table:t2, index:f, g",
"Group#10 Schema:[test.t.a]",
" IndexScan_14 table:t2, index:g",
"Group#11 Schema:[test.t.a]",
" IndexScan_12 table:t2, index:f",
"Group#12 Schema:[test.t.a]",
" IndexScan_10 table:t2, index:c, d, e"
]
},
{
"SQL": "select max(b), sum(a) from t where c > 10 group by d",
"Result": [
"Group#0 Schema:[Column#13,Column#14]",
" Projection_4 input:[Group#1], Column#13, Column#14",
"Group#1 Schema:[Column#13,Column#14]",
" Aggregation_3 input:[Group#2], group by:test.t.d, funcs:max(test.t.b), sum(test.t.a)",
"Group#2 Schema:[test.t.a,test.t.b,test.t.c,test.t.d], UniqueKey:[test.t.a]",
" TiKVSingleGather_6 input:[Group#3], table:t",
"Group#3 Schema:[test.t.a,test.t.b,test.t.c,test.t.d], UniqueKey:[test.t.a]",
" Selection_7 input:[Group#4], gt(test.t.c, 10)",
"Group#4 Schema:[test.t.a,test.t.b,test.t.c,test.t.d], UniqueKey:[test.t.a]",
" TableScan_5 table:t, pk col:test.t.a"
]
},
{
"SQL": "select avg(b) from t where b > 10",
"Result": [
"Group#0 Schema:[Column#13]",
" Projection_4 input:[Group#1], Column#13",
"Group#1 Schema:[Column#13]",
" Aggregation_3 input:[Group#2], funcs:avg(test.t.b)",
"Group#2 Schema:[test.t.b]",
" TiKVSingleGather_6 input:[Group#3], table:t",
"Group#3 Schema:[test.t.b]",
" Selection_7 input:[Group#4], gt(test.t.b, 10)",
"Group#4 Schema:[test.t.b]",
" TableScan_5 table:t"
]
},
{
"SQL": "select a from t t1 where exists(select 1 from t t2 where t2.a < t1.b) and a < 5",
"Result": [
"Group#0 Schema:[test.t.a], UniqueKey:[test.t.a]",
" Projection_7 input:[Group#1], test.t.a",
"Group#1 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" Selection_2 input:[Group#2], lt(test.t.a, 5)",
"Group#2 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" Apply_6 input:[Group#3,Group#4], semi join",
"Group#3 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TiKVSingleGather_9 input:[Group#5], table:t1",
"Group#5 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TableScan_8 table:t1, pk col:test.t.a",
"Group#4 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TiKVSingleGather_11 input:[Group#6], table:t2",
" TiKVSingleGather_13 input:[Group#7], table:t2, index:c_d_e",
" TiKVSingleGather_15 input:[Group#8], table:t2, index:f",
" TiKVSingleGather_17 input:[Group#9], table:t2, index:g",
" TiKVSingleGather_19 input:[Group#10], table:t2, index:f_g",
" TiKVSingleGather_21 input:[Group#11], table:t2, index:c_d_e_str",
" TiKVSingleGather_23 input:[Group#12], table:t2, index:e_d_c_str_prefix",
"Group#6 Schema:[test.t.a], UniqueKey:[test.t.a]",
" Selection_24 input:[Group#13], lt(test.t.a, test.t.b)",
"Group#13 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TableScan_10 table:t2, pk col:test.t.a",
"Group#7 Schema:[test.t.a]",
" Selection_30 input:[Group#14], lt(test.t.a, test.t.b)",
"Group#14 Schema:[test.t.a]",
" IndexScan_12 table:t2, index:c, d, e",
"Group#8 Schema:[test.t.a]",
" Selection_29 input:[Group#15], lt(test.t.a, test.t.b)",
"Group#15 Schema:[test.t.a]",
" IndexScan_14 table:t2, index:f",
"Group#9 Schema:[test.t.a]",
" Selection_28 input:[Group#16], lt(test.t.a, test.t.b)",
"Group#16 Schema:[test.t.a]",
" IndexScan_16 table:t2, index:g",
"Group#10 Schema:[test.t.a]",
" Selection_27 input:[Group#17], lt(test.t.a, test.t.b)",
"Group#17 Schema:[test.t.a]",
" IndexScan_18 table:t2, index:f, g",
"Group#11 Schema:[test.t.a]",
" Selection_26 input:[Group#18], lt(test.t.a, test.t.b)",
"Group#18 Schema:[test.t.a]",
" IndexScan_20 table:t2, index:c_str, d_str, e_str",
"Group#12 Schema:[test.t.a]",
" Selection_25 input:[Group#19], lt(test.t.a, test.t.b)",
"Group#19 Schema:[test.t.a]",
" IndexScan_22 table:t2, index:e_str, d_str, c_str"
]
},
{
"SQL": "select sum(t1.a) from t t1, t t2 where t1.a = t2.b",
"Result": [
"Group#0 Schema:[Column#25]",
" Projection_6 input:[Group#1], Column#25",
"Group#1 Schema:[Column#25]",
" Aggregation_5 input:[Group#2], funcs:sum(test.t.a)",
"Group#2 Schema:[test.t.a,test.t.b]",
" Selection_4 input:[Group#3], eq(test.t.a, test.t.b)",
"Group#3 Schema:[test.t.a,test.t.b]",
" Join_3 input:[Group#4,Group#5], inner join",
"Group#4 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TiKVSingleGather_8 input:[Group#6], table:t1",
" TiKVSingleGather_20 input:[Group#7], table:t1, index:e_d_c_str_prefix",
" TiKVSingleGather_18 input:[Group#8], table:t1, index:c_d_e_str",
" TiKVSingleGather_16 input:[Group#9], table:t1, index:f_g",
" TiKVSingleGather_14 input:[Group#10], table:t1, index:g",
" TiKVSingleGather_12 input:[Group#11], table:t1, index:f",
" TiKVSingleGather_10 input:[Group#12], table:t1, index:c_d_e",
"Group#6 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TableScan_7 table:t1, pk col:test.t.a",
"Group#7 Schema:[test.t.a]",
" IndexScan_19 table:t1, index:e_str, d_str, c_str",
"Group#8 Schema:[test.t.a]",
" IndexScan_17 table:t1, index:c_str, d_str, e_str",
"Group#9 Schema:[test.t.a]",
" IndexScan_15 table:t1, index:f, g",
"Group#10 Schema:[test.t.a]",
" IndexScan_13 table:t1, index:g",
"Group#11 Schema:[test.t.a]",
" IndexScan_11 table:t1, index:f",
"Group#12 Schema:[test.t.a]",
" IndexScan_9 table:t1, index:c, d, e",
"Group#5 Schema:[test.t.b]",
" TiKVSingleGather_22 input:[Group#13], table:t2",
"Group#13 Schema:[test.t.b]",
" TableScan_21 table:t2"
]
},
{
"SQL": "select a from t where a > 10 limit 3",
"Result": [
"Group#0 Schema:[test.t.a], UniqueKey:[test.t.a]",
" Limit_4 input:[Group#1], offset:0, count:3",
"Group#1 Schema:[test.t.a], UniqueKey:[test.t.a]",
" Projection_3 input:[Group#2], test.t.a",
"Group#2 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TiKVSingleGather_6 input:[Group#3], table:t",
" TiKVSingleGather_8 input:[Group#4], table:t, index:c_d_e",
" TiKVSingleGather_10 input:[Group#5], table:t, index:f",
" TiKVSingleGather_12 input:[Group#6], table:t, index:g",
" TiKVSingleGather_14 input:[Group#7], table:t, index:f_g",
" TiKVSingleGather_16 input:[Group#8], table:t, index:c_d_e_str",
" TiKVSingleGather_18 input:[Group#9], table:t, index:e_d_c_str_prefix",
"Group#3 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TableScan_26 table:t, pk col:test.t.a, cond:[gt(test.t.a, 10)]",
"Group#4 Schema:[test.t.a]",
" Selection_25 input:[Group#10], gt(test.t.a, 10)",
"Group#10 Schema:[test.t.a]",
" IndexScan_7 table:t, index:c, d, e",
"Group#5 Schema:[test.t.a]",
" Selection_24 input:[Group#11], gt(test.t.a, 10)",
"Group#11 Schema:[test.t.a]",
" IndexScan_9 table:t, index:f",
"Group#6 Schema:[test.t.a]",
" Selection_23 input:[Group#12], gt(test.t.a, 10)",
"Group#12 Schema:[test.t.a]",
" IndexScan_11 table:t, index:g",
"Group#7 Schema:[test.t.a]",
" Selection_22 input:[Group#13], gt(test.t.a, 10)",
"Group#13 Schema:[test.t.a]",
" IndexScan_13 table:t, index:f, g",
"Group#8 Schema:[test.t.a]",
" Selection_21 input:[Group#14], gt(test.t.a, 10)",
"Group#14 Schema:[test.t.a]",
" IndexScan_15 table:t, index:c_str, d_str, e_str",
"Group#9 Schema:[test.t.a]",
" Selection_20 input:[Group#15], gt(test.t.a, 10)",
"Group#15 Schema:[test.t.a]",
" IndexScan_17 table:t, index:e_str, d_str, c_str"
]
},
{
"SQL": "select a from t where b > 1 order by c",
"Result": [
"Group#0 Schema:[test.t.a], UniqueKey:[test.t.a]",
" Projection_5 input:[Group#1], test.t.a",
"Group#1 Schema:[test.t.a,test.t.c], UniqueKey:[test.t.a]",
" Sort_4 input:[Group#2], test.t.c:asc",
"Group#2 Schema:[test.t.a,test.t.c], UniqueKey:[test.t.a]",
" Projection_3 input:[Group#3], test.t.a, test.t.c",
"Group#3 Schema:[test.t.a,test.t.b,test.t.c], UniqueKey:[test.t.a]",
" TiKVSingleGather_7 input:[Group#4], table:t",
"Group#4 Schema:[test.t.a,test.t.b,test.t.c], UniqueKey:[test.t.a]",
" Selection_8 input:[Group#5], gt(test.t.b, 1)",
"Group#5 Schema:[test.t.a,test.t.b,test.t.c], UniqueKey:[test.t.a]",
" TableScan_6 table:t, pk col:test.t.a"
]
},
{
"SQL": "select avg(a) from t union all select avg(b) from t",
"Result": [
"Group#0 Schema:[Column#27]",
" Union_7 input:[Group#1,Group#2]",
"Group#1 Schema:[Column#27]",
" Projection_8 input:[Group#3], Column#26",
"Group#3 Schema:[Column#26]",
" Projection_6 input:[Group#4], Column#26",
"Group#4 Schema:[Column#26]",
" Aggregation_5 input:[Group#5], funcs:avg(test.t.a)",
"Group#5 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TiKVSingleGather_11 input:[Group#6], table:t",
" TiKVSingleGather_23 input:[Group#7], table:t, index:e_d_c_str_prefix",
" TiKVSingleGather_21 input:[Group#8], table:t, index:c_d_e_str",
" TiKVSingleGather_19 input:[Group#9], table:t, index:f_g",
" TiKVSingleGather_17 input:[Group#10], table:t, index:g",
" TiKVSingleGather_15 input:[Group#11], table:t, index:f",
" TiKVSingleGather_13 input:[Group#12], table:t, index:c_d_e",
"Group#6 Schema:[test.t.a], UniqueKey:[test.t.a]",
" TableScan_10 table:t, pk col:test.t.a",
"Group#7 Schema:[test.t.a]",
" IndexScan_22 table:t, index:e_str, d_str, c_str",
"Group#8 Schema:[test.t.a]",
" IndexScan_20 table:t, index:c_str, d_str, e_str",
"Group#9 Schema:[test.t.a]",
" IndexScan_18 table:t, index:f, g",
"Group#10 Schema:[test.t.a]",
" IndexScan_16 table:t, index:g",
"Group#11 Schema:[test.t.a]",
" IndexScan_14 table:t, index:f",
"Group#12 Schema:[test.t.a]",
" IndexScan_12 table:t, index:c, d, e",
"Group#2 Schema:[Column#27]",
" Projection_9 input:[Group#13], Column#13",
"Group#13 Schema:[Column#13]",
" Projection_3 input:[Group#14], Column#13",
"Group#14 Schema:[Column#13]",
" Aggregation_2 input:[Group#15], funcs:avg(test.t.b)",
"Group#15 Schema:[test.t.b]",
" TiKVSingleGather_25 input:[Group#16], table:t",
"Group#16 Schema:[test.t.b]",
" TableScan_24 table:t"
]
},
{
"SQL": "select a = (select a from t t2 where t1.b = t2.b order by a limit 1) from t t1",
"Result": [
"Group#0 Schema:[Column#25]",
" Projection_2 input:[Group#1], eq(test.t.a, test.t.a)->Column#25",
"Group#1 Schema:[test.t.a,test.t.b,test.t.a]",
" Apply_9 input:[Group#2,Group#3], left outer join",
"Group#2 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TiKVSingleGather_11 input:[Group#4], table:t1",
"Group#4 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TableScan_10 table:t1, pk col:test.t.a",
"Group#3 Schema:[test.t.a], UniqueKey:[test.t.a]",
" MaxOneRow_8 input:[Group#5]",
"Group#5 Schema:[test.t.a], UniqueKey:[test.t.a]",
" Limit_7 input:[Group#6], offset:0, count:1",
"Group#6 Schema:[test.t.a], UniqueKey:[test.t.a]",
" Sort_6 input:[Group#7], test.t.a:asc",
"Group#7 Schema:[test.t.a], UniqueKey:[test.t.a]",
" Projection_5 input:[Group#8], test.t.a",
"Group#8 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TiKVSingleGather_13 input:[Group#9], table:t2",
"Group#9 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" Selection_14 input:[Group#10], eq(test.t.b, test.t.b)",
"Group#10 Schema:[test.t.a,test.t.b], UniqueKey:[test.t.a]",
" TableScan_12 table:t2, pk col:test.t.a"
]
}
]
}
]