fix: add delimiter parameter to load_labels_from_file and load_edges_from_file#2469
Open
mmustafasenoglu wants to merge 1 commit into
Open
fix: add delimiter parameter to load_labels_from_file and load_edges_from_file#2469mmustafasenoglu wants to merge 1 commit into
mmustafasenoglu wants to merge 1 commit into
Conversation
…from_file Closes apache#2449 Both load_labels_from_file and load_edges_from_file relied on PostgreSQL COPY's default comma delimiter, causing silent data corruption on labels and segfault on edges when using non-comma-delimited files. This adds an optional 'delimiter' TEXT parameter (default ',') to both functions, allowing users to specify the field separator: SELECT load_labels_from_file('graph', 'Label', 'file.csv', true, false, '|'); SELECT load_edges_from_file('graph', 'Edge', 'file.csv', false, '|'); Changes: - create_copy_options() now accepts and passes the delimiter to COPY - SQL function signatures updated with new delimiter parameter - Regression tests added for pipe-delimited vertex and edge files
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #2449
Both load_labels_from_file and load_edges_from_file relied on PostgreSQL COPY's default comma delimiter, causing silent data corruption on labels and segfault on edges when using non-comma-delimited files.
This adds an optional delimiter TEXT parameter (default comma) to both functions, allowing users to specify the field separator.
Changes
Usage
Backward Compatibility
The new parameter has a default value of comma, so all existing calls continue to work without changes.