docete commented on a change in pull request #11493: 
[FLINK-16160][table-common] Support computed column, proctime and watermark in 
Schema descriptor
URL: https://github.com/apache/flink/pull/11493#discussion_r400632587
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Schema.java
 ##########
 @@ -85,11 +111,25 @@ public Schema schema(TableSchema schema) {
         * @param fieldType the type information of the field
         */
        public Schema field(String fieldName, DataType fieldType) {
-               addField(fieldName, 
fieldType.getLogicalType().asSerializableString());
-               return this;
+               return field(fieldName, fieldType, null);
        }
 
 
+       /**
+        * Adds a field with the field name and the data type. Required.
+        * This method can be called multiple times. The call order of this 
method defines
+        * also the order of the fields in a row.
+        *
+        * @param fieldName the field name
+        * @param fieldType the type information of the field
+        * @param fieldExpr Computed column expression, it should be a 
SQL-style expression whose
+        *                  identifiers should be all quoted and expanded.
+        */
+       public Schema field(String fieldName, DataType fieldType, String 
fieldExpr) {
 
 Review comment:
   The basic of quoting expression and deriving data type is SqlNode in DDL 
code base. I'm afraid it's hard achieve that in descriptor API. Any ideas?

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