Class SqlTableConstraint
java.lang.Object
org.apache.calcite.sql.SqlNode
org.apache.calcite.sql.SqlCall
org.apache.flink.sql.parser.ddl.constraint.SqlTableConstraint
- All Implemented Interfaces:
Cloneable
public class SqlTableConstraint
extends org.apache.calcite.sql.SqlCall
Table constraint of a table definition.
Syntax from SQL-2011 IWD 9075-2:201?(E) 11.3 <table definition>:
<table constraint definition> ::=
[ <constraint name definition> ] <table constraint>
[ <constraint characteristics> ]
<table constraint> ::=
<unique constraint definition>
<unique constraint definition> ::=
<unique specification> <left paren> <unique column list> <right paren>
<unique specification> ::=
UNIQUE
| PRIMARY KEY
-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlNode
EMPTY_ARRAY, pos -
Constructor Summary
ConstructorsConstructorDescriptionSqlTableConstraint(org.apache.calcite.sql.SqlIdentifier constraintName, org.apache.calcite.sql.SqlLiteral uniqueSpec, org.apache.calcite.sql.SqlNodeList columns, org.apache.calcite.sql.SqlLiteral enforcement, boolean isTableConstraint, org.apache.calcite.sql.parser.SqlParserPos pos) Creates a table constraint node. -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns the columns as a string array.org.apache.calcite.sql.SqlNodeListOptional<org.apache.calcite.sql.SqlIdentifier>List<org.apache.calcite.sql.SqlNode>org.apache.calcite.sql.SqlOperatorbooleanReturns whether the constraint is enforced.booleanReturns whether the constraint is PRIMARY KEY.booleanbooleanisUnique()Returns whether the constraint is UNIQUE.voidunparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) Methods inherited from class org.apache.calcite.sql.SqlCall
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, isCountStar, isExpanded, operand, operandCount, setOperand, validateMethods inherited from class org.apache.calcite.sql.SqlNode
clone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExpr
-
Constructor Details
-
SqlTableConstraint
public SqlTableConstraint(@Nullable org.apache.calcite.sql.SqlIdentifier constraintName, org.apache.calcite.sql.SqlLiteral uniqueSpec, org.apache.calcite.sql.SqlNodeList columns, @Nullable org.apache.calcite.sql.SqlLiteral enforcement, boolean isTableConstraint, org.apache.calcite.sql.parser.SqlParserPos pos) Creates a table constraint node.- Parameters:
constraintName- Constraint nameuniqueSpec- Unique specificationcolumns- Column list on which the constraint enforces or null if this is a column constraintenforcement- Whether the constraint is enforcedisTableConstraint- Whether this is a table constraintpos- Parser position
-
-
Method Details
-
getOperator
public org.apache.calcite.sql.SqlOperator getOperator()- Specified by:
getOperatorin classorg.apache.calcite.sql.SqlCall
-
isUnique
public boolean isUnique()Returns whether the constraint is UNIQUE. -
isPrimaryKey
public boolean isPrimaryKey()Returns whether the constraint is PRIMARY KEY. -
isEnforced
public boolean isEnforced()Returns whether the constraint is enforced. -
getConstraintName
-
getConstraintNameIdentifier
-
getColumns
public org.apache.calcite.sql.SqlNodeList getColumns() -
isTableConstraint
public boolean isTableConstraint() -
getColumnNames
Returns the columns as a string array. -
getOperandList
- Specified by:
getOperandListin classorg.apache.calcite.sql.SqlCall
-
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) - Overrides:
unparsein classorg.apache.calcite.sql.SqlCall
-