panbingkun commented on code in PR #48908:
URL: https://github.com/apache/spark/pull/48908#discussion_r1888375789
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala:
##########
@@ -502,111 +496,119 @@ case class JsonTuple(children: Seq[Expression])
}
}
+ @transient
+ private lazy val evaluator: JsonTupleEvaluator =
JsonTupleEvaluator(fieldExpressions.length)
+
override def eval(input: InternalRow): IterableOnce[InternalRow] = {
Review Comment:
- I have written a slightly simplified version:
https://github.com/apache/spark/pull/49215
- For `non-codegen` logic, directly call `JsonTupleEvaluator#evaluate(input:
InternalRow)`
- For `codegen` logic, it seems very difficult to construct `InternalRow`
because we are still reusing the function `fields(input: InternalRow)` in
`JsonTupleEvaluator`, The expression is `BoundReference`, and `ordinal` varies
in different data scenarios, making it very difficult to construct
`InternalRow` that fits various scenarios.
--
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]