liuyongvs commented on code in PR #3238:
URL: https://github.com/apache/calcite/pull/3238#discussion_r1241087753


##########
core/src/main/java/org/apache/calcite/runtime/CalciteResource.java:
##########
@@ -897,6 +897,9 @@ ExInst<CalciteException> 
illegalArgumentForTableFunctionCall(String a0,
   @BaseMessage("Substring error: negative substring length not allowed")
   ExInst<CalciteException> illegalNegativeSubstringLength();
 
+  @BaseMessage("Illegal arguments: The length of the keys array {0,number,#} 
is not equal to the length of the values array {1,number,#} in MAP_FROM_ARRAYS 
function")

Review Comment:
   
   @NobiGo 
   
   1) this info is more  concrete, it will make user know what is the problem?
   2) the error info aligns with flink. because i think it is better than 
spark's info.
   
   ```
   spark error info
     "_LEGACY_ERROR_TEMP_2128" : {
       "message" : [
         "The key array and value array of MapData must have the same length."
       ]
   ```
   
   ```
   fink error info
           if (keysArray.size() != valuesArray.size()) {
               throw new FlinkRuntimeException(
                       "Invalid function MAP_FROM_ARRAYS call:\n"
                               + "The length of the keys array "
                               + keysArray.size()
                               + " is not equal to the length of the values 
array "
                               + valuesArray.size());
   
   
   
https://github.com/apache/flink/blob/65217c35e7c8f19acb1c7761d2a513ec9c0d316d/flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/scalar/MapFromArraysFunction.java#L30
   ```



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