RyanBerti commented on code in PR #41203:
URL: https://github.com/apache/spark/pull/41203#discussion_r1206054374


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -471,6 +471,11 @@
           "class <className> not found."
         ]
       },
+      "UNEXPECTED_INPUT_FOLDABLE_VALUE" : {
+        "message" : [
+          "Parameter <paramIndex> requires a foldable value of 
<requiredFoldable>, however <inputSql> has a foldable value of <inputFoldable>."

Review Comment:
   Hi @MaxGekk - I introduced the new error message as the text for 
`NON_FOLDABLE_INPUT` only makes sense when we expect the input to be foldable, 
but it is not. I tried to mimic the `ExpectsInputTypes.checkInputTypes` 
implementation in `ExpectsInputTypesAndFoldable`, which checks the foldable 
attribute of the expression against a user-provided expected value; this allows 
the trait to check if the foldable value is true OR false, and thus I needed an 
error message that was more general than `NON_FOLDABLE_INPUT`. I wonder if 
we'll ever want to make sure that an input expression isn't foldable (IE for 
this function arg, you should only ever specify a column)? If not, then maybe I 
can update the `ExpectsInputTypesAndFoldable` to only check for cases where we 
expect an expression to be foldable, and then re-use the `NON_FOLDABLE_INPUT` 
error message.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to