xuyangzhong commented on code in PR #24760: URL: https://github.com/apache/flink/pull/24760#discussion_r1595409695
########## flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/materializedtable/MaterializedTableManager.java: ########## @@ -169,6 +181,83 @@ private static void createMaterializedInContinuousMode( } } + private static ResultFetcher callAlterMaterializedTableRefreshOperation( + OperationExecutor operationExecutor, + OperationHandle handle, + AlterMaterializedTableRefreshOperation alterMaterializedTableRefreshOperation) { + ObjectIdentifier materializedTableIdentifier = + alterMaterializedTableRefreshOperation.getTableIdentifier(); + ResolvedCatalogBaseTable<?> table = operationExecutor.getTable(materializedTableIdentifier); + if (!(table instanceof ResolvedCatalogMaterializedTable)) { + throw new TableException( + String.format( + "The table '%s' is not a materialized table.", + materializedTableIdentifier)); + } + + ResolvedCatalogMaterializedTable materializedTable = + (ResolvedCatalogMaterializedTable) table; + + Map<String, String> partitionSpec = + alterMaterializedTableRefreshOperation.getPartitionSpec(); + + Set<String> allPartitionKeys = + new HashSet<>(((ResolvedCatalogMaterializedTable) table).getPartitionKeys()); + Set<String> unknownPartitionKeys = new HashSet<>(partitionSpec.keySet()); + unknownPartitionKeys.removeAll(allPartitionKeys); + if (!unknownPartitionKeys.isEmpty()) { Review Comment: Choose 1. We can only support string type at first. -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org