snuyanzin commented on code in PR #28510:
URL: https://github.com/apache/flink/pull/28510#discussion_r3454210677
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/operations/converters/SqlNodeConvertUtils.java:
##########
@@ -108,6 +112,30 @@ static PlannerQueryOperation toQueryOperation(SqlNode
validated, ConvertContext
relational.project(), () ->
context.toQuotedSqlString(validated));
}
+ /**
+ * Validates the given materialized table {@code AS} query and converts it
into a {@link
+ * PlannerQueryOperation}. Shared by the CREATE / CREATE OR ALTER / ALTER
... AS converters.
+ */
+ public static PlannerQueryOperation validateAndConvertAsQuery(
+ SqlNode asQuery, ConvertContext context) {
+ final FlinkPlannerImpl flinkPlanner = context.getFlinkPlanner();
+ final SqlNode validated = flinkPlanner.validate(asQuery);
+ final Operation operation =
+ SqlNodeToOperationConversion.convert(
+ flinkPlanner, context.getCatalogManager(),
validated)
+ .orElseThrow(
+ () ->
+ new TableException(
Review Comment:
method has pretty generic name, then somewhere in the middle it throws
`"Unsupported materialized table definition query: "`
either make it generic or may be rename and move into. materializedTableUtils
--
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]