Skip to content
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

Update age_load to load scalar property values with appropriate type (#1519) (#1525) #1580

Merged
merged 3 commits into from
Feb 9, 2024

Conversation

rafsun42
Copy link
Member

@rafsun42 rafsun42 commented Feb 9, 2024

…pache#1519) (apache#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.
The json_validate() function is borrowed from PG16 with minor changes.
Because it does not exist in other versions of PG.
@github-actions github-actions bot added the PG12 PostgreSQL12 label Feb 9, 2024
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.
@jrgemignani jrgemignani merged commit 1343eca into apache:PG12 Feb 9, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PG12 PostgreSQL12
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants