Skip to content

Commit 42b89f0

Browse files
committed
Use CAST instead of SAFE_CAST for non-string literals
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 38ef160 commit 42b89f0

86 files changed

Lines changed: 200 additions & 270 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/src/main/java/org/opensearch/sql/calcite/validate/PplTypeCoercion.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
import org.apache.calcite.rel.type.RelDataTypeFactoryImpl;
1515
import org.apache.calcite.sql.SqlCall;
1616
import org.apache.calcite.sql.SqlCallBinding;
17+
import org.apache.calcite.sql.SqlCharStringLiteral;
1718
import org.apache.calcite.sql.SqlDynamicParam;
1819
import org.apache.calcite.sql.SqlKind;
1920
import org.apache.calcite.sql.SqlNode;
21+
import org.apache.calcite.sql.SqlOperator;
2022
import org.apache.calcite.sql.fun.SqlLibraryOperators;
23+
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
2124
import org.apache.calcite.sql.type.SqlTypeFamily;
2225
import org.apache.calcite.sql.type.SqlTypeMappingRule;
2326
import org.apache.calcite.sql.type.SqlTypeName;
@@ -194,8 +197,13 @@ private static SqlNode castTo(SqlNode node, RelDataType type) {
194197
default -> throw new UnsupportedOperationException("Unsupported type: " + exprType);
195198
};
196199
}
197-
// Use SAFE_CAST instead of CAST to avoid throwing errors when numbers are malformatted
198-
return SqlLibraryOperators.SAFE_CAST.createCall(
200+
// Use CAST when node is a literal AND not a string literal
201+
// Use SAFE_CAST in rest cases to avoid throwing errors when the source node is malformatted
202+
SqlOperator cast =
203+
(node.getKind() == SqlKind.LITERAL && !(node instanceof SqlCharStringLiteral))
204+
? SqlStdOperatorTable.CAST
205+
: SqlLibraryOperators.SAFE_CAST;
206+
return cast.createCall(
199207
node.getParserPosition(),
200208
node,
201209
SqlTypeUtil.convertTypeToSpec(type).withNullable(type.isNullable()));

docs/user/ppl/functions/conversion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ source=people
135135
| eval e="1000"==1000, en="1000"!=1000, ed="1000"==1000.0, edn="1000"!=1000.0, l="1000">999, ld="1000">999.9, i="malformed"==1000
136136
| fields e, en, ed, edn, l, ld, i
137137
```
138-
138+
139139
Expected output:
140-
140+
141141
```text
142142
fetched rows / total rows = 1/1
143143
+------+-------+------+-------+------+------+------+

docs/user/ppl/interfaces/endpoint.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Expected output:
7777
```json
7878
{
7979
"calcite": {
80-
"logical": "LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])\n LogicalFilter(condition=[>($5, SAFE_CAST(30:BIGINT))])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n",
80+
"logical": "LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])\n LogicalFilter(condition=[>($5, 30)])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n",
8181
"physical": "CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year, age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"query\":{\"range\":{\"age\":{\"from\":30,\"to\":null,\"include_lower\":false,\"include_upper\":true,\"boost\":1.0}}},\"_source\":{\"includes\":[\"name\",\"country\",\"state\",\"month\",\"year\",\"age\"],\"excludes\":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])\n"
8282
}
8383
}
@@ -119,7 +119,7 @@ Expected output:
119119
```json
120120
{
121121
"calcite": {
122-
"logical": "LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])\n LogicalFilter(condition=[>($5, SAFE_CAST(30:BIGINT))])\n LogicalSort(fetch=[10])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5], _id=[$6], _index=[$7], _score=[$8], _maxscore=[$9], _sort=[$10], _routing=[$11])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n",
122+
"logical": "LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])\n LogicalFilter(condition=[>($5, 30)])\n LogicalSort(fetch=[10])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5], _id=[$6], _index=[$7], _score=[$8], _maxscore=[$9], _sort=[$10], _routing=[$11])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n",
123123
"physical": "EnumerableLimit(fetch=[10000])\n EnumerableCalc(expr#0..5=[{inputs}], expr#6=[30:BIGINT], expr#7=[>($t5, $t6)], proj#0..5=[{exprs}], $condition=[$t7])\n CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year, age], LIMIT->10], OpenSearchRequestBuilder(sourceBuilder={\"from\":0,\"size\":10,\"timeout\":\"1m\",\"_source\":{\"includes\":[\"name\",\"country\",\"state\",\"month\",\"year\",\"age\"],\"excludes\":[]}}, requestedTotalSize=10, pageSize=null, startFrom=0)])\n",
124124
"extended": "public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root) {\n final org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan v1stashed = (org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan) root.get(\"v1stashed\");\n final org.apache.calcite.linq4j.Enumerable _inputEnumerable = v1stashed.scan();\n final org.apache.calcite.linq4j.AbstractEnumerable child = new org.apache.calcite.linq4j.AbstractEnumerable(){\n public org.apache.calcite.linq4j.Enumerator enumerator() {\n return new org.apache.calcite.linq4j.Enumerator(){\n public final org.apache.calcite.linq4j.Enumerator inputEnumerator = _inputEnumerable.enumerator();\n public void reset() {\n inputEnumerator.reset();\n }\n\n public boolean moveNext() {\n while (inputEnumerator.moveNext()) {\n final Long input_value = (Long) ((Object[]) inputEnumerator.current())[5];\n final Boolean binary_call_value = input_value == null ? null : Boolean.valueOf(input_value.longValue() > 30L);\n if (binary_call_value != null && org.apache.calcite.runtime.SqlFunctions.toBoolean(binary_call_value)) {\n return true;\n }\n }\n return false;\n }\n\n public void close() {\n inputEnumerator.close();\n }\n\n public Object current() {\n final Object[] current = (Object[]) inputEnumerator.current();\n final Object input_value = current[0];\n final Object input_value0 = current[1];\n final Object input_value1 = current[2];\n final Object input_value2 = current[3];\n final Object input_value3 = current[4];\n final Object input_value4 = current[5];\n return new Object[] {\n input_value,\n input_value0,\n input_value1,\n input_value2,\n input_value3,\n input_value4};\n }\n\n };\n }\n\n };\n return child.take(10000);\n}\n\n\npublic Class getElementType() {\n return java.lang.Object[].class;\n}\n\n\n"
125125
}
@@ -146,7 +146,7 @@ calcite:
146146
logical: |
147147
LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])
148148
LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])
149-
LogicalFilter(condition=[>($5, SAFE_CAST(30:BIGINT))])
149+
LogicalFilter(condition=[>($5, 30)])
150150
CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])
151151
physical: |
152152
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year, age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10000,"timeout":"1m","query":{"range":{"age":{"from":30,"to":null,"include_lower":false,"include_upper":true,"boost":1.0}}},"_source":{"includes":["name","country","state","month","year","age"],"excludes":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
12
calcite:
23
logical: |
34
LogicalSystemLimit(sort0=[$7], dir0=[DESC-nulls-last], fetch=[10000], type=[QUERY_SIZE_LIMIT])
45
LogicalSort(sort0=[$7], dir0=[DESC-nulls-last])
56
LogicalProject(agent=[$0], process=[$6], log=[$8], message=[$11], tags=[$12], cloud=[$13], input=[$15], @timestamp=[$17], ecs=[$18], data_stream=[$20], meta=[$24], host=[$26], metrics=[$27], aws=[$30], event=[$35])
6-
LogicalFilter(condition=[<=($45, SAFE_CAST(1:BIGINT))])
7+
LogicalFilter(condition=[<=($45, 1)])
78
LogicalProject(agent=[$0], agent.ephemeral_id=[$1], agent.id=[$2], agent.name=[$3], agent.type=[$4], agent.version=[$5], process=[$6], process.name=[$7], log=[$8], log.file=[$9], log.file.path=[$10], message=[$11], tags=[$12], cloud=[$13], cloud.region=[$14], input=[$15], input.type=[$16], @timestamp=[$17], ecs=[$18], ecs.version=[$19], data_stream=[$20], data_stream.dataset=[$21], data_stream.namespace=[$22], data_stream.type=[$23], meta=[$24], meta.file=[$25], host=[$26], metrics=[$27], metrics.size=[$28], metrics.tmin=[$29], aws=[$30], aws.cloudwatch=[$31], aws.cloudwatch.ingestion_time=[$32], aws.cloudwatch.log_group=[$33], aws.cloudwatch.log_stream=[$34], event=[$35], event.dataset=[$36], event.id=[$37], event.ingested=[$38], _id=[$39], _index=[$40], _score=[$41], _maxscore=[$42], _sort=[$43], _routing=[$44], _row_number_dedup_=[ROW_NUMBER() OVER (PARTITION BY $28)])
89
LogicalFilter(condition=[IS NOT NULL($28)])
910
CalciteLogicalIndexScan(table=[[OpenSearch, big5]])
1011
physical: |
1112
CalciteEnumerableTopK(sort0=[$7], dir0=[DESC-nulls-last], fetch=[10000])
12-
EnumerableCalc(expr#0..16=[{inputs}], expr#17=[1:BIGINT], expr#18=[<=($t16, $t17)], proj#0..12=[{exprs}], aws=[$t14], event=[$t15], $condition=[$t18])
13-
EnumerableWindow(window#0=[window(partition {13} rows between UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])])
14-
CalciteEnumerableIndexScan(table=[[OpenSearch, big5]], PushDownContext=[[PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, metrics.size, aws, event], FILTER->IS NOT NULL($13)], OpenSearchRequestBuilder(sourceBuilder={"from":0,"timeout":"1m","query":{"exists":{"field":"metrics.size","boost":1.0}},"_source":{"includes":["agent","process","log","message","tags","cloud","input","@timestamp","ecs","data_stream","meta","host","metrics","metrics.size","aws","event"],"excludes":[]}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)])
13+
CalciteEnumerableIndexScan(table=[[OpenSearch, big5]], PushDownContext=[[AGGREGATION->rel#:LogicalAggregate.NONE.[](input=LogicalProject#,group={0},agg#0=LITERAL_AGG(1)), PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, aws, event]], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","aggregations":{"composite_buckets":{"composite":{"size":10000,"sources":[{"metrics.size":{"terms":{"field":"metrics.size","missing_bucket":false,"order":"asc"}}}]},"aggregations":{"$f1":{"top_hits":{"from":0,"size":1,"version":false,"seq_no_primary_term":false,"explain":false,"_source":{"includes":["metrics.size","agent","process","log","message","tags","cloud","input","@timestamp","ecs","data_stream","meta","host","metrics","aws","event"],"excludes":[]},"script_fields":{}}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)])
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
12
calcite:
23
logical: |
34
LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])
45
LogicalSort(fetch=[10])
56
LogicalProject(agent=[$0], process=[$6], log=[$8], message=[$11], tags=[$12], cloud=[$13], input=[$15], @timestamp=[$17], ecs=[$18], data_stream=[$20], meta=[$24], host=[$26], metrics=[$27], aws=[$30], event=[$35])
6-
LogicalFilter(condition=[AND(=($7, 'systemd'), >=($28, SAFE_CAST(1:BIGINT)), <=($28, SAFE_CAST(100:BIGINT)))])
7+
LogicalFilter(condition=[AND(=($7, 'systemd'), >=($28, 1), <=($28, 100))])
78
CalciteLogicalIndexScan(table=[[OpenSearch, big5]])
89
physical: |
910
CalciteEnumerableIndexScan(table=[[OpenSearch, big5]], PushDownContext=[[PROJECT->[agent, process, process.name, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, metrics.size, aws, event], FILTER->AND(=($2, 'systemd'), SEARCH($14, Sarg[[1L:BIGINT..100L:BIGINT]]:BIGINT)), PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, aws, event], LIMIT->10, LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10,"timeout":"1m","query":{"bool":{"must":[{"term":{"process.name":{"value":"systemd","boost":1.0}}},{"range":{"metrics.size":{"from":1.0,"to":100.0,"include_lower":true,"include_upper":true,"boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}},"_source":{"includes":["agent","process","log","message","tags","cloud","input","@timestamp","ecs","data_stream","meta","host","metrics","aws","event"],"excludes":[]}}, requestedTotalSize=10, pageSize=null, startFrom=0)])
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
12
calcite:
23
logical: |
34
LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])
45
LogicalSort(fetch=[10])
56
LogicalProject(agent=[$0], process=[$6], log=[$8], message=[$11], tags=[$12], cloud=[$13], input=[$15], @timestamp=[$17], ecs=[$18], data_stream=[$20], meta=[$24], host=[$26], metrics=[$27], aws=[$30], event=[$35])
6-
LogicalFilter(condition=[AND(>=($28, SAFE_CAST(20:BIGINT)), <=($28, SAFE_CAST(30:BIGINT)))])
7+
LogicalFilter(condition=[AND(>=($28, 20), <=($28, 30))])
78
CalciteLogicalIndexScan(table=[[OpenSearch, big5]])
89
physical: |
910
CalciteEnumerableIndexScan(table=[[OpenSearch, big5]], PushDownContext=[[PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, metrics.size, aws, event], FILTER->SEARCH($13, Sarg[[20L:BIGINT..30L:BIGINT]]:BIGINT), PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, aws, event], LIMIT->10, LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10,"timeout":"1m","query":{"range":{"metrics.size":{"from":20.0,"to":30.0,"include_lower":true,"include_upper":true,"boost":1.0}}},"_source":{"includes":["agent","process","log","message","tags","cloud","input","@timestamp","ecs","data_stream","meta","host","metrics","aws","event"],"excludes":[]}}, requestedTotalSize=10, pageSize=null, startFrom=0)])
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
12
calcite:
23
logical: |
34
LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])
45
LogicalSort(fetch=[10])
56
LogicalProject(agent=[$0], process=[$6], log=[$8], message=[$11], tags=[$12], cloud=[$13], input=[$15], @timestamp=[$17], ecs=[$18], data_stream=[$20], meta=[$24], host=[$26], metrics=[$27], aws=[$30], event=[$35])
6-
LogicalFilter(condition=[OR(=($34, 'indigodagger'), AND(>=($28, SAFE_CAST(10:BIGINT)), <=($28, SAFE_CAST(20:BIGINT))))])
7+
LogicalFilter(condition=[OR(=($34, 'indigodagger'), AND(>=($28, 10), <=($28, 20)))])
78
CalciteLogicalIndexScan(table=[[OpenSearch, big5]])
89
physical: |
910
CalciteEnumerableIndexScan(table=[[OpenSearch, big5]], PushDownContext=[[PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, metrics.size, aws, aws.cloudwatch.log_stream, event], FILTER->OR(=($15, 'indigodagger'), SEARCH($13, Sarg[[10L:BIGINT..20L:BIGINT]]:BIGINT)), PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, aws, event], LIMIT->10, LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10,"timeout":"1m","query":{"bool":{"should":[{"term":{"aws.cloudwatch.log_stream":{"value":"indigodagger","boost":1.0}}},{"range":{"metrics.size":{"from":10.0,"to":20.0,"include_lower":true,"include_upper":true,"boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}},"_source":{"includes":["agent","process","log","message","tags","cloud","input","@timestamp","ecs","data_stream","meta","host","metrics","aws","event"],"excludes":[]}}, requestedTotalSize=10, pageSize=null, startFrom=0)])
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
12
calcite:
23
logical: |
34
LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])
45
LogicalSort(fetch=[10])
56
LogicalProject(agent=[$0], process=[$6], log=[$8], message=[$11], tags=[$12], cloud=[$13], input=[$15], @timestamp=[$17], ecs=[$18], data_stream=[$20], meta=[$24], host=[$26], metrics=[$27], aws=[$30], event=[$35])
6-
LogicalFilter(condition=[OR(=($34, 'indigodagger'), AND(>=($28, SAFE_CAST(1:BIGINT)), <=($28, SAFE_CAST(100:BIGINT))))])
7+
LogicalFilter(condition=[OR(=($34, 'indigodagger'), AND(>=($28, 1), <=($28, 100)))])
78
CalciteLogicalIndexScan(table=[[OpenSearch, big5]])
89
physical: |
910
CalciteEnumerableIndexScan(table=[[OpenSearch, big5]], PushDownContext=[[PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, metrics.size, aws, aws.cloudwatch.log_stream, event], FILTER->OR(=($15, 'indigodagger'), SEARCH($13, Sarg[[1L:BIGINT..100L:BIGINT]]:BIGINT)), PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, aws, event], LIMIT->10, LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10,"timeout":"1m","query":{"bool":{"should":[{"term":{"aws.cloudwatch.log_stream":{"value":"indigodagger","boost":1.0}}},{"range":{"metrics.size":{"from":1.0,"to":100.0,"include_lower":true,"include_upper":true,"boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}},"_source":{"includes":["agent","process","log","message","tags","cloud","input","@timestamp","ecs","data_stream","meta","host","metrics","aws","event"],"excludes":[]}}, requestedTotalSize=10, pageSize=null, startFrom=0)])
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
12
calcite:
23
logical: |
34
LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])
45
LogicalSort(fetch=[10])
56
LogicalProject(agent=[$0], process=[$6], log=[$8], message=[$11], tags=[$12], cloud=[$13], input=[$15], @timestamp=[$17], ecs=[$18], data_stream=[$20], meta=[$24], host=[$26], metrics=[$27], aws=[$30], event=[$35])
6-
LogicalFilter(condition=[AND(>=($28, SAFE_CAST(20:BIGINT)), <=($28, SAFE_CAST(200:BIGINT)))])
7+
LogicalFilter(condition=[AND(>=($28, 20), <=($28, 200))])
78
CalciteLogicalIndexScan(table=[[OpenSearch, big5]])
89
physical: |
910
CalciteEnumerableIndexScan(table=[[OpenSearch, big5]], PushDownContext=[[PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, metrics.size, aws, event], FILTER->SEARCH($13, Sarg[[20L:BIGINT..200L:BIGINT]]:BIGINT), PROJECT->[agent, process, log, message, tags, cloud, input, @timestamp, ecs, data_stream, meta, host, metrics, aws, event], LIMIT->10, LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10,"timeout":"1m","query":{"range":{"metrics.size":{"from":20.0,"to":200.0,"include_lower":true,"include_upper":true,"boost":1.0}}},"_source":{"includes":["agent","process","log","message","tags","cloud","input","@timestamp","ecs","data_stream","meta","host","metrics","aws","event"],"excludes":[]}}, requestedTotalSize=10, pageSize=null, startFrom=0)])

integ-test/src/test/resources/expectedOutput/calcite/clickbench/q28.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
12
calcite:
23
logical: |
34
LogicalSystemLimit(sort0=[$0], dir0=[DESC-nulls-last], fetch=[10000], type=[QUERY_SIZE_LIMIT])
45
LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], fetch=[25])
56
LogicalProject(l=[$0], c=[$1], CounterID=[$2])
6-
LogicalFilter(condition=[>($1, SAFE_CAST(100000:BIGINT))])
7+
LogicalFilter(condition=[>($1, 100000)])
78
LogicalProject(l=[$1], c=[$2], CounterID=[$0])
89
LogicalAggregate(group=[{0}], l=[AVG($1)], c=[COUNT()])
910
LogicalProject(CounterID=[$103], $f1=[CHAR_LENGTH($26)])

0 commit comments

Comments
 (0)