[jira] [Commented] (CALCITE-4001) Should support dialect when unparsing SqlDataTypeSpec
[ https://issues.apache.org/jira/browse/CALCITE-4001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116815#comment-17116815 ] Xurenhe commented on CALCITE-4001: -- Sorry for so late reply. That's exactly what I want. THX a lot~ [~julianhyde] > Should support dialect when unparsing SqlDataTypeSpec > - > > Key: CALCITE-4001 > URL: https://issues.apache.org/jira/browse/CALCITE-4001 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Xurenhe >Priority: Minor > > SqlBasicTypeNameSpec cannot cover all data types of other sql's engine, when > doing SqlNode To SqlString, > such as cast(id as bigint), but some sql-engine only support cast(id as long). > I think there should be based on dialect, just like > org.apache.calcite.sql.SqlDialect#unparseOffsetFetch. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CALCITE-4001) Should support dialect when unparsing SqlDataTypeSpec
[ https://issues.apache.org/jira/browse/CALCITE-4001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17107571#comment-17107571 ] Julian Hyde commented on CALCITE-4001: -- Are you aware of the work done in CALCITE-3534, adding {{SqlAlienSystemTypeNameSpec}}? > Should support dialect when unparsing SqlDataTypeSpec > - > > Key: CALCITE-4001 > URL: https://issues.apache.org/jira/browse/CALCITE-4001 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Xurenhe >Priority: Minor > > SqlBasicTypeNameSpec cannot cover all data types of other sql's engine, when > doing SqlNode To SqlString, > such as cast(id as bigint), but some sql-engine only support cast(id as long). > I think there should be based on dialect, just like > org.apache.calcite.sql.SqlDialect#unparseOffsetFetch. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CALCITE-4001) Should support dialect when unparsing SqlDataTypeSpec
[ https://issues.apache.org/jira/browse/CALCITE-4001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17107279#comment-17107279 ] Danny Chen commented on CALCITE-4001: - I'm curious how you get the SqlNode for expression "cast(id as long)" in current Calcite parser, because long is not a standard SQL type. Generally the SqlNode is very relevant with the parser, if you got the SqlNode tree(AST), the would be a parse node for the data type there. I mean, you should extend the parser to parse the "cast(id as long)" correctly. The RelNode tree is not about specific dialect, so there is a request to convert it to dialect sql string, there is indeed a method there `SqlDialect#getCastSpec`. > Should support dialect when unparsing SqlDataTypeSpec > - > > Key: CALCITE-4001 > URL: https://issues.apache.org/jira/browse/CALCITE-4001 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Xurenhe >Priority: Minor > > SqlBasicTypeNameSpec cannot cover all data types of other sql's engine, when > doing SqlNode To SqlString, > such as cast(id as bigint), but some sql-engine only support cast(id as long). > I think there should be based on dialect, just like > org.apache.calcite.sql.SqlDialect#unparseOffsetFetch. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CALCITE-4001) Should support dialect when unparsing SqlDataTypeSpec
[ https://issues.apache.org/jira/browse/CALCITE-4001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17107108#comment-17107108 ] Wang Yanlin commented on CALCITE-4001: -- May be add {noformat} public void unparseType(SqlWriter writer, RelDataType dataType, int leftPrec, int rightPrec) {noformat} in sql dialect. > Should support dialect when unparsing SqlDataTypeSpec > - > > Key: CALCITE-4001 > URL: https://issues.apache.org/jira/browse/CALCITE-4001 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Xurenhe >Priority: Minor > > SqlBasicTypeNameSpec cannot cover all data types of other sql's engine, when > doing SqlNode To SqlString, > such as cast(id as bigint), but some sql-engine only support cast(id as long). > I think there should be based on dialect, just like > org.apache.calcite.sql.SqlDialect#unparseOffsetFetch. -- This message was sent by Atlassian Jira (v8.3.4#803005)