libenchao commented on code in PR #3106:
URL: https://github.com/apache/calcite/pull/3106#discussion_r1187324497


##########
core/src/main/java/org/apache/calcite/rel/core/Snapshot.java:
##########
@@ -131,7 +131,8 @@ public RexNode getPeriod() {
 
   @Override public boolean isValid(Litmus litmus, @Nullable Context context) {
     RelDataType dataType = period.getType();
-    if (dataType.getSqlTypeName() != SqlTypeName.TIMESTAMP) {
+    if (dataType.getSqlTypeName() != SqlTypeName.TIMESTAMP

Review Comment:
   We can use `SqlTypeUtil#isTimestamp`?



##########
core/src/test/java/org/apache/calcite/test/RelBuilderTest.java:
##########
@@ -495,6 +495,30 @@ static RelBuilder 
createBuilder(UnaryOperator<RelBuilder.Config> transform) {
     assertThat(root, hasTree(expected));
   }
 
+  @Test void testJoinTemporalTableForTimestampWithLocalTimezone() {
+    // Equivalent SQL:
+    //   SELECT *
+    //   FROM orders
+    //   JOIN products_temporal FOR SYSTEM_TIME AS OF TIMESTAMP '2011-07-20 
12:34:56'

Review Comment:
   ```suggestion
       //   JOIN products_temporal FOR SYSTEM_TIME AS OF TIMESTAMP WITH LOCAL 
TIME ZONE '2011-07-20 12:34:56'
   ```



##########
core/src/test/java/org/apache/calcite/test/RelBuilderTest.java:
##########
@@ -495,6 +495,30 @@ static RelBuilder 
createBuilder(UnaryOperator<RelBuilder.Config> transform) {
     assertThat(root, hasTree(expected));
   }
 
+  @Test void testJoinTemporalTableForTimestampWithLocalTimezone() {
+    // Equivalent SQL:
+    //   SELECT *
+    //   FROM orders
+    //   JOIN products_temporal FOR SYSTEM_TIME AS OF TIMESTAMP '2011-07-20 
12:34:56'

Review Comment:
   ```suggestion
       //   JOIN products_temporal FOR SYSTEM_TIME AS OF TIMESTAMP WITH LOCAL 
TIME ZONE '2011-07-20 12:34:56'
   ```



##########
core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java:
##########
@@ -1246,6 +1246,14 @@ public static void checkActualAndReferenceFiles() {
     sql(sql).ok();
   }
 
+  @Test void testJoinTemporalTableOnSpecificTimeWithLocalTimeZone() {

Review Comment:
   ```suggestion
     @Test void testJoinTemporalTableOnSpecificTimestampWithLocalTimeZone() {
   ```



-- 
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]

Reply via email to