harshmotw-db commented on code in PR #46311:
URL: https://github.com/apache/spark/pull/46311#discussion_r1585910343
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/variant/VariantExpressionEvalUtils.scala:
##########
@@ -58,9 +59,13 @@ object VariantExpressionEvalUtils {
false
} else {
val variantValue = input.getValue
- // Variant NULL is denoted by basic_type == 0 and val_header == 0
- variantValue(0) == 0
- }
+ if(variantValue.isEmpty) {
Review Comment:
Resolved
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/variant/VariantExpressionEvalUtils.scala:
##########
@@ -58,9 +59,13 @@ object VariantExpressionEvalUtils {
false
} else {
val variantValue = input.getValue
- // Variant NULL is denoted by basic_type == 0 and val_header == 0
- variantValue(0) == 0
- }
+ if(variantValue.isEmpty) {
+ throw new SparkRuntimeException("MALFORMED_VARIANT", Map.empty)
Review Comment:
Resolved
--
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]