fix: add delimiter parameter to load_labels_from_file and load_edges_from_file#2469
fix: add delimiter parameter to load_labels_from_file and load_edges_from_file#2469mmustafasenoglu wants to merge 2 commits 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
|
Heads up @mmustafasenoglu — CI had never actually run on this branch (the workflow runs were sitting unapproved, which is why the PR showed no checks). I've approved them, and Build / Regression now fails. The cause is a missing expected-output regeneration. The new pipe-delimited cases were added to Regenerating Ping me once CI is green and I'll review the change itself — I have not looked at the delimiter handling yet, only at why the build was red. |
…limiter tests - Fix bare Cypher queries to use proper cypher() wrapper - Add missing pipe delimiter test section to age_load.out expected output The CI Build/Regression was failing because: 1. regress/sql/age_load.sql had bare Cypher queries without cypher() wrapper 2. regress/expected/age_load.out was not updated with pipe delimiter test output
|
@mmustafasenoglu There are a few minor diffs in |
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.