public class SqlBasicTypeNameSpec extends SqlTypeNameSpec
Supported basic sql types grammar:
basicSqlType:
GEOMETRY
| BOOLEAN
| [ INTEGER | INT ]
| TINYINT
| SMALLINT
| BIGINT
| REAL
| DOUBLE [ PRECISION ]
| FLOAT
| BINARY [ precision ]
| [ BINARY VARYING | VARBINARY ] [ precision ]
| [ DECIMAL | DEC | NUMERIC ] [ precision [, scale] ]
| ANY [ precision [, scale] ]
| charType [ precision ] [ charSet ]
| varcharType [ precision ] [ charSet ]
| DATE
| TIME [ precision ] [ timeZone ]
| TIMESTAMP [ precision ] [ timeZone ]
charType:
CHARACTER
| CHAR
varcharType:
charType VARYING
| VARCHAR
charSet:
CHARACTER SET charSetName
timeZone:
WITHOUT TIME ZONE
| WITH LOCAL TIME ZONE
| Constructor and Description |
|---|
SqlBasicTypeNameSpec(SqlTypeName typeName,
int precision,
int scale,
SqlParserPos pos) |
SqlBasicTypeNameSpec(SqlTypeName typeName,
int precision,
int scale,
@Nullable String charSetName,
SqlParserPos pos)
Create a basic sql type name specification.
|
SqlBasicTypeNameSpec(SqlTypeName typeName,
int precision,
SqlParserPos pos) |
SqlBasicTypeNameSpec(SqlTypeName typeName,
int precision,
String charSetName,
SqlParserPos pos) |
SqlBasicTypeNameSpec(SqlTypeName typeName,
SqlParserPos pos) |
| Modifier and Type | Method and Description |
|---|---|
RelDataType |
deriveType(SqlValidator validator)
Derive type from this SqlTypeNameSpec.
|
boolean |
equalsDeep(SqlTypeNameSpec node,
Litmus litmus)
Returns whether this spec is structurally equivalent to another spec.
|
@Nullable String |
getCharSetName() |
int |
getPrecision() |
int |
getScale() |
void |
unparse(SqlWriter writer,
int leftPrec,
int rightPrec)
Writes a SQL representation of this spec to a writer.
|
getParserPos, getTypeNamepublic SqlBasicTypeNameSpec(SqlTypeName typeName, int precision, int scale, @Nullable String charSetName, SqlParserPos pos)
typeName - Type nameprecision - Precision of the type name if it is allowed, default is -1scale - Scale of the type name if it is allowed, default is -1charSetName - Char set of the type, only works when the type
belong to CHARACTER type familypos - The parser positionpublic SqlBasicTypeNameSpec(SqlTypeName typeName, SqlParserPos pos)
public SqlBasicTypeNameSpec(SqlTypeName typeName, int precision, SqlParserPos pos)
public SqlBasicTypeNameSpec(SqlTypeName typeName, int precision, String charSetName, SqlParserPos pos)
public SqlBasicTypeNameSpec(SqlTypeName typeName, int precision, int scale, SqlParserPos pos)
public int getScale()
public int getPrecision()
public @Nullable String getCharSetName()
public boolean equalsDeep(SqlTypeNameSpec node, Litmus litmus)
SqlTypeNameSpecequalsDeep in class SqlTypeNameSpecpublic void unparse(SqlWriter writer, int leftPrec, int rightPrec)
SqlTypeNameSpecunparse in class SqlTypeNameSpecpublic RelDataType deriveType(SqlValidator validator)
SqlTypeNameSpecderiveType in class SqlTypeNameSpecvalidator - The sql validatorRelDataType instance, throws exception if we could not
deduce the typeCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.