You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "bojana-db (via GitHub)" <gi...@apache.org> on 2026/08/03 09:37:42 UTC
Re: [PR] [SPARK-58221][SQL] Add `try_variant_set` expression [spark]
bojana-db commented on code in PR #57373:
URL: https://github.com/apache/spark/pull/57373#discussion_r3702820973
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/variant/variantExpressions.scala:
##########
@@ -1077,36 +1079,48 @@ case class VariantSet(
case Some(parsed) =>
VariantExpressionEvalUtils.setAtPath(
inputVariant, parsed.javaSegments, parsed.pathStr, valValue, value.dataType,
- createIfMissingValue, prettyName)
+ createIfMissingValue, prettyName, failOnError)
case None =>
VariantExpressionEvalUtils.setAtPath(
inputVariant, p.asInstanceOf[UTF8String], valValue, value.dataType,
- createIfMissingValue, prettyName)
+ createIfMissingValue, prettyName, failOnError)
}
}
override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
val cls = VariantExpressionEvalUtils.getClass.getName.stripSuffix("$")
- nullSafeCodeGen(ctx, ev, (vVal, pVal, valVal, createVal) => {
- val fromArg = ctx.addReferenceObj("from", value.dataType)
+ val fromArg = ctx.addReferenceObj("from", value.dataType)
+ def call(vVal: String, pVal: String, valVal: String, createVal: String): String =
foldablePath match {
Review Comment:
Addressed in https://github.com/apache/spark/pull/57682.
--
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