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 2020/05/27 04:11:46 UTC

[GitHub] [flink] danny0405 commented on a change in pull request #12275: [FLINK-16021][table-common] DescriptorProperties.putTableSchema does …

danny0405 commented on a change in pull request #12275:
URL: https://github.com/apache/flink/pull/12275#discussion_r430239805



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java
##########
@@ -610,7 +626,9 @@ public DataType getDataType(String key) {
 	public Optional<TableSchema> getOptionalTableSchema(String key) {
 		// filter for number of fields
 		final int fieldCount = properties.keySet().stream()
-			.filter((k) -> k.startsWith(key) && k.endsWith('.' + TABLE_SCHEMA_NAME))
+			.filter((k) -> k.startsWith(key)
+					// "key." is the prefix.
+					&& SCHEMA_COLUMN_NAME_SUFFIX.matcher(k.substring(key.length() + 1)).matches())

Review comment:
       I think the regex matching is a more general way to match column names for the long run, just remove some specific keys seems hacky from my side.




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