twalthr commented on a change in pull request #15124:
URL: https://github.com/apache/flink/pull/15124#discussion_r591259973



##########
File path: docs/content.zh/docs/dev/table/types.md
##########
@@ -895,17 +899,20 @@ DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE(p)
 {{< /tab >}}
 {{< tab "Python" >}}
 ```python
+DataTypes.TIMESTAMP_LTZ(p)
 DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE(p)
 ```
 
-<span class="label label-danger">Attention</span> The `precision` specified in 
`DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE(p)` must be `3` currently.
+<span class="label label-danger">Attention</span> The `precision` specified in 
`DataTypes.TIMESTAMP_LTZ(p)` must be `3` currently.
 {{< /tab >}}
 {{< /tabs >}}
 
-The type can be declared using `TIMESTAMP(p) WITH LOCAL TIME ZONE` where `p` 
is the number
+The type can be declared using `TIMESTAMPLTZ(p)` where `p` is the number

Review comment:
       missing `_`

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
##########
@@ -477,6 +477,16 @@ public static DataType TIMESTAMP_WITH_LOCAL_TIME_ZONE(int 
precision) {
         return new AtomicDataType(new LocalZonedTimestampType(precision));
     }
 
+    /**
+     * Data type of a timestamp WITH LOCAL time zone {@code TIMESTAMP(p) WITH 
LOCAL TIME ZONE}. This

Review comment:
       Remove redundant code section and fix typo. Also below.
   ```
   Data type of a timestamp WITH LOCAL time zone. This is a synonym for {@link 
DataTypes#TIMESTAMP_WITH_LOCAL_TIME_ZONE(int)}.
   
   ```

##########
File path: 
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
##########
@@ -1095,6 +1097,16 @@ SqlTypeNameSpec ExtendedSqlBasicTypeName() :
             typeAlias = token.image;
             precision = Integer.MAX_VALUE;
         }
+    |
+       <TIMESTAMP_LTZ>
+       {
+           typeAlias = token.image;
+       }
+       precision = PrecisionOpt()
+       {
+            typeName = SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE;
+            return new SqlTimestampLtzTypeNameSpec(typeAlias, typeName, 
precision, getPos());

Review comment:
       can't we just use `SqlAlienSystemTypeNameSpec`? We do the same for 
`STRING`

##########
File path: flink-python/pyflink/table/tests/test_types.py
##########
@@ -563,6 +563,27 @@ def test_local_zoned_timestamp_type(self):
             ts2 = lztst.from_sql_type(0)
             self.assertEqual(ts.astimezone(), ts2.astimezone())
 
+    def test_timestampLtz_type(self):

Review comment:
       we should reduce code duplication, the same test code exists above. 
let's remove this change again. if you want to add a test you can simply 
compare if `DataTypes.TIMESTAMP_LTZ()
    == DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE()
   `




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


Reply via email to