SavicStefan commented on code in PR #59669:
URL: https://github.com/apache/spark/pull/59669#discussion_r4482161730
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/variant/VariantExpressionEvalUtils.scala:
##########
@@ -76,6 +76,21 @@ object VariantExpressionEvalUtils {
def isValidVariant(input: VariantVal): Boolean =
VariantUtil.isValidVariant(input.getValue, input.getMetadata)
+ def canonicalizeVariant(input: VariantVal): VariantVal = {
+ val variant = new Variant(input.getValue, input.getMetadata)
+ val canonicalized = try {
+ VariantBuilder.canonicalize(variant)
+ } catch {
+ case _: VariantSizeLimitException =>
+ throw QueryExecutionErrors.variantConstructorSizeLimitError()
Review Comment:
I kept `VARIANT_CONSTRUCTOR_SIZE_LIMIT` instead of adding a new condition
and also addressed this issue in #59928 for the size limit.
--
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]