beyond1920 commented on code in PR #10426:
URL: https://github.com/apache/hudi/pull/10426#discussion_r1444512704
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HoodieHiveCatalog.java:
##########
@@ -971,6 +952,59 @@ public void alterPartitionColumnStatistics(
throw new HoodieCatalogException("Not supported.");
}
+ public boolean isUpdatePermissible(ObjectPath tablePath, CatalogBaseTable
newCatalogTable, boolean ignoreIfNotExists) throws TableNotExistException {
+ if (!newCatalogTable.getOptions().getOrDefault(CONNECTOR.key(),
"").equalsIgnoreCase("hudi")) {
+ throw new HoodieCatalogException(String.format("The %s is not hoodie
table", tablePath.getObjectName()));
+ }
+ if (newCatalogTable instanceof CatalogView) {
+ throw new HoodieCatalogException("Hoodie catalog does not support to
ALTER VIEW");
+ }
+
+ try {
+ Table hiveTable = getHiveTable(tablePath);
+ if (!sameOptions(hiveTable.getParameters(),
newCatalogTable.getOptions(), FlinkOptions.TABLE_TYPE)
+ || !sameOptions(hiveTable.getParameters(),
newCatalogTable.getOptions(), FlinkOptions.INDEX_TYPE)) {
Review Comment:
@xiarixiaoyao After I forbid modifying `primaryKeys` and `preCombinekeys`,
some tests failed in `TestHoodieHiveCatalog.testCreateAndGetHoodieTable` and
`TestHoodieHiveCatalog.testCreateAndGetHoodieTable`.
See more info in [Failed
pipelines](https://dev.azure.com/apache-hudi-ci-org/apache-hudi-ci/_build/results?buildId=21861&view=logs&j=600e7de6-e133-5e69-e615-50ee129b3c08&t=bbbd7bcc-ae73-56b8-887a-cd2d6deaafc7).
Maybe the real user would also modify `primaryKeys` and `preCombinekeys`
after create the table.
I would remove those limitation.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]