Skip to content

Commit

Permalink
[Enhancement](planner) Make nereids more compatible with spark-sql sy…
Browse files Browse the repository at this point in the history
…ntax.
  • Loading branch information
wangxiangyu committed Nov 24, 2023
1 parent 74c40c9 commit 291a880
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,16 @@ public void testParseSQLWithTrinoDialect() {
}

@Test
public void testParseSQLWithHiveDialect() {
public void testParseSQLWithSparkSqlDialect() {
// doris parser will throw a ParseException when derived table does not have alias
String sql1 = "select * from (select * from t1);";
NereidsParser nereidsParser = new NereidsParser();
Assertions.assertThrows(ParseException.class, () -> nereidsParser.parseSQL(sql1),
"Every derived table must have its own alias");

// test parse with hive dialect
// test parse with spark-sql dialect
SessionVariable sessionVariable = new SessionVariable();
sessionVariable.setSqlDialect("hive");
sessionVariable.setSqlDialect("spark_sql");
List<StatementBase> statementBases = nereidsParser.parseSQL(sql1, sessionVariable);
Assertions.assertEquals(1, statementBases.size());
Assertions.assertTrue(statementBases.get(0) instanceof LogicalPlanAdapter);
Expand Down

0 comments on commit 291a880

Please sign in to comment.