vnhive commented on a change in pull request #2459:
URL: https://github.com/apache/calcite/pull/2459#discussion_r669517049



##########
File path: 
core/src/main/java/org/apache/calcite/sql/dialect/RedshiftSqlDialect.java
##########
@@ -45,4 +49,24 @@ public RedshiftSqlDialect(Context context) {
       @Nullable SqlNode fetch) {
     unparseFetchUsingLimit(writer, offset, fetch);
   }
+
+  @Override public SqlNode getCastSpec(RelDataType type) {
+    String castSpec;
+    switch (type.getSqlTypeName()) {
+    case TINYINT:
+      // Postgres has no tinyint (1 byte), so instead cast to smallint (2 
bytes)

Review comment:
       Done.

##########
File path: 
core/src/main/java/org/apache/calcite/sql/dialect/RedshiftSqlDialect.java
##########
@@ -45,4 +49,24 @@ public RedshiftSqlDialect(Context context) {
       @Nullable SqlNode fetch) {
     unparseFetchUsingLimit(writer, offset, fetch);
   }
+
+  @Override public SqlNode getCastSpec(RelDataType type) {
+    String castSpec;
+    switch (type.getSqlTypeName()) {
+    case TINYINT:
+      // Postgres has no tinyint (1 byte), so instead cast to smallint (2 
bytes)
+      castSpec = "smallint";
+      break;
+    case DOUBLE:
+      // Postgres has a double type but it is named differently

Review comment:
       Done.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to