lgbo-ustc commented on code in PR #8558:
URL: https://github.com/apache/incubator-gluten/pull/8558#discussion_r1953916054
##########
cpp-ch/local-engine/Rewriter/ExpressionRewriter.h:
##########
@@ -85,6 +85,24 @@ class GetJsonObjectFunctionWriter : public RelRewriter
}
}
}
+ String getJsonPathOfGetJSONObject(const
substrait::Expression_ScalarFunction & func)
+ {
+ String json_path = "";
+ for (size_t i = 1; i < func.arguments().size(); ++i)
+ {
+ auto json_path_pb = func.arguments(i).value();
+ if (!json_path_pb.has_literal() ||
!json_path_pb.literal().has_string())
+ {
+ break;
+ }
+ json_path += json_path_pb.literal().string();
+ if (i != func.arguments().size() - 1)
+ {
+ json_path += "#" ;
+ }
+ }
+ return json_path;
+ }
Review Comment:
When things become complex, I don't think this representation could be
flexible enogh any more. Let's consider the case with three levels of nested
calls. A tree structure should be OK. For example a json text as following
```json
[
"path1",
"path2",
"path3":[
"path3_1",
"path3_2": [ ....]
],
...
]
```
--
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]