Skip to content

DOC-2901: Add example for loading data from nested JSON arrays in GSQ…#326

Open
Tushar-TG-14 wants to merge 1 commit into4.2from
DOC-2901-json-loading-nested-array-example
Open

DOC-2901: Add example for loading data from nested JSON arrays in GSQ…#326
Tushar-TG-14 wants to merge 1 commit into4.2from
DOC-2901-json-loading-nested-array-example

Conversation

@Tushar-TG-14
Copy link
Copy Markdown
Collaborator

…L loading jobs

Comment on lines +428 to +431
LOAD "data.jsonl" TO VERTEX Person
VALUES ($"nested_object":"neighbors":"id",
$"nested_object":"neighbors":"name")
USING JSON_FILE="true";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOAD "data.jsonl" TO TEMP_TABLE t(id, name)
  VALUES (flatten_json_array($"nested_object":"neighbors", $"id", $"name"))
  USING JSON_FILE="true";
LOAD TEMP_TABLE t TO VERTEX Person VALUES ($"id", $"name");

Reference: https://docs.tigergraph.com/gsql-ref/4.2/ddl-and-loading/functions/token/flatten_json_array#_flatten_a_json_array_of_json_objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants