raminqaf commented on code in PR #27292:
URL: https://github.com/apache/flink/pull/27292#discussion_r2577580000
##########
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlAlterMaterializedTableDistribution.java:
##########
@@ -50,13 +50,39 @@ public List<SqlNode> getOperandList() {
@Override
public void unparseAlterOperation(SqlWriter writer, int leftPrec, int
rightPrec) {
super.unparseAlterOperation(writer, leftPrec, rightPrec);
- writer.keyword("MODIFY");
- if (distribution != null) {
- distribution.unparseAlter(writer, leftPrec, rightPrec);
- }
+ writer.keyword(getAlterOperation());
+ distribution.unparseAlter(writer, leftPrec, rightPrec);
}
public Optional<SqlDistribution> getDistribution() {
return Optional.ofNullable(distribution);
}
+
+ public static class SqlAlterMaterializedTableAddDistribution
+ extends SqlAlterMaterializedTableDistribution {
+
+ public SqlAlterMaterializedTableAddDistribution(
+ SqlParserPos pos, SqlIdentifier tableName, SqlDistribution
distribution) {
+ super(pos, tableName, distribution);
+ }
+
+ @Override
+ protected String getAlterOperation() {
+ return "ADD";
+ }
+ }
+
+ public static class SqlAlterMaterializedTableModifyDistribution
+ extends SqlAlterMaterializedTableDistribution {
+
+ public SqlAlterMaterializedTableModifyDistribution(
+ SqlParserPos pos, SqlIdentifier tableName, SqlDistribution
distribution) {
+ super(pos, tableName, distribution);
+ }
+
+ @Override
+ protected String getAlterOperation() {
+ return "MODIFY";
+ }
+ }
Review Comment:
Should be also removed from this PR?
--
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]