danny0405 commented on a change in pull request #1066: [CALCITE-2843] Babel
parser should support PostgreSQL casting operator '::'
URL: https://github.com/apache/calcite/pull/1066#discussion_r300819432
##########
File path: babel/src/test/java/org/apache/calcite/test/BabelParserTest.java
##########
@@ -219,6 +220,13 @@ private void checkExNotNull(SqlParserUtil.StringAndPos
sap, Throwable thrown) {
}
};
}
+
+ @Test public void testParsingPGCastingOperator() throws SqlParseException {
+ String query = "SELECT x::integer FROM (VALUES (1, 2)) as tbl(x,y)";
+ String expected = "SELECT `X` :: INTEGER\n"
+ + "FROM (VALUES (ROW(1, 2))) AS `TBL` (`X`, `Y`)";
+ sql(query).ok(expected);
Review comment:
Please add enough test for all the target data type cast for the babel.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services