Skip to content

Commit 7db73c0

Browse files
committed
Tighten inline comments
Signed-off-by: Kai Huang <ahkcs@amazon.com>
1 parent a3204d3 commit 7db73c0

4 files changed

Lines changed: 9 additions & 13 deletions

File tree

opensearch/src/main/java/org/opensearch/sql/opensearch/request/system/OpenSearchDescribeIndexRequest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ public Map<String, OpenSearchDataType> getFieldTypes() {
117117
fieldTypes.putAll(indexMapping.getFieldMappings());
118118
}
119119
} else {
120-
// Merge deep copies: MergeRuleHelper rewrites the accumulated type's nested `properties` in
121-
// place, which would otherwise mutate the per-index mappings retained above (they are reused
122-
// by partial-result partitioning, which needs to see each index's original mapping).
120+
// Merge deep copies: MergeRuleHelper mutates the field mappings in place, and the per-index
121+
// mappings retained above must stay intact for partial-result partitioning.
123122
for (IndexMapping indexMapping : indexMappings.values()) {
124123
MergeRuleHelper.merge(fieldTypes, deepCopy(indexMapping.getFieldMappings()));
125124
}

opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteLogicalIndexScan.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,8 @@ private AbstractRelNode pushDownAggregate(
411411
}
412412
return null;
413413
}
414-
// Decide partial mode before analyze, not after a failure: since #5646 a text/keyword
415-
// conflict pushes down as a (slow) _source script rather than failing, so a post-failure
416-
// fallback would never fire. Array/nested buckets (above) and other analyze failures are not
417-
// text/keyword conflicts, so partial mode does not apply to them.
414+
// Try partial mode before analyze: since #5646 a text/keyword conflict pushes down as a slow
415+
// _source script instead of failing, so a post-failure fallback would never fire.
418416
if (allowPartialFallback) {
419417
AbstractRelNode partial = tryPartialResultAggregate(aggregate, project, bucketNames);
420418
if (partial != null) {

plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ private static PPLQueryRequest parsePPLRequestFromPayload(RestRequest restReques
132132
if (queryId != null) {
133133
pplRequest.queryId(queryId);
134134
}
135-
// set per-request partial-result override only when explicitly present, so a request that
136-
// says nothing defers to the cluster setting rather than forcing the flag off.
135+
// Set the override only when present, so a request that omits it defers to the cluster
136+
// setting.
137137
if (jsonContent.has(QUERY_PARAMS_PARTIAL_RESULT)) {
138138
pplRequest.partialResult(jsonContent.optBoolean(QUERY_PARAMS_PARTIAL_RESULT));
139139
}

plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryAction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,10 @@ protected void doExecute(
180180
// in order to use PPL service, we need to convert TransportPPLQueryRequest to PPLQueryRequest
181181
PPLQueryRequest transformedRequest = transportRequest.toPPLQueryRequest();
182182
QueryContext.setProfile(transformedRequest.profile());
183-
// Only the JSON response shape carries a warnings channel. Features that return a
184-
// knowingly-partial result gate on this so they never silently drop data into CSV/RAW/VIZ.
183+
// Only the JSON shape carries warnings; gate partial results on it so CSV/RAW/VIZ never drop
184+
// data silently.
185185
QueryContext.setWarningsSupported(warningsSupported(transformedRequest));
186-
// Per-request partial-result override (e.g. from a Dashboards toggle); null defers to the
187-
// cluster setting.
186+
// Per-request override (e.g. a Dashboards toggle); null defers to the cluster setting.
188187
QueryContext.setPartialResultOverride(transformedRequest.partialResult());
189188
ActionListener<TransportPPLQueryResponse> clearingListener = wrapWithProfilingClear(listener);
190189

0 commit comments

Comments
 (0)