-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update age_load to load scalar property values with appropriate type (#…
…1519) (#1525) (#1581) * Update age_load to load scalar property values with appropriate type (#1519) (#1525) Previously, property values from csv files were always loaded as strings. This patch adds a boolean function parameter `load_as_agtype`. When this parameter is true, values are converted to an appropriate scalar type (i.e. string, bool, numeric, null) while loading. Otherwise, values are loaded as string. It uses the agtype_value_from_cstring() function for conversion. Additional change(s): ------------------- - Fix: for csv rows in edge files, create_agtype_from_list_i()'s start_index is corrected to 4 Note: ---- - It applies both patch 1519 and 1525. Conflicts: src/backend/utils/load/ag_load_labels.c src/backend/utils/load/age_load.c src/include/utils/load/ag_load_edges.h src/include/utils/load/age_load.h * Borrow json_validate() from PG16 The json_validate() function is borrowed from PG16 with minor changes. Because it does not exist in other versions of PG. * Update json_validate() to support PG12 and below For PG12 and below, pg_parse_json() does not return an error code. A TRY-CATCH block is used to catch errors and return false instead.
- Loading branch information
Showing
14 changed files
with
336 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
start_id, start_vertex_type, end_id, end_vertex_type, string, bool, numeric, | ||
1, Person1, 1, Person2, "John Smith", "true", 1 | ||
1, Person1, 1, Person2, "John", "false", "-2" | ||
1, Person1, 1, Person2, John Smith, true, 1.4 | ||
1, Person1, 1, Person2, """John""", false, -1e10 | ||
1, Person1, 1, Person2, null, false, 0 | ||
1, Person1, 1, Person2, nUll, false, "3.14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
id, string, bool, numeric, | ||
1, "John Smith", "true", 1 | ||
2, "John", "false", "-2" | ||
3, John Smith, true, 1.4 | ||
4, """John""", false, -1e10 | ||
5, null, false, 0 | ||
6, nUll, false, "3.14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.