File tree Expand file tree Collapse file tree
core/src/main/java/org/opensearch/sql/executor Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments