-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function to parse json format string prop #3513
Comments
Return a map? |
Hello. I am Akshata Kulkarni. I am interested in working on this issue. Is this issue still open to work on??It would be my first issue. Could you also please guide through this issue.Thanks |
Dear @akshatakulkarni25 , Welcome to the community, this issue is still open! I think a function similar to JSON_EXTRACT could be introduced here. @jievince do you see it as reasonable/feasible? whyThe motivation of this issue was NebulaGraph doesn't support nested datatype, in some cases, user may like to serialize JSON data in a string as properties of Tag/edgeType, thus, this function would enable data extracting in return expression. what
YIELD JSON_EXTRACT('{"a": 1, "b": 2, "c": {"d": 4}}') AS map_foo
+-------------------------+
| map_foo |
+-------------------------+
| {a: 1, b: 2, c: {d: 4}} |
+-------------------------+
YIELD JSON_EXTRACT('{"a": 1, "b": 2, "c": {"d": 4}}', '$.c') AS map_foo_dot_c
+-----------+
| map_foo |
+-----------+
| {d: 4} |
+-----------+ |
That's a good point. But it may be a bit troublesome to implement all the json functions in mysql. I suggest you could first implement a simple function, such as convertToMap, which takes a json string, and returns a map value it represents. |
The implementation of the builtin functions is here: https://github.com/vesoft-inc/nebula/blob/master/src/common/function/FunctionManager.cpp Looking forward to your contribution. |
also, one PR on introducing functions here Let us know your questions any time :) @akshatakulkarni25 |
Respected Sir,
Thank you for your reply. I look forward to learning from and contributing
to the repository.
Could I also reach out to you in case I have any doubts or queries
throughout the process through emails
Thank you.
Regards,
Akshata Kulkarni
…On Mon, 5 Sep 2022 at 1:43 PM, Wey Gu ***@***.***> wrote:
also, one PR on introducing functions here
<#4526>
—
Reply to this email directly, view it on GitHub
<#3513 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYHIZFKB7YX3VH3B56ULTC3V4WTSHANCNFSM5KPCCL2A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Dear @akshatakulkarni25 ,
|
May I know your status on this issue? It's ok if you could not make it, I am trying to prepare a PR on it, and in case yours is ready, we could co-work on yours instead. Thanks! |
close: #3513 Note, we don't support the path argument in this phase
* Introduce JSON_EXTRACT function close: #3513 Note, we don't support the path argument in this phase * address jievince's review commit removed the unecessary interface of construct Map from Value * Type handling Only primitive types are supported * Support depth1 nested * lint: fmt * ut: ctest, fixed wrong expression of Map * fix ut errors * tck: case for json_extract added Co-authored-by: Sophie <[email protected]>
* Introduce JSON_EXTRACT function close: #3513 Note, we don't support the path argument in this phase * address jievince's review commit removed the unecessary interface of construct Map from Value * Type handling Only primitive types are supported * Support depth1 nested * lint: fmt * ut: ctest, fixed wrong expression of Map * fix ut errors * tck: case for json_extract added Co-authored-by: Sophie <[email protected]>
* Fix/find start error (#4771) * Fix find start error. * Fix test. Co-authored-by: Sophie <[email protected]> * Introduce JSON_EXTRACT function (#4743) * Introduce JSON_EXTRACT function close: #3513 Note, we don't support the path argument in this phase * address jievince's review commit removed the unecessary interface of construct Map from Value * Type handling Only primitive types are supported * Support depth1 nested * lint: fmt * ut: ctest, fixed wrong expression of Map * fix ut errors * tck: case for json_extract added Co-authored-by: Sophie <[email protected]> * Fix bug #1337 from ent (#4740) * Return an semantic error if no tag is found for a property while validating a match. * Return an semantic error if no tag is found for a property while validating a match. * Add a tck case for the fixed bug. * commented out unused codes. * add tag in tck cases * fixing tck * updated tck cases to add missing cases that are supposed to be there. * Return an semantic error if no tag is found for a property while validating a match. * Add a tck case for the fixed bug. * commented out unused codes. * add tag in tck cases * fixing tck * updated tck cases to add missing cases that are supposed to be there. * update * update tck case. Co-authored-by: Sophie <[email protected]> * Fix RollUpApplyExecutor (#4778) Co-authored-by: Sophie <[email protected]> * Fix mutil-match crash in optimization phase (#4780) fmt small fix small fix * fix subgraph step (#4776) * fix subgraph step * forbid function call in where clause * fix error Co-authored-by: shylock <[email protected]> Co-authored-by: Wey Gu <[email protected]> Co-authored-by: Cheng Xuntao <[email protected]> Co-authored-by: Yichen Wang <[email protected]> Co-authored-by: kyle.cao <[email protected]> Co-authored-by: jimingquan <[email protected]>
checked on 3.3-rc |
* Introduce JSON_EXTRACT function close: vesoft-inc#3513 Note, we don't support the path argument in this phase * address jievince's review commit removed the unecessary interface of construct Map from Value * Type handling Only primitive types are supported * Support depth1 nested * lint: fmt * ut: ctest, fixed wrong expression of Map * fix ut errors * tck: case for json_extract added Co-authored-by: Sophie <[email protected]> Co-authored-by: Wey Gu <[email protected]> Co-authored-by: Sophie <[email protected]>
context: https://discuss.nebula-graph.com.cn/t/topic/6991
The text was updated successfully, but these errors were encountered: