[ 
https://issues.apache.org/jira/browse/CALCITE-2045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16356593#comment-16356593
 ] 

Julian Hyde commented on CALCITE-2045:
--------------------------------------

Don't add that kind of stuff to {{SqlDataTypeSpec}}. As a sub-class of 
{{SqlNode}}, it is an AST node, and should only have the information in the raw 
SQL; nothing should be 'resolved'.

It is the validator's job to figure out types. For an expression, you call 
{{RelDataType SqlValidator.getValidatedNodeType(SqlNode)}}. For a 
{{SqlDataTypeSpec}}, you could actually call the same method. It will use the 
{{SqlValidatorCatalogReader}} inside the validator. This has methods 
{{CalciteSchema getRootSchema()}} and {{RelDataType getNamedType(SqlIdentifier 
typeName)}}, both of which you will find useful.

> Support "CREATE TYPE" DDL
> -------------------------
>
>                 Key: CALCITE-2045
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2045
>             Project: Calcite
>          Issue Type: New Feature
>          Components: core
>            Reporter: Shuyi Chen
>            Assignee: Shuyi Chen
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to