You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/13 07:14:59 UTC

[GitHub] [flink] wuchong commented on a change in pull request #10536: [FLINK-15191][connectors / kafka]Fix can't create table source for Kafka if watermark or computed column is defined.

wuchong commented on a change in pull request #10536: [FLINK-15191][connectors / kafka]Fix can't create table source for Kafka if watermark or computed column is defined.
URL: https://github.com/apache/flink/pull/10536#discussion_r357500858
 
 

 ##########
 File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/descriptors/SchemaValidator.java
 ##########
 @@ -89,6 +95,13 @@ public void validate(DescriptorProperties properties) {
 			properties.validateString(SCHEMA + "." + i + "." + SCHEMA_NAME, false, 1);
 			properties.validateDataType(SCHEMA + "." + i + "." + SCHEMA_DATA_TYPE, SCHEMA + "." + i + "." + SCHEMA_TYPE, false);
 			properties.validateString(SCHEMA + "." + i + "." + SCHEMA_FROM, true, 1);
+
+			// validate generated column expression
+			final String generatedColumnExpressionKey = SCHEMA + "." + i + "." + TABLE_SCHEMA_EXPR;
+			if (properties.containsKey(generatedColumnExpressionKey)) {
+				properties.validateString(generatedColumnExpressionKey, false, 1);
+			}
 
 Review comment:
   simplify to one line:
   
   ```java
   properties.validateString(SCHEMA + "." + i + "." + TABLE_SCHEMA_EXPR, true, 1);
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services