snuyanzin commented on code in PR #27222:
URL: https://github.com/apache/flink/pull/27222#discussion_r2513790447
##########
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCreateMaterializedTable.java:
##########
@@ -150,20 +170,33 @@ public SqlNode getAsQuery() {
return asQuery;
}
+ /** Returns the column constraints plus the table constraints. */
+ public List<SqlTableConstraint> getFullConstraints() {
+ return SqlConstraintValidator.getFullConstraints(tableConstraints,
columnList);
+ }
+
+ @Override
+ public void validate() throws SqlValidateException {
+ if (!isSchemaWithColumnsIdentifiersOnly()) {
+
SqlConstraintValidator.validateAndChangeColumnNullability(tableConstraints,
columnList);
+ }
+ }
+
+ public boolean isSchemaWithColumnsIdentifiersOnly() {
+ // CREATE MATERIALIZED TABLE supports passing only column identifiers
in the column list. If
+ // the first column in the list is an identifier, then we assume the
rest of the
Review Comment:
there is no need for that since it is not a validation.
The validation that if first is identifier then others are as well happens
on parse level
I submitted a test for that
https://github.com/apache/flink/pull/27222/commits/dea931dc4f6df82f5a6f35f715e47a6c08a88388#diff-577f6e3825355f5a0662990dcebc9a6f4416156e0472f3ca05cbc86d750909a6R51-R57
--
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]