You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "bersprockets (via GitHub)" <gi...@apache.org> on 2023/07/18 17:55:48 UTC

[GitHub] [spark] bersprockets opened a new pull request, #42064: [SPARK-44477][SQL] Treat TYPE_CHECK_FAILURE_WITH_HINT as an error subclass

bersprockets opened a new pull request, #42064:
URL: https://github.com/apache/spark/pull/42064

   ### What changes were proposed in this pull request?
   
   In `CheckAnalysis#checkAnalysis0`, qualify the error subclass `TYPE_CHECK_FAILURE_WITH_HINT` with the error class `DATATYPE_MISMATCH`.
   
   ### Why are the changes needed?
   
   `CheckAnalysis` treats `TYPE_CHECK_FAILURE_WITH_HINT` as an error class, but it is actually an error subclass of `DATATYPE_MISMATCH`.
   ```
   spark-sql (default)> select bitmap_count(12);
   [INTERNAL_ERROR] Cannot find main error class 'TYPE_CHECK_FAILURE_WITH_HINT'
   org.apache.spark.SparkException: [INTERNAL_ERROR] Cannot find main error class 'TYPE_CHECK_FAILURE_WITH_HINT'
   	at org.apache.spark.SparkException$.internalError(SparkException.scala:83)
   	at org.apache.spark.SparkException$.internalError(SparkException.scala:87)
   	at org.apache.spark.ErrorClassesJsonReader.$anonfun$getMessageTemplate$1(ErrorClassesJSONReader.scala:68)
   	at scala.collection.immutable.HashMap$HashMap1.getOrElse0(HashMap.scala:361)
   	at scala.collection.immutable.HashMap$HashTrieMap.getOrElse0(HashMap.scala:594)
   	at scala.collection.immutable.HashMap$HashTrieMap.getOrElse0(HashMap.scala:589)
   	at scala.collection.immutable.HashMap.getOrElse(HashMap.scala:73)
   ```
   This issue only occurs when an expression uses `TypeCheckResult.TypeCheckFailure` to indicate input type check failure. `TypeCheckResult.TypeCheckFailure` appears to be deprecated in favor of `TypeCheckResult.DataTypeMismatch`, but recently two expressions were added that use `TypeCheckResult.TypeCheckFailure`: `BitmapCount` and `BitmapOrAgg`.
   
   `BitmapCount` and `BitmapOrAgg` should probably be fixed to use `TypeCheckResult.DataTypeMismatch`. Regardless, the code in `CheckAnalysis` that handles `TypeCheckResult.TypeCheckFailure` should either be fixed or removed. In this PR, I chose to fix it.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, except for the user seeing the correct error message.
   
   ### How was this patch tested?
   
   New unit test.
   


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon closed pull request #42064: [SPARK-44477][SQL] Treat TYPE_CHECK_FAILURE_WITH_HINT as an error subclass

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #42064: [SPARK-44477][SQL] Treat TYPE_CHECK_FAILURE_WITH_HINT as an error subclass
URL: https://github.com/apache/spark/pull/42064


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #42064: [SPARK-44477][SQL] Treat TYPE_CHECK_FAILURE_WITH_HINT as an error subclass

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #42064:
URL: https://github.com/apache/spark/pull/42064#issuecomment-1644838511

   Merged to master and branch-3.4.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org