uros-b commented on code in PR #57373:
URL: https://github.com/apache/spark/pull/57373#discussion_r3624191112


##########
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:
   A foldable malformed path plus a runtime NULL argument returns NULL in 
interpreted mode but throws INVALID_VARIANT_PATH with codegen. foldablePath is 
parsed during code generation before runtime null checks. A combined 
malformed-path/runtime-NULL test should cover both execution modes.



-- 
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]

Reply via email to