vladanvasi-db commented on PR #48121: URL: https://github.com/apache/spark/pull/48121#issuecomment-2360121552
> left some more comments, but overall looking better to me > > on another note - I think we should consider adding a new error class (instead of relying on `DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE` here) > > one reason for this is that `UNEXPECTED_INPUT_TYPE` will give an error message that looks something like: > > > "Parameter ... of function ... requires the STRING type, however ... has the type STRING COLLATE UNICODE_AI." > > which I think is rather confusing > > another reason is that this is indeed a special case, and shouldn't use such a generic error condition - instead, we should add a new one that offers a better explanation to the user I partially agree, but I would still use this class instead of adding the new error class. This class is being used in `Analyzer` and is in deed thrown when the input types are not correct/supported. In this case, I think that adding a new error class would just mean adding more secondary changes that in this PR that would make it more complicated and are not directly related to the main point of it. I would propose to leave this PR as it is with `DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE` and if it is not suitable for users, we can refactor it in a followup PR. However, this PR is meant for ensuring the correct behavior of expressions. -- 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]
