PHILO-HE commented on code in PR #10939:
URL: 
https://github.com/apache/incubator-gluten/pull/10939#discussion_r2536931246


##########
backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala:
##########
@@ -1905,6 +1905,17 @@ class MiscOperatorSuite extends 
VeloxWholeStageTransformerSuite with AdaptiveSpa
     }
   }
 
+  test("Test json_tuple has '.'") {

Review Comment:
   Maybe, this new test can be moved into the above one.



##########
backends-velox/src/main/scala/org/apache/gluten/execution/GenerateExecTransformer.scala:
##########
@@ -243,7 +243,11 @@ object PullOutGenerateProjectHelper extends 
PullOutProjectHelper {
               case jsonPath if jsonPath.foldable =>
                 Option(jsonPath.eval()) match {
                   case Some(path) =>
-                    GetJsonObject(jsonObj, Literal.create(JSON_PATH_PREFIX + 
path))
+                    if (path.toString.contains('.')) {
+                      GetJsonObject(jsonObj, Literal.create("$[" + path + "]"))
+                    } else {
+                      GetJsonObject(jsonObj, Literal.create(JSON_PATH_PREFIX + 
path.toString))

Review Comment:
   I just noted that for `json_tuple`, the JSON path is always used for getting 
top level data, not for accessing data in nested JSON structures.
   
   Can we uniformly convert path to `"$[" + path + "]"` even though it doesn't 
contain a dot? Then, we can also fix this issue for non-foldable jsonPath by 
applying this conversion at line 258.



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