xuzifu666 commented on code in PR #4406:
URL: https://github.com/apache/calcite/pull/4406#discussion_r2128206453


##########
core/src/main/java/org/apache/calcite/sql/dialect/PrestoSqlDialect.java:
##########
@@ -248,10 +278,12 @@ public static void unparseMapValue(SqlWriter writer, 
SqlCall call,
    */
   public static SqlCall convertMapValueCall(SqlCall call) {
     boolean unnestMap = call.operandCount() > 0
-        && call.getOperandList().stream().allMatch(operand -> operand 
instanceof SqlLiteral);
+        && (call.getOperandList().get(0) instanceof SqlLiteral

Review Comment:
   This is to solve the problem of nested type conversion. According to the 
original logic, a case like **cast(map(...) as MAP<FLOAT, MAP<FLOAT,FLOAT>>)** 
will directly return call without converting the related types. @mihaibudiu 



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