Skip to content

Commit 66e230e

Browse files
authored
Make query.size_limit only affect the final results (opensearch-project#3623)
* Make query.size_limit only affect the final results Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix 3607 Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix IT/UT Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix issue 3638 Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix issue 3637 Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix IT Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix IT after merging main Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix UT Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix doctest Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix IT after merging main Signed-off-by: Heng Qian <qianheng@amazon.com> * Address comments Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix CI Signed-off-by: Heng Qian <qianheng@amazon.com> * Fix doctest Signed-off-by: Heng Qian <qianheng@amazon.com> * Update settings doc Signed-off-by: Heng Qian <qianheng@amazon.com> * Ignore the explain test in 3655.yml Signed-off-by: Heng Qian <qianheng@amazon.com> --------- Signed-off-by: Heng Qian <qianheng@amazon.com>
1 parent f3cde1d commit 66e230e

57 files changed

Lines changed: 454 additions & 233 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/CalcitePlanContext.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class CalcitePlanContext {
3131
public final ExtendedRexBuilder rexBuilder;
3232
public final FunctionProperties functionProperties;
3333
public final QueryType queryType;
34+
public final Integer querySizeLimit;
3435

3536
@Getter @Setter private boolean isResolvingJoinCondition = false;
3637
@Getter @Setter private boolean isResolvingSubquery = false;
@@ -46,8 +47,9 @@ public class CalcitePlanContext {
4647
private final Stack<RexCorrelVariable> correlVar = new Stack<>();
4748
private final Stack<List<RexNode>> windowPartitions = new Stack<>();
4849

49-
private CalcitePlanContext(FrameworkConfig config, QueryType queryType) {
50+
private CalcitePlanContext(FrameworkConfig config, Integer querySizeLimit, QueryType queryType) {
5051
this.config = config;
52+
this.querySizeLimit = querySizeLimit;
5153
this.queryType = queryType;
5254
this.connection = CalciteToolsHelper.connect(config, TYPE_FACTORY);
5355
this.relBuilder = CalciteToolsHelper.create(config, TYPE_FACTORY, connection);
@@ -84,7 +86,8 @@ public Optional<RexCorrelVariable> peekCorrelVar() {
8486
}
8587
}
8688

87-
public static CalcitePlanContext create(FrameworkConfig config, QueryType queryType) {
88-
return new CalcitePlanContext(config, queryType);
89+
public static CalcitePlanContext create(
90+
FrameworkConfig config, Integer querySizeLimit, QueryType queryType) {
91+
return new CalcitePlanContext(config, querySizeLimit, queryType);
8992
}
9093
}

core/src/main/java/org/opensearch/sql/executor/ExecutionContext.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@
1212
/** Execution context hold planning related information. */
1313
public class ExecutionContext {
1414
@Getter private final Optional<Split> split;
15+
@Getter private final Integer querySizeLimit;
1516

1617
public ExecutionContext(Split split) {
1718
this.split = Optional.of(split);
19+
this.querySizeLimit = null;
1820
}
1921

20-
private ExecutionContext(Optional<Split> split) {
22+
private ExecutionContext(Optional<Split> split, Integer querySizeLimit) {
2123
this.split = split;
24+
this.querySizeLimit = querySizeLimit;
25+
}
26+
27+
public static ExecutionContext querySizeLimit(Integer querySizeLimit) {
28+
return new ExecutionContext(Optional.empty(), querySizeLimit);
2229
}
2330

2431
public static ExecutionContext emptyExecutionContext() {
25-
return new ExecutionContext(Optional.empty());
32+
return new ExecutionContext(Optional.empty(), null);
2633
}
2734
}

core/src/main/java/org/opensearch/sql/executor/QueryService.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@
3838
import org.opensearch.sql.calcite.OpenSearchSchema;
3939
import org.opensearch.sql.common.response.ResponseListener;
4040
import org.opensearch.sql.common.setting.Settings;
41+
import org.opensearch.sql.common.setting.Settings.Key;
4142
import org.opensearch.sql.datasource.DataSourceService;
4243
import org.opensearch.sql.exception.CalciteUnsupportedException;
4344
import org.opensearch.sql.planner.PlanContext;
4445
import org.opensearch.sql.planner.Planner;
46+
import org.opensearch.sql.planner.logical.LogicalPaginate;
4547
import org.opensearch.sql.planner.logical.LogicalPlan;
4648
import org.opensearch.sql.planner.physical.PhysicalPlan;
4749

@@ -94,7 +96,10 @@ public void executeWithCalcite(
9496
(PrivilegedAction<Void>)
9597
() -> {
9698
CalcitePlanContext context =
97-
CalcitePlanContext.create(buildFrameworkConfig(), queryType);
99+
CalcitePlanContext.create(
100+
buildFrameworkConfig(),
101+
settings.getSettingValue(Key.QUERY_SIZE_LIMIT),
102+
queryType);
98103
RelNode relNode = analyze(plan, context);
99104
RelNode optimized = optimize(relNode);
100105
RelNode calcitePlan = convertToCalcitePlan(optimized);
@@ -126,7 +131,8 @@ public void explainWithCalcite(
126131
(PrivilegedAction<Void>)
127132
() -> {
128133
CalcitePlanContext context =
129-
CalcitePlanContext.create(buildFrameworkConfig(), queryType);
134+
CalcitePlanContext.create(
135+
buildFrameworkConfig(), getQuerySizeLimit(), queryType);
130136
RelNode relNode = analyze(plan, context);
131137
RelNode optimized = optimize(relNode);
132138
RelNode calcitePlan = convertToCalcitePlan(optimized);
@@ -220,7 +226,12 @@ public void executePlan(
220226
split -> executionEngine.execute(plan(plan), new ExecutionContext(split), listener),
221227
() ->
222228
executionEngine.execute(
223-
plan(plan), ExecutionContext.emptyExecutionContext(), listener));
229+
plan(plan),
230+
ExecutionContext.querySizeLimit(
231+
// For pagination, querySizeLimit shouldn't take effect.
232+
// See {@link PaginationWindowIT::testQuerySizeLimitDoesNotEffectPageSize}
233+
plan instanceof LogicalPaginate ? null : getQuerySizeLimit()),
234+
listener));
224235
} catch (Exception e) {
225236
listener.onFailure(e);
226237
}
@@ -260,6 +271,10 @@ private boolean isCalciteEnabled(Settings settings) {
260271
}
261272
}
262273

274+
private Integer getQuerySizeLimit() {
275+
return settings == null ? null : settings.getSettingValue(Key.QUERY_SIZE_LIMIT);
276+
}
277+
263278
// TODO https://github.com/opensearch-project/sql/issues/3457
264279
// Calcite is not available for SQL query now. Maybe release in 3.1.0?
265280
private boolean shouldUseCalcite(QueryType queryType) {

core/src/test/java/org/opensearch/sql/executor/QueryServiceTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import org.opensearch.sql.ast.statement.Explain;
2727
import org.opensearch.sql.ast.tree.UnresolvedPlan;
2828
import org.opensearch.sql.common.response.ResponseListener;
29+
import org.opensearch.sql.common.setting.Settings;
30+
import org.opensearch.sql.common.setting.Settings.Key;
2931
import org.opensearch.sql.executor.pagination.Cursor;
3032
import org.opensearch.sql.planner.PlanContext;
3133
import org.opensearch.sql.planner.Planner;
@@ -40,6 +42,8 @@ class QueryServiceTest {
4042

4143
@Mock private ExecutionEngine executionEngine;
4244

45+
@Mock private Settings settings;
46+
4347
@Mock private Analyzer analyzer;
4448

4549
@Mock private Planner planner;
@@ -101,8 +105,10 @@ class Helper {
101105
public Helper() {
102106
lenient().when(analyzer.analyze(any(), any())).thenReturn(logicalPlan);
103107
lenient().when(planner.plan(any())).thenReturn(plan);
108+
lenient().when(settings.getSettingValue(Key.QUERY_SIZE_LIMIT)).thenReturn(200);
109+
lenient().when(settings.getSettingValue(Key.CALCITE_ENGINE_ENABLED)).thenReturn(false);
104110

105-
queryService = new QueryService(analyzer, executionEngine, planner);
111+
queryService = new QueryService(analyzer, executionEngine, planner, null, settings);
106112
}
107113

108114
Helper executeSuccess() {

core/src/testFixtures/java/org/opensearch/sql/executor/DefaultExecutionEngine.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public void execute(
2828
context.getSplit().ifPresent(plan::add);
2929
plan.open();
3030

31-
while (plan.hasNext()) {
31+
Integer querySizeLimit = context.getQuerySizeLimit();
32+
while (plan.hasNext() && (querySizeLimit == null || result.size() < querySizeLimit)) {
3233
result.add(plan.next());
3334
}
3435
QueryResponse response =

docs/user/interfaces/endpoint.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Explain::
113113
CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])
114114
""",
115115
"physical": """EnumerableCalc(expr#0..1=[{inputs}], count()=[$t1], country=[$t0])
116-
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#57:LogicalAggregate.NONE.[](input=RelSubset#47,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])
116+
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#57:LogicalAggregate.NONE.[](input=RelSubset#47,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)])
117117
"""
118118
}
119119
}
@@ -162,7 +162,7 @@ Explain::
162162
CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])
163163
""",
164164
"physical": """EnumerableCalc(expr#0..1=[{inputs}], count()=[$t1], country=[$t0])
165-
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#125:LogicalAggregate.NONE.[](input=RelSubset#115,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])
165+
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#125:LogicalAggregate.NONE.[](input=RelSubset#115,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)])
166166
""",
167167
"extended": """public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root) {
168168
final org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan v1stashed = (org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan) root.get("v1stashed");
@@ -266,4 +266,3 @@ Result set::
266266
"size": 5,
267267
"status": 200
268268
}
269-

docs/user/optimization/optimization.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ The Aggregation operator will merge into OpenSearch Aggregation::
280280
{
281281
"name": "OpenSearchIndexScan",
282282
"description": {
283-
"request": "OpenSearchQueryRequest(indexName=accounts, sourceBuilder={\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"aggregations\":{\"composite_buckets\":{\"composite\":{\"size\":1000,\"sources\":[{\"gender\":{\"terms\":{\"field\":\"gender.keyword\",\"missing_bucket\":true,\"missing_order\":\"first\",\"order\":\"asc\"}}}]},\"aggregations\":{\"avg(age)\":{\"avg\":{\"field\":\"age\"}}}}}}, searchDone=false)"
283+
"request": "OpenSearchQueryRequest(indexName=accounts, 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\"}}}]},\"aggregations\":{\"avg(age)\":{\"avg\":{\"field\":\"age\"}}}}}}, searchDone=false)"
284284
},
285285
"children": []
286286
}
@@ -306,7 +306,7 @@ The Sort operator will merge into OpenSearch Aggregation.::
306306
{
307307
"name": "OpenSearchIndexScan",
308308
"description": {
309-
"request": "OpenSearchQueryRequest(indexName=accounts, sourceBuilder={\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"aggregations\":{\"composite_buckets\":{\"composite\":{\"size\":1000,\"sources\":[{\"gender\":{\"terms\":{\"field\":\"gender.keyword\",\"missing_bucket\":true,\"missing_order\":\"last\",\"order\":\"desc\"}}}]},\"aggregations\":{\"avg(age)\":{\"avg\":{\"field\":\"age\"}}}}}}, searchDone=false)"
309+
"request": "OpenSearchQueryRequest(indexName=accounts, sourceBuilder={\"from\":0,\"size\":0,\"timeout\":\"1m\",\"aggregations\":{\"composite_buckets\":{\"composite\":{\"size\":1000,\"sources\":[{\"gender\":{\"terms\":{\"field\":\"gender.keyword\",\"missing_bucket\":true,\"missing_order\":\"last\",\"order\":\"desc\"}}}]},\"aggregations\":{\"avg(age)\":{\"avg\":{\"field\":\"age\"}}}}}}, searchDone=false)"
310310
},
311311
"children": []
312312
}
@@ -341,7 +341,7 @@ Because the OpenSearch Composite Aggregation doesn't support order by metrics fi
341341
{
342342
"name": "OpenSearchIndexScan",
343343
"description": {
344-
"request": "OpenSearchQueryRequest(indexName=accounts, sourceBuilder={\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"aggregations\":{\"composite_buckets\":{\"composite\":{\"size\":1000,\"sources\":[{\"gender\":{\"terms\":{\"field\":\"gender.keyword\",\"missing_bucket\":true,\"missing_order\":\"first\",\"order\":\"asc\"}}}]},\"aggregations\":{\"avg(age)\":{\"avg\":{\"field\":\"age\"}}}}}}, searchDone=false)"
344+
"request": "OpenSearchQueryRequest(indexName=accounts, 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\"}}}]},\"aggregations\":{\"avg(age)\":{\"avg\":{\"field\":\"age\"}}}}}}, searchDone=false)"
345345
},
346346
"children": []
347347
}

docs/user/ppl/admin/settings.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ plugins.query.size_limit
125125
Description
126126
-----------
127127

128-
The size configure the maximum amount of documents to be pull from OpenSearch. The default value is: 10000
129-
130-
Notes: This setting will impact the correctness of the aggregation operation, for example, there are 1000 docs in the index, if you change the value to 200, only 200 docs will be extract from index and do aggregation.
128+
The size configures the maximum amount of rows to be fetched from PPL execution results. The default value is: 10000
131129

132130
Example
133131
-------
@@ -161,4 +159,3 @@ Rollback to default value::
161159
}
162160

163161
Note: the legacy settings of ``opendistro.query.size_limit`` is deprecated, it will fallback to the new settings if you request an update with the legacy name.
164-

docs/user/ppl/cmd/explain.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Explain::
7474
CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])
7575
""",
7676
"physical": """EnumerableCalc(expr#0..1=[{inputs}], count()=[$t1], country=[$t0])
77-
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#53:LogicalAggregate.NONE.[](input=RelSubset#43,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])
77+
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#53:LogicalAggregate.NONE.[](input=RelSubset#43,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)])
7878
"""
7979
}
8080
}
@@ -120,7 +120,7 @@ Explain::
120120
CalciteLogicalIndexScan(table=[[OpenSearch, state_country]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 72
121121
""",
122122
"physical": """EnumerableCalc(expr#0..1=[{inputs}], count()=[$t1], country=[$t0]): rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 138
123-
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#125:LogicalAggregate.NONE.[](input=RelSubset#115,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=10000, pageSize=null, startFrom=0)]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 133
123+
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#125:LogicalAggregate.NONE.[](input=RelSubset#115,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 133
124124
"""
125125
}
126126
}
@@ -144,7 +144,7 @@ Explain::
144144
CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])
145145
""",
146146
"physical": """EnumerableCalc(expr#0..1=[{inputs}], count()=[$t1], country=[$t0])
147-
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#193:LogicalAggregate.NONE.[](input=RelSubset#183,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])
147+
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[FILTER->SEARCH($1, Sarg['England', 'USA':CHAR(7)]:CHAR(7)), AGGREGATION->rel#193:LogicalAggregate.NONE.[](input=RelSubset#183,group={1},count()=COUNT())], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":0,"timeout":"1m","query":{"terms":{"country":["England","USA"],"boost":1.0}},"sort":[{"_doc":{"order":"asc"}}],"aggregations":{"composite_buckets":{"composite":{"size":1000,"sources":[{"country":{"terms":{"field":"country","missing_bucket":true,"missing_order":"first","order":"asc"}}}]},"aggregations":{"count()":{"value_count":{"field":"_index"}}}}}}, requestedTotalSize=2147483647, pageSize=null, startFrom=0)])
148148
""",
149149
"extended": """public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root) {
150150
final org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan v1stashed = (org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan) root.get("v1stashed");
@@ -189,4 +189,3 @@ Explain::
189189
"""
190190
}
191191
}
192-

0 commit comments

Comments
 (0)