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

Danny Chan commented on CALCITE-3282:
-------------------------------------

The SqlTypeNameSpec is a component of SqlDataTypeSpec to describe the sql type 
name (with attributes like type name, precision/scale, charSet), the 
SqlTypeNameSpec.unparse is invoked by SqlDataTypeSpec.unparse. The 
SqlDataTypeSpec.unparse method is inherit from SqlNode.unparse, i think of 2 
way to support your idea:
 * extend SqlNode.unparse to support sql dialect which is a huge change i don't 
suggest to do.
 * In the different, SqlDialect, match the SqlDataTypeSpec and unparse it 
specifically, we better do not modify the SqlDataTypeSpec and SqlTypeNameSpec, 
just put the unparse logic in SqlDialect. (We already did so for some rex call, 
i.e. the cast operation).

> Make every SqlDialect unparse their own data type
> -------------------------------------------------
>
>                 Key: CALCITE-3282
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3282
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: feng huang
>            Priority: Minor
>
> Every database might have different type or same type but different type 
> name, therefore making every SqlDialect parse their own data type is a 
> suitable way.
> for example, “select cast(col as int) from table” change to hive sql "select 
> cast(col as integer) from table", but "integer" is not allowed in hive.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to