bersprockets opened a new pull request, #42139: URL: https://github.com/apache/spark/pull/42139
### What changes were proposed in this pull request? Change `BitmapCount` and `BitmapOrAgg` to use `DataTypeMismatch` rather than `TypeCheckResult.TypeCheckFailure` to indicate incorrect input types. ### Why are the changes needed? It appears `TypeCheckResult.TypeCheckFailure` has been deprecated: No expressions except for the recently added `BitmapCount` and `BitmapOrAgg` are using it. ### Does this PR introduce _any_ user-facing change? This PR changes an error message for two expressions that are not yet in any released version of Spark. Before PR: ``` spark-sql (default)> select bitmap_count(12); [DATATYPE_MISMATCH.TYPE_CHECK_FAILURE_WITH_HINT] Cannot resolve "bitmap_count(12)" due to data type mismatch: Bitmap must be a BinaryType.; line 1 pos 7; 'Project [unresolvedalias(bitmap_count(12), None)] +- OneRowRelation spark-sql (default)> select bitmap_or_agg(12); [DATATYPE_MISMATCH.TYPE_CHECK_FAILURE_WITH_HINT] Cannot resolve "bitmap_or_agg(12)" due to data type mismatch: Bitmap must be a BinaryType.; line 1 pos 7; 'Aggregate [unresolvedalias(bitmap_or_agg(12, 0, 0), None)] +- OneRowRelation ``` After PR: ``` spark-sql (default)> select bitmap_count(12); [DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE] Cannot resolve "bitmap_count(12)" due to data type mismatch: Parameter 0 requires the "BINARY" type, however "12" has the type "INT".; line 1 pos 7; 'Project [unresolvedalias(bitmap_count(12), None)] +- OneRowRelation spark-sql (default)> select bitmap_or_agg(12); [DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE] Cannot resolve "bitmap_or_agg(12)" due to data type mismatch: Parameter 0 requires the "BINARY" type, however "12" has the type "INT".; line 1 pos 7; 'Aggregate [unresolvedalias(bitmap_or_agg(12, 0, 0), None)] +- OneRowRelation ``` ### How was this patch tested? New unit tests. -- 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]
