AHeise commented on code in PR #27594:
URL: https://github.com/apache/flink/pull/27594#discussion_r2832178174
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/materializedtable/MaterializedTableManager.java:
##########
@@ -827,11 +828,16 @@ private ResultFetcher
callAlterMaterializedTableChangeOperation(
operationExecutor, handle, tableIdentifier,
oldMaterializedTable);
// 2. alter materialized table schema & query definition
+ final MaterializedTableChangeHandler.MaterializedTableChangeResult
result =
+ MaterializedTableChangeHandler.buildNewMaterializedTable(
+ suspendMaterializedTable, op.getTableChanges());
AlterMaterializedTableChangeOperation
alterMaterializedTableChangeOperation =
new AlterMaterializedTableChangeOperation(
op.getTableIdentifier(),
op.getTableChanges(),
- suspendMaterializedTable);
+ suspendMaterializedTable,
+ result.getNewMaterializedTable(),
+ result.getValidationErrors());
Review Comment:
We could also calculate the newTable lazily in the operation. Then there is
a duality:
You either
* pass in the changes, which will result in getNewTable() doing the
calculation and cache the result, or
* pass in the newTable, which result in getChanges() doing the calculation
and cache the result.
One way to reflect the duality could also be two different subclasses
(PartialChangeOperation and FullChangeOperation).
--
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]