Skip to content

Commit 1530d68

Browse files
committed
Disable insertion of json_type operator (1864/2027)
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 666753c commit 1530d68

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,15 @@ public SqlNode visit(SqlIdentifier id) {
387387
RelOptCluster cluster = context.relBuilder.getCluster();
388388
CalciteCatalogReader catalogReader =
389389
validator.getCatalogReader().unwrap(CalciteCatalogReader.class);
390-
// Do not remove sort in subqueries so that the orders for queries like `... | sort a | fields
390+
// 1. Do not remove sort in subqueries so that the orders for queries like `... | sort a |
391+
// fields
391392
// b` is preserved
393+
// 2. Disable automatic JSON_TYPE_OPERATOR wrapping for nested JSON functions
394+
// (See CALCITE-4989: Calcite wraps nested JSON functions with JSON_TYPE by default)
392395
SqlToRelConverter.Config sql2relConfig =
393-
SqlToRelConverter.config().withRemoveSortInSubQuery(false);
396+
SqlToRelConverter.config()
397+
.withRemoveSortInSubQuery(false)
398+
.withAddJsonTypeOperatorEnabled(false);
394399
SqlToRelConverter sql2rel =
395400
new PplSqlToRelConverter(
396401
viewExpander,

0 commit comments

Comments
 (0)