Package org.apache.flink.sql.parser
Class SqlConstraintValidator
- java.lang.Object
-
- org.apache.flink.sql.parser.SqlConstraintValidator
-
public class SqlConstraintValidator extends Object
Util to validateSqlTableConstraint
.
-
-
Constructor Summary
Constructors Constructor Description SqlConstraintValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<SqlTableConstraint>
getFullConstraints(List<SqlTableConstraint> tableConstraints, org.apache.calcite.sql.SqlNodeList columnList)
Returns the column constraints plus the table constraints.static void
validate(SqlTableConstraint constraint)
Check table constraint.static void
validateAndChangeColumnNullability(List<SqlTableConstraint> tableConstraints, org.apache.calcite.sql.SqlNodeList columnList)
Check constraints and change the nullability of primary key columns.
-
-
-
Method Detail
-
getFullConstraints
public static List<SqlTableConstraint> getFullConstraints(List<SqlTableConstraint> tableConstraints, org.apache.calcite.sql.SqlNodeList columnList)
Returns the column constraints plus the table constraints.
-
validateAndChangeColumnNullability
public static void validateAndChangeColumnNullability(List<SqlTableConstraint> tableConstraints, org.apache.calcite.sql.SqlNodeList columnList) throws SqlValidateException
Check constraints and change the nullability of primary key columns.- Throws:
SqlValidateException
- if encountered duplicate primary key constraints, or the constraint is enforced or unique.
-
validate
public static void validate(SqlTableConstraint constraint) throws SqlValidateException
Check table constraint.- Throws:
SqlValidateException
-
-