wuchong commented on a change in pull request #9994: [FLINK-14322][table-api] 
Add watermark information in TableSchema
URL: https://github.com/apache/flink/pull/9994#discussion_r341509127
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
 ##########
 @@ -100,14 +109,14 @@ private TableSchema(String[] fieldNames, DataType[] 
fieldDataTypes) {
         */
        @Deprecated
        public TableSchema(String[] fieldNames, TypeInformation<?>[] 
fieldTypes) {
-               this(fieldNames, fromLegacyInfoToDataType(fieldTypes));
+               this(fieldNames, fromLegacyInfoToDataType(fieldTypes), 
Collections.emptyList());
        }
 
        /**
         * Returns a deep copy of the table schema.
         */
        public TableSchema copy() {
-               return new TableSchema(fieldNames.clone(), 
fieldDataTypes.clone());
+               return new TableSchema(fieldNames.clone(), 
fieldDataTypes.clone(), new ArrayList<>(watermarkSpecs));
        }
 
 Review comment:
   Because WatermarkSpec is an immutable object. We don't need to clone an 
immutable object just like `String`.

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

Reply via email to