dssysolyatin commented on code in PR #4696:
URL: https://github.com/apache/calcite/pull/4696#discussion_r2644751243
##########
server/src/test/java/org/apache/calcite/test/ServerParserTest.java:
##########
@@ -86,6 +99,24 @@ class ServerParserTest extends SqlParserTest {
sql(sql).ok(expected);
}
+ /** Test case for <a
href="https://issues.apache.org/jira/browse/CALCITE-7339">[CALCITE-7339]
+ * Most classes in SqlDdlNodes use an incorrect SqlCallFactory</a>. */
+ @Test void testShuttle() throws SqlParseException {
Review Comment:
This is one way to check that all operators have createCall and that it
creates SqlCall correctly.
1. Parse the SQL string into a SqlNode.
2. Unparse it and save the result as sql1.
3. Parse the SQL again.
4. Apply a shuttle that makes a deep copy of the tree.
5. Unparse copied tree and check that the SQL string is the same as in step
2.
This way, we do not need to write a separate test for each SqlOperator.
Having separate tests is also good, but with separate tests we might forget to
write one and miss validating some cases.
Anyway, you can just skip this part as separate tests are also OK for me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]