calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bozo Dragojevic <bo...@digiverse.si>
Subject SqlNode.toSqlString() not parseable by calcite?
Date Thu, 28 May 2020 09:14:21 GMT
Hi!


In trying to fix https://issues.apache.org/jira/browse/DRILL-7722

I think the path leads to calcite...


So a question, is SqlNode.toSqlString() supposed to produce a SQL string

that is parseable by calcite?


I've created this little change to the TesterImpl.check() method to also
parse the expected result

and that fails for all the tests. Is this behavior by design?


Cheers,

Bozzo


-----

$ git diff
diff --git
a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
index 21b664fb4..0c79a16b6 100644
--- a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
+++ b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
@@ -8838,6 +8838,10 @@ public void check(String sql, SqlDialect dialect,
String expected,
           dialect == null ? UnaryOperator.identity() :
dialect::configureParser,
           parserChecker);
       check(sqlNode, dialect, expected);
+      final SqlNode expectedSqlNode  = parseStmtAndHandleEx(expected,
+          dialect == null ? UnaryOperator.identity() :
dialect::configureParser,
+          parserChecker);
+      check(expectedSqlNode, dialect, expected);
     }

     protected SqlNode parseStmtAndHandleEx(String sql,

Mime
View raw message