snuyanzin commented on code in PR #28287:
URL: https://github.com/apache/flink/pull/28287#discussion_r3411675523
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/materializedtable/MaterializedTableManager.java:
##########
@@ -302,6 +284,145 @@ private void createMaterializedTableInFullMode(
}
}
+ private ResultFetcher callConvertTableToMaterializedTableOperation(
+ OperationExecutor operationExecutor,
+ OperationHandle handle,
+ ConvertTableToMaterializedTableOperation convertOperation) {
+ ResolvedCatalogMaterializedTable materializedTable =
+ convertOperation.getMaterializedTable();
+ if (RefreshMode.CONTINUOUS == materializedTable.getRefreshMode()) {
+ convertTableToMaterializedTableInContinuousMode(
+ operationExecutor, handle, convertOperation);
+ } else {
+ convertTableToMaterializedTableInFullMode(operationExecutor,
handle, convertOperation);
+ }
+ // Just return ok for unify different refresh job info of continuous
and full mode, user
+ // should get the refresh job info via desc table.
+ return ResultFetcher.fromTableResult(handle, TABLE_RESULT_OK, false);
+ }
+
+ private void convertTableToMaterializedTableInContinuousMode(
+ OperationExecutor operationExecutor,
+ OperationHandle handle,
+ ConvertTableToMaterializedTableOperation convertOperation) {
+ // swap the catalog entry from a regular table to a materialized table
first
+ operationExecutor.callExecutableOperation(handle, convertOperation);
+
+ ObjectIdentifier materializedTableIdentifier =
convertOperation.getTableIdentifier();
+ ResolvedCatalogMaterializedTable catalogMaterializedTable =
+ convertOperation.getMaterializedTable();
+
+ try {
+ executeContinuousRefreshJob(
+ operationExecutor,
+ handle,
+ catalogMaterializedTable,
+ materializedTableIdentifier,
+ Collections.emptyMap(),
Review Comment:
```suggestion
Map.of(),
```
here and in other places
--
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]