|
| 1 | + |
1 | 2 | calcite: |
2 | 3 | logical: | |
3 | 4 | LogicalSystemLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[10000], type=[QUERY_SIZE_LIMIT]) |
4 | 5 | LogicalSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC]) |
5 | 6 | LogicalAggregate(group=[{0, 1}], max(value)=[MAX($2)]) |
6 | | - LogicalProject(timestamp=[$0], category=[CASE(IS NULL($1), 'NULL', <=($5, 10), $1, 'OTHER')], max(value)=[$2]) |
| 7 | + LogicalProject(timestamp=[$0], category=[CASE(IS NULL($1), 'NULL':VARCHAR, <=($5, 10), $1, 'OTHER':VARCHAR)], max(value)=[$2]) |
7 | 8 | LogicalJoin(condition=[=($1, $3)], joinType=[left]) |
8 | 9 | LogicalProject(timestamp=[$1], category=[$0], max(value)=[$2]) |
9 | | - LogicalAggregate(group=[{0, 2}], max(value)=[MAX($1)]) |
10 | | - LogicalProject(category=[$1], value=[$2], timestamp0=[SPAN($3, 1, 'w')]) |
| 10 | + LogicalAggregate(group=[{0, 1}], max(value)=[MAX($2)]) |
| 11 | + LogicalProject(category=[$1], timestamp=[SPAN($3, 1, 'w')], value=[$2]) |
11 | 12 | LogicalFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($2))]) |
12 | 13 | CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_time_data]]) |
13 | 14 | LogicalProject(category=[$0], __grand_total__=[$1], _row_number_chart_=[ROW_NUMBER() OVER (ORDER BY $1 DESC NULLS LAST)]) |
14 | 15 | LogicalAggregate(group=[{0}], __grand_total__=[SUM($1)]) |
15 | 16 | LogicalFilter(condition=[IS NOT NULL($0)]) |
16 | 17 | LogicalProject(category=[$0], max(value)=[$2]) |
17 | | - LogicalAggregate(group=[{0, 2}], max(value)=[MAX($1)]) |
18 | | - LogicalProject(category=[$1], value=[$2], timestamp0=[SPAN($3, 1, 'w')]) |
| 18 | + LogicalAggregate(group=[{0, 1}], max(value)=[MAX($2)]) |
| 19 | + LogicalProject(category=[$1], $f1=[SPAN($3, 1, 'w')], value=[$2]) |
19 | 20 | LogicalFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($2))]) |
20 | 21 | CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_time_data]]) |
21 | 22 | physical: | |
22 | 23 | EnumerableLimit(fetch=[10000]) |
23 | 24 | EnumerableSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC]) |
24 | 25 | EnumerableAggregate(group=[{0, 1}], max(value)=[MAX($2)]) |
25 | | - 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)], timestamp=[$t0], category=[$t10], max(value)=[$t2]) |
| 26 | + EnumerableCalc(expr#0..4=[{inputs}], expr#5=[IS NULL($t1)], expr#6=['NULL':VARCHAR], expr#7=[10:BIGINT], expr#8=[<=($t4, $t7)], expr#9=['OTHER':VARCHAR], expr#10=[CASE($t5, $t6, $t8, $t1, $t9)], timestamp=[$t0], category=[$t10], max(value)=[$t2]) |
26 | 27 | EnumerableMergeJoin(condition=[=($1, $3)], joinType=[left]) |
27 | | - CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_time_data]], PushDownContext=[[FILTER->AND(IS NOT NULL($2), IS NOT NULL($1)), AGGREGATION->rel#:LogicalAggregate.NONE.[](input=RelSubset#,group={0, 2},max(value)=MAX($1)), PROJECT->[timestamp0, category, max(value)], SORT->[1]], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"bool":{"must":[{"exists":{"field":"timestamp","boost":1.0}},{"exists":{"field":"value","boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"category":{"terms":{"field":"category","missing_bucket":true,"missing_order":"last","order":"asc"}}},{"timestamp0":{"date_histogram":{"field":"timestamp","missing_bucket":false,"order":"asc","calendar_interval":"1w"}}}]},"aggregations":{"max(value)":{"max":{"field":"value"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]) |
| 28 | + CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_time_data]], PushDownContext=[[FILTER->AND(IS NOT NULL($2), IS NOT NULL($1)), AGGREGATION->rel#:LogicalAggregate.NONE.[](input=RelSubset#,group={0, 1},max(value)=MAX($2)), PROJECT->[timestamp, category, max(value)], SORT->[1]], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"bool":{"must":[{"exists":{"field":"timestamp","boost":1.0}},{"exists":{"field":"value","boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"category":{"terms":{"field":"category","missing_bucket":true,"missing_order":"last","order":"asc"}}},{"timestamp":{"date_histogram":{"field":"timestamp","missing_bucket":false,"order":"asc","calendar_interval":"1w"}}}]},"aggregations":{"max(value)":{"max":{"field":"value"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]) |
28 | 29 | EnumerableSort(sort0=[$0], dir0=[ASC]) |
29 | 30 | EnumerableCalc(expr#0..2=[{inputs}], category=[$t0], $1=[$t2]) |
30 | 31 | EnumerableWindow(window#0=[window(order by [1 DESC-nulls-last] rows between UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]) |
31 | 32 | EnumerableAggregate(group=[{0}], __grand_total__=[SUM($1)]) |
32 | | - CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_time_data]], PushDownContext=[[FILTER->AND(IS NOT NULL($2), IS NOT NULL($1)), FILTER->IS NOT NULL($0), AGGREGATION->rel#:LogicalAggregate.NONE.[](input=RelSubset#,group={0, 2},max(value)=MAX($1)), PROJECT->[category, max(value)]], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"bool":{"filter":[{"bool":{"must":[{"exists":{"field":"timestamp","boost":1.0}},{"exists":{"field":"value","boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},{"exists":{"field":"category","boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"category":{"terms":{"field":"category","missing_bucket":true,"missing_order":"first","order":"asc"}}},{"timestamp0":{"date_histogram":{"field":"timestamp","missing_bucket":false,"order":"asc","calendar_interval":"1w"}}}]},"aggregations":{"max(value)":{"max":{"field":"value"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]) |
| 33 | + CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_time_data]], PushDownContext=[[FILTER->AND(IS NOT NULL($2), IS NOT NULL($1)), FILTER->IS NOT NULL($0), AGGREGATION->rel#:LogicalAggregate.NONE.[](input=RelSubset#,group={0, 1},max(value)=MAX($2)), PROJECT->[category, max(value)]], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"bool":{"filter":[{"bool":{"must":[{"exists":{"field":"timestamp","boost":1.0}},{"exists":{"field":"value","boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},{"exists":{"field":"category","boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"category":{"terms":{"field":"category","missing_bucket":true,"missing_order":"first","order":"asc"}}},{"timestamp":{"date_histogram":{"field":"timestamp","missing_bucket":false,"order":"asc","calendar_interval":"1w"}}}]},"aggregations":{"max(value)":{"max":{"field":"value"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]) |
0 commit comments