danny0405 commented on a change in pull request #1402: [CALCITE-3282] Make
every SqlDialect unparse their own data type
URL: https://github.com/apache/calcite/pull/1402#discussion_r318536272
##########
File path: core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java
##########
@@ -187,7 +187,7 @@ public SqlDataTypeSpec getComponentTypeSpec() {
}
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
- typeNameSpec.unparse(writer, leftPrec, rightPrec);
+ writer.getDialect().unparseDataType(writer, this, leftPrec, rightPrec);
}
Review comment:
Can we not modify this method ? Maybe you can match the `CAST` expression
directly in the `SqlDialect#unparseCall` method, then unparse the
SqlDataTypeSpec specifically(have a default implementation to invoke the method
`unparseDataType` you already defined.)
We just don't want the `SqlNode` to see all kinds of ` SqlDialect`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services