Package org.apache.calcite.sql
Class SqlTypeNameSpec
java.lang.Object
org.apache.calcite.sql.SqlTypeNameSpec
- Direct Known Subclasses:
SqlBasicTypeNameSpec
,SqlCollectionTypeNameSpec
,SqlMapTypeNameSpec
,SqlRowTypeNameSpec
,SqlUserDefinedTypeNameSpec
A
SqlTypeNameSpec
is a type name specification that allows user to
customize sql node unparsing and data type deriving.
To customize sql node unparsing, override the method
unparse(SqlWriter, int, int)
.
To customize data type deriving, override the method
deriveType(SqlValidator)
.
-
Constructor Summary
ModifierConstructorDescriptionprotected
SqlTypeNameSpec
(SqlIdentifier name, SqlParserPos pos) Creates aSqlTypeNameSpec
. -
Method Summary
Modifier and TypeMethodDescriptionabstract RelDataType
deriveType
(SqlValidator validator) Derive type from this SqlTypeNameSpec.abstract boolean
equalsDeep
(SqlTypeNameSpec spec, Litmus litmus) Returns whether this spec is structurally equivalent to another spec.abstract void
Writes a SQL representation of this spec to a writer.
-
Constructor Details
-
SqlTypeNameSpec
Creates aSqlTypeNameSpec
.- Parameters:
name
- Name of the typepos
- Parser position, must not be null
-
-
Method Details
-
deriveType
Derive type from this SqlTypeNameSpec.- Parameters:
validator
- The sql validator- Returns:
- the
RelDataType
instance, throws exception if we could not deduce the type
-
unparse
Writes a SQL representation of this spec to a writer. -
equalsDeep
Returns whether this spec is structurally equivalent to another spec. -
getParserPos
-
getTypeName
-