dongjoon-hyun commented on code in PR #56685:
URL: https://github.com/apache/spark/pull/56685#discussion_r3461589120
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/json/JsonExpressionEvalUtils.scala:
##########
@@ -575,24 +575,32 @@ case class GetJsonObjectEvaluator(cachedPath: UTF8String)
{
}
/**
- * Evaluates multiple simple top-level JSON fields in one parse.
+ * Evaluates multiple simple named JSON paths in one parse.
*/
case class MultiGetJsonObjectEvaluator(
- fieldNames: Seq[String],
- fallbackPaths: Seq[UTF8String]) {
+ fallbackPaths: Seq[UTF8String],
+ namedPaths: Seq[Seq[String]]) {
import SharedFactory._
require(
- fieldNames.nonEmpty &&
- fieldNames.distinct.length == fieldNames.length &&
- fallbackPaths.length == fieldNames.length)
+ fallbackPaths.nonEmpty &&
+ namedPaths.length == fallbackPaths.length)
Review Comment:
Just nit. Shall we make this one liner because it's simple now?
```scala
- require(
- fallbackPaths.nonEmpty &&
- namedPaths.length == fallbackPaths.length)
+ require(fallbackPaths.nonEmpty && namedPaths.length ==
fallbackPaths.length)
```
--
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]