Skip to content

Commit 38bb66e

Browse files
committed
Fix post-merge compilation and test failures
- Add missing import for OpenSearchSparkSqlDialect in CalcitePPLNoMvTest (class moved from ppl to core/validate package) - Update CalcitePPLSpathTest.testSpathAutoExtractModeWithEval expected plan to match validation-deferred behavior (no eager SAFE_CAST) - Update CalcitePPLNoMvTest.testNoMvNonExistentField to accept "inferred array element type" error message
1 parent a80a6c6 commit 38bb66e

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

core/src/main/java/org/opensearch/sql/calcite/CalcitePlanContext.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public class CalcitePlanContext {
8787
*/
8888
@Setter private static SqlOperatorTableProvider operatorTableProvider;
8989

90-
9190
private CalcitePlanContext(FrameworkConfig config, SysLimit sysLimit, QueryType queryType) {
9291
this.config = config;
9392
this.sysLimit = sysLimit;

ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLNoMvTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.apache.calcite.sql.SqlNode;
1414
import org.apache.calcite.test.CalciteAssert;
1515
import org.junit.Test;
16+
import org.opensearch.sql.calcite.validate.OpenSearchSparkSqlDialect;
1617

1718
public class CalcitePPLNoMvTest extends CalcitePPLAbstractTest {
1819

@@ -200,7 +201,8 @@ public void testNoMvNonExistentField() {
200201
msg.toLowerCase().contains("does_not_exist")
201202
|| msg.toLowerCase().contains("field")
202203
|| msg.contains("ARRAY_COMPACT")
203-
|| msg.contains("ARRAY"));
204+
|| msg.contains("ARRAY")
205+
|| msg.contains("inferred array element type"));
204206
}
205207

206208
@Test

ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLSpathTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,11 @@ public void testSpathAutoExtractModeWithEval() {
6565
"source=EMP | spath input=ENAME output=result"
6666
+ " | eval age = result.user.age + 1 | fields age")
6767
.expectLogical(
68-
"LogicalProject(age=[+(SAFE_CAST(ITEM(JSON_EXTRACT_ALL($1),"
69-
+ " 'user.age')), 1.0E0)])\n"
68+
"LogicalProject(age=[+(ITEM(JSON_EXTRACT_ALL($1),"
69+
+ " 'user.age'), 1)])\n"
7070
+ " LogicalTableScan(table=[[scott, EMP]])\n")
7171
.expectSparkSQL(
72-
"SELECT TRY_CAST(JSON_EXTRACT_ALL(`ENAME`)['user.age']"
73-
+ " AS DOUBLE) + 1.0E0 `age`\n"
74-
+ "FROM `scott`.`EMP`");
72+
"SELECT JSON_EXTRACT_ALL(`ENAME`)['user.age'] + 1 `age`\n" + "FROM `scott`.`EMP`");
7573
}
7674

7775
@Test

0 commit comments

Comments
 (0)