danny0405 commented on a change in pull request #1443: [CALCITE-3282] 
HiveSqlDialect unparse Interger type as Int in order to be compatible for 
Hive1.x
URL: https://github.com/apache/calcite/pull/1443#discussion_r322202200
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/sql/dialect/HiveSqlDialect.java
 ##########
 @@ -149,6 +127,22 @@ private void unparseTrim(SqlWriter writer, SqlCall call, 
int leftPrec,
   @Override public boolean supportsCharSet() {
     return false;
   }
+
+  @Override public SqlNode getCastSpec(final RelDataType type) {
+    if (type instanceof BasicSqlType) {
+      switch (type.getSqlTypeName()) {
+      case INTEGER:
+        final SqlBasicTypeNameSpec typeNameSpec = new SqlBasicTypeNameSpec(
+            INT,
+            type.getPrecision(),
+            type.getScale(),
 
 Review comment:
   Use `SqlUserDefinedTypeNameSpec` and pass in the name you want to use 
instead, there is no need to add a new `SqlTypeName`.

----------------------------------------------------------------
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

Reply via email to