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_r341510296
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
 ##########
 @@ -343,13 +404,36 @@ public Builder field(String name, TypeInformation<?> 
typeInfo) {
                        return field(name, fromLegacyInfoToDataType(typeInfo));
                }
 
+               /**
+                * Specifies the previously defined field as an event-time 
attribute and specifies the watermark strategy.
+                *
+                * @param rowtimeAttribute the field name as a rowtime 
attribute, can be a nested field using dot separator.
+                * @param watermarkExpressionString the string representation 
of watermark generation expression,
+                *                                  e.g. "ts - INTERVAL '5' 
SECOND". The string is a qualified SQL expression
+                *                                  string (UDFs are expanded) 
but will not be validated by {@link TableSchema}.
+                * @param watermarkExprOutputType the data type of the 
computation result of watermark generation expression.
+                *                                Whether the data type equals 
to the output type of expression will also
+                *                                not be validated by {@link 
TableSchema}.
+                */
+               public Builder watermark(String rowtimeAttribute, String 
watermarkExpressionString, DataType watermarkExprOutputType) {
+                       Preconditions.checkNotNull(rowtimeAttribute);
 
 Review comment:
   We don't run out of characters. A better field name describes everything. If 
we use `watermarkExpr`, some users may guess it is an `Expression` but is a 
`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