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 2021/11/02 09:20:09 UTC

[GitHub] [flink] twalthr commented on a change in pull request #17624: [FLINK-24714][table-api-java] Validate partition keys for ResolvedCatalogTable

twalthr commented on a change in pull request #17624:
URL: https://github.com/apache/flink/pull/17624#discussion_r740854369



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogManager.java
##########
@@ -874,7 +876,24 @@ public ResolvedCatalogTable resolveCatalogTable(CatalogTable table) {
         if (table instanceof ResolvedCatalogTable) {
             return (ResolvedCatalogTable) table;
         }
+
         final ResolvedSchema resolvedSchema = table.getUnresolvedSchema().resolve(schemaResolver);
+
+        final List<String> physicalColumns =
+                DataType.getFieldNames(resolvedSchema.toPhysicalRowDataType());

Review comment:
       This check is about semantics. It should not be allowed to define partition columns on metadata column. This would mess up the handling in the sources. This behavior is similar to primary keys which are also only supported on physical columns.

##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogManager.java
##########
@@ -874,7 +876,24 @@ public ResolvedCatalogTable resolveCatalogTable(CatalogTable table) {
         if (table instanceof ResolvedCatalogTable) {
             return (ResolvedCatalogTable) table;
         }
+
         final ResolvedSchema resolvedSchema = table.getUnresolvedSchema().resolve(schemaResolver);
+
+        final List<String> physicalColumns =
+                DataType.getFieldNames(resolvedSchema.toPhysicalRowDataType());

Review comment:
       This check is about semantics. It should not be allowed to define partition columns on metadata columns or computed columns. This would mess up the handling in the sources. This behavior is similar to primary keys which are also only supported on physical columns.




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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org