|
1 | 1 | calcite: |
2 | 2 | logical: | |
3 | | - LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT]) |
4 | | - LogicalAggregate(group=[{0, 1}], avg(balance)=[AVG($2)]) |
5 | | - LogicalProject(gender=[$0], age=[CASE(IS NULL($1), 'NULL', <=($5, 10), $1, 'OTHER')], avg(balance)=[$2]) |
6 | | - LogicalJoin(condition=[=($1, $3)], joinType=[left]) |
7 | | - LogicalProject(gender=[$0], age=[SAFE_CAST($1)], avg(balance)=[$2]) |
8 | | - LogicalAggregate(group=[{0, 1}], avg(balance)=[AVG($2)]) |
9 | | - LogicalProject(gender=[$4], age=[$10], balance=[$7]) |
10 | | - CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]]) |
11 | | - LogicalProject(age=[$0], __grand_total__=[$1], _row_number_chart_=[ROW_NUMBER() OVER (ORDER BY $1 DESC NULLS LAST)]) |
12 | | - LogicalAggregate(group=[{0}], __grand_total__=[AVG($1)]) |
13 | | - LogicalFilter(condition=[IS NOT NULL($0)]) |
14 | | - LogicalProject(age=[SAFE_CAST($1)], avg(balance)=[$2]) |
15 | | - LogicalAggregate(group=[{0, 1}], avg(balance)=[AVG($2)]) |
16 | | - LogicalProject(gender=[$4], age=[$10], balance=[$7]) |
17 | | - CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]]) |
| 3 | + LogicalSystemLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[10000], type=[QUERY_SIZE_LIMIT]) |
| 4 | + LogicalSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC]) |
| 5 | + LogicalAggregate(group=[{0, 1}], avg(balance)=[AVG($2)]) |
| 6 | + LogicalProject(gender=[$0], age=[CASE(IS NULL($1), 'NULL', <=($5, 10), $1, 'OTHER')], avg(balance)=[$2]) |
| 7 | + LogicalJoin(condition=[=($1, $3)], joinType=[left]) |
| 8 | + LogicalProject(gender=[$0], age=[SAFE_CAST($1)], avg(balance)=[$2]) |
| 9 | + LogicalAggregate(group=[{0, 1}], avg(balance)=[AVG($2)]) |
| 10 | + LogicalProject(gender=[$4], age=[$10], balance=[$7]) |
| 11 | + CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]]) |
| 12 | + LogicalProject(age=[$0], __grand_total__=[$1], _row_number_chart_=[ROW_NUMBER() OVER (ORDER BY $1 DESC NULLS LAST)]) |
| 13 | + LogicalAggregate(group=[{0}], __grand_total__=[AVG($1)]) |
| 14 | + LogicalFilter(condition=[IS NOT NULL($0)]) |
| 15 | + LogicalProject(age=[SAFE_CAST($1)], avg(balance)=[$2]) |
| 16 | + LogicalAggregate(group=[{0, 1}], avg(balance)=[AVG($2)]) |
| 17 | + LogicalProject(gender=[$4], age=[$10], balance=[$7]) |
| 18 | + CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]]) |
18 | 19 | physical: | |
19 | 20 | EnumerableLimit(fetch=[10000]) |
20 | | - EnumerableCalc(expr#0..3=[{inputs}], expr#4=[0], expr#5=[=($t3, $t4)], expr#6=[null:DOUBLE], expr#7=[CASE($t5, $t6, $t2)], expr#8=[/($t7, $t3)], proj#0..1=[{exprs}], avg(balance)=[$t8]) |
21 | | - EnumerableAggregate(group=[{0, 1}], agg#0=[$SUM0($2)], agg#1=[COUNT($2)]) |
22 | | - EnumerableCalc(expr#0..4=[{inputs}], expr#5=[IS NULL($t1)], expr#6=['NULL'], expr#7=[10], expr#8=[<=($t4, $t7)], expr#9=['OTHER'], expr#10=[CASE($t5, $t6, $t8, $t1, $t9)], gender=[$t0], age=[$t10], avg(balance)=[$t2]) |
23 | | - EnumerableMergeJoin(condition=[=($1, $3)], joinType=[left]) |
24 | | - EnumerableSort(sort0=[$1], dir0=[ASC]) |
25 | | - EnumerableCalc(expr#0..2=[{inputs}], expr#3=[SAFE_CAST($t1)], gender=[$t0], age=[$t3], avg(balance)=[$t2]) |
26 | | - CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]], PushDownContext=[[AGGREGATION->rel#:LogicalAggregate.NONE.[](input=RelSubset#,group={0, 1},avg(balance)=AVG($2))], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"gender":{"terms":{"field":"gender.keyword","missing_bucket":true,"missing_order":"first","order":"asc"}}},{"age":{"terms":{"field":"age","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"avg(balance)":{"avg":{"field":"balance"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]) |
27 | | - EnumerableSort(sort0=[$0], dir0=[ASC]) |
28 | | - EnumerableCalc(expr#0..2=[{inputs}], age=[$t0], $1=[$t2]) |
29 | | - EnumerableWindow(window#0=[window(order by [1 DESC-nulls-last] rows between UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]) |
30 | | - EnumerableCalc(expr#0..2=[{inputs}], expr#3=[0], expr#4=[=($t2, $t3)], expr#5=[null:DOUBLE], expr#6=[CASE($t4, $t5, $t1)], expr#7=[/($t6, $t2)], age=[$t0], __grand_total__=[$t7]) |
31 | | - EnumerableAggregate(group=[{0}], agg#0=[$SUM0($1)], agg#1=[COUNT($1)]) |
32 | | - EnumerableCalc(expr#0..1=[{inputs}], expr#2=[SAFE_CAST($t0)], expr#3=[IS NOT NULL($t2)], $f0=[$t2], avg(balance)=[$t1], $condition=[$t3]) |
33 | | - CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]], PushDownContext=[[AGGREGATION->rel#:LogicalAggregate.NONE.[](input=RelSubset#,group={0, 1},avg(balance)=AVG($2)), PROJECT->[age, avg(balance)]], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"gender":{"terms":{"field":"gender.keyword","missing_bucket":true,"missing_order":"first","order":"asc"}}},{"age":{"terms":{"field":"age","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"avg(balance)":{"avg":{"field":"balance"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]) |
| 21 | + EnumerableSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC]) |
| 22 | + EnumerableCalc(expr#0..3=[{inputs}], expr#4=[0], expr#5=[=($t3, $t4)], expr#6=[null:DOUBLE], expr#7=[CASE($t5, $t6, $t2)], expr#8=[/($t7, $t3)], proj#0..1=[{exprs}], avg(balance)=[$t8]) |
| 23 | + EnumerableAggregate(group=[{0, 1}], agg#0=[$SUM0($2)], agg#1=[COUNT($2)]) |
| 24 | + EnumerableCalc(expr#0..4=[{inputs}], expr#5=[IS NULL($t1)], expr#6=['NULL'], expr#7=[10], expr#8=[<=($t4, $t7)], expr#9=['OTHER'], expr#10=[CASE($t5, $t6, $t8, $t1, $t9)], gender=[$t0], age=[$t10], avg(balance)=[$t2]) |
| 25 | + EnumerableMergeJoin(condition=[=($1, $3)], joinType=[left]) |
| 26 | + EnumerableSort(sort0=[$1], dir0=[ASC]) |
| 27 | + EnumerableCalc(expr#0..2=[{inputs}], expr#3=[SAFE_CAST($t1)], gender=[$t0], age=[$t3], avg(balance)=[$t2]) |
| 28 | + CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]], PushDownContext=[[AGGREGATION->rel#:LogicalAggregate.NONE.[](input=RelSubset#,group={0, 1},avg(balance)=AVG($2))], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"gender":{"terms":{"field":"gender.keyword","missing_bucket":true,"missing_order":"first","order":"asc"}}},{"age":{"terms":{"field":"age","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"avg(balance)":{"avg":{"field":"balance"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]) |
| 29 | + EnumerableSort(sort0=[$0], dir0=[ASC]) |
| 30 | + EnumerableCalc(expr#0..2=[{inputs}], age=[$t0], $1=[$t2]) |
| 31 | + EnumerableWindow(window#0=[window(order by [1 DESC-nulls-last] rows between UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]) |
| 32 | + EnumerableCalc(expr#0..2=[{inputs}], expr#3=[0], expr#4=[=($t2, $t3)], expr#5=[null:DOUBLE], expr#6=[CASE($t4, $t5, $t1)], expr#7=[/($t6, $t2)], age=[$t0], __grand_total__=[$t7]) |
| 33 | + EnumerableAggregate(group=[{0}], agg#0=[$SUM0($1)], agg#1=[COUNT($1)]) |
| 34 | + EnumerableCalc(expr#0..1=[{inputs}], expr#2=[SAFE_CAST($t0)], expr#3=[IS NOT NULL($t2)], $f0=[$t2], avg(balance)=[$t1], $condition=[$t3]) |
| 35 | + CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_bank]], PushDownContext=[[AGGREGATION->rel#:LogicalAggregate.NONE.[](input=RelSubset#,group={0, 1},avg(balance)=AVG($2)), PROJECT->[age, avg(balance)]], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"gender":{"terms":{"field":"gender.keyword","missing_bucket":true,"missing_order":"first","order":"asc"}}},{"age":{"terms":{"field":"age","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"avg(balance)":{"avg":{"field":"balance"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]) |
0 commit comments