public class SqlRowTypeNameSpec extends SqlTypeNameSpec
The grammar definition in SQL-2011 IWD 9075-2:201?(E) 6.1 <data type> is as following:
<row type> ::=
ROW <row type body>
<row type body> ::=
<left paren> <field definition>
[ { <comma> <field definition> }... ]
<right paren>
<field definition> ::=
<field name> <data type>
As a extended syntax to the standard SQL, each field type can have a [ NULL | NOT NULL ] suffix specification, i.e. Row(f0 int null, f1 varchar not null). The default is NOT NULL(not nullable).
| Constructor and Description |
|---|
SqlRowTypeNameSpec(SqlParserPos pos,
List<SqlIdentifier> fieldNames,
List<SqlDataTypeSpec> fieldTypes)
Creates a row type specification.
|
| Modifier and Type | Method and Description |
|---|---|
RelDataType |
deriveType(SqlValidator sqlValidator)
Derive type from this SqlTypeNameSpec.
|
boolean |
equalsDeep(SqlTypeNameSpec node,
Litmus litmus)
Returns whether this spec is structurally equivalent to another spec.
|
int |
getArity() |
List<SqlIdentifier> |
getFieldNames() |
List<SqlDataTypeSpec> |
getFieldTypes() |
void |
unparse(SqlWriter writer,
int leftPrec,
int rightPrec)
Writes a SQL representation of this spec to a writer.
|
getParserPos, getTypeNamepublic SqlRowTypeNameSpec(SqlParserPos pos, List<SqlIdentifier> fieldNames, List<SqlDataTypeSpec> fieldTypes)
pos - The parser positionfieldNames - The field namesfieldTypes - The field data typespublic List<SqlIdentifier> getFieldNames()
public List<SqlDataTypeSpec> getFieldTypes()
public int getArity()
public void unparse(SqlWriter writer, int leftPrec, int rightPrec)
SqlTypeNameSpecunparse in class SqlTypeNameSpecpublic boolean equalsDeep(SqlTypeNameSpec node, Litmus litmus)
SqlTypeNameSpecequalsDeep in class SqlTypeNameSpecpublic RelDataType deriveType(SqlValidator sqlValidator)
SqlTypeNameSpecderiveType in class SqlTypeNameSpecsqlValidator - The sql validatorRelDataType instance, throws exception if we could not
deduce the typeCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.