NobiGo commented on code in PR #3799:
URL: https://github.com/apache/calcite/pull/3799#discussion_r1617069969


##########
core/src/main/java/org/apache/calcite/sql/dialect/SparkSqlDialect.java:
##########
@@ -146,4 +152,15 @@ public SparkSqlDialect(SqlDialect.Context context) {
       super.unparseCall(writer, call, leftPrec, rightPrec);
     }
   }
+
+  @Override public @Nullable SqlNode getCastSpec(RelDataType type) {
+    if (type instanceof BasicSqlType) {
+      if (type.getSqlTypeName() == SqlTypeName.VARCHAR) {

Review Comment:
   Hi @YiwenWu , I have fix this.



##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -3519,9 +3519,57 @@ private SqlDialect nonOrdinalDialect() {
         + "FROM `foodmart`.`product`";
     final String expectedMysql = "SELECT CAST(`product_id` AS CHAR)\n"
         + "FROM `foodmart`.`product`";
+    final String expectedHive = "SELECT CAST(product_id AS STRING)\n"
+        + "FROM foodmart.product";
+    final String expectedSpark = "SELECT CAST(product_id AS STRING)\n"
+        + "FROM foodmart.product";
     sql(query)
         .withClickHouse().ok(expectedClickHouse)
-        .withMysql().ok(expectedMysql);
+        .withMysql().ok(expectedMysql)
+        .withHive().ok(expectedHive)
+        .withSpark().ok(expectedSpark);
+  }
+

Review Comment:
   Hi @YiwenWu , I have fix this.



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to