jibiyr commented on a change in pull request #2366:
URL: https://github.com/apache/calcite/pull/2366#discussion_r591279642
##########
File path: core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
##########
@@ -7766,6 +7770,32 @@ public void subTestIntervalSecondFailsValidation() {
SqlParserUtil.addCarets("abcdef", 1, 7, 1, 7));
}
+ @Test void testSnapshot() {
+ SqlNode tableRef = new SqlBasicCall(
+ new SqlAsOperator(),
+ new SqlNode[]{
+ new SqlIdentifier("default_db.products", new SqlParserPos(8, 11)),
+ new SqlIdentifier("products1", new SqlParserPos(8, 11))
+ },
+ new SqlParserPos(8, 11)
+ );
+ SqlNode period = new SqlIdentifier("orders.proctime", new SqlParserPos(8,
42));
+ SqlSnapshot sqlSnapshot = new SqlSnapshot(new SqlParserPos(8, 11),
tableRef, period);
+
+ SqlWriter sqlWriter = new SqlPrettyWriter();
+ sqlSnapshot.unparse(sqlWriter, 0, 0);
+
+ assertEquals(sqlWriter.toSqlString().getSql(), "\"default_db.products\" "
+ + "FOR SYSTEM_TIME AS OF \"orders.proctime\" AS \"products1\"");
Review comment:
thank you, danny I'll change it
----------------------------------------------------------------
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]