bowenli86 commented on a change in pull request #8449: [FLINK-12235][hive] 
Support Hive partition in HiveCatalog
URL: https://github.com/apache/flink/pull/8449#discussion_r286602271
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
 ##########
 @@ -770,6 +778,16 @@ public void alterPartition(ObjectPath tablePath, 
CatalogPartitionSpec partitionS
                }
        }
 
+       // make sure both table and partition are generic, or neither is
+       private void ensureTableAndPartitionMatch(Table hiveTable, 
CatalogPartition catalogPartition) {
+               boolean isGeneric = 
Boolean.valueOf(hiveTable.getParameters().get(FLINK_PROPERTY_IS_GENERIC));
+               if ((isGeneric && catalogPartition instanceof 
HiveCatalogPartition) ||
+                       (!isGeneric && catalogPartition instanceof 
GenericCatalogPartition)) {
+                       throw new 
IllegalArgumentException(String.format("Cannot handle %s partition for %s 
table",
 
 Review comment:
   throw `CatalogException`

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