You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by "mmustafasenoglu (via GitHub)" <gi...@apache.org> on 2026/09/13 17:03:17 UTC

[PR] fix: treat split() delimiter as literal string, not regex (#2568) [age]

mmustafasenoglu opened a new pull request, #2569:
URL: https://github.com/apache/age/pull/2569

   Fixes #2568
   
   ## Problem
   
   `age_split()` passes the delimiter verbatim to PostgreSQL's `regexp_split_to_array()`, which compiles it as a regular expression. This causes:
   
   - `split('a.b.c', '.')` → `["", "", "", "", "", ""]` (dot matches every char)
   - `split('a+b+c', '+')` → ERROR (invalid regex quantifier)
   - `split('a|b', '|')` → `["a", "|", "b"]` (alternation splits at every position)
   
   Meanwhile, `age_replace()` treats the same delimiter literally, making the two functions internally inconsistent.
   
   openCypher defines the split delimiter as a **literal string**, matching Neo4j, Memgraph, and FalkorDB behavior.
   
   ## Fix
   
   Replace `regexp_split_to_array` with `string_to_array` in `age_split()`. PostgreSQL's `string_to_array` treats the delimiter as a plain literal string, which is the correct openCypher semantics.
   
   ## Test
   
   Added regression tests for regex metacharacter delimiters: `.  `, `|`, `+`, and multi-dot `a.b.c.d`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: treat split() delimiter as literal string, not regex (#2568) [age]

Posted by "mmustafasenoglu (via GitHub)" <gi...@apache.org>.
mmustafasenoglu commented on PR #2569:
URL: https://github.com/apache/age/pull/2569#issuecomment-6190495286

   Fixed the expected outputs to match the literal-split behavior (column widths/names, plus the empty-delimiter case which now returns the whole string instead of per-char split). Pushed, CI re-running — will check the results there. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: treat split() delimiter as literal string, not regex (#2568) [age]

Posted by "MuhammadTahaNaveed (via GitHub)" <gi...@apache.org>.
MuhammadTahaNaveed commented on PR #2569:
URL: https://github.com/apache/age/pull/2569#issuecomment-6112315123

   @mmustafasenoglu build fails


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: treat split() delimiter as literal string, not regex (#2568) [age]

Posted by "mmustafasenoglu (via GitHub)" <gi...@apache.org>.
mmustafasenoglu commented on PR #2569:
URL: https://github.com/apache/age/pull/2569#issuecomment-6124041268

   Fixed - the SQL function `string_to_array` maps to the C function `text_to_array`, there is no `string_to_array` symbol which broke the PG18 build. Pushed the correction, waiting for CI.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: treat split() delimiter as literal string, not regex (#2568) [age]

Posted by "MuhammadTahaNaveed (via GitHub)" <gi...@apache.org>.
MuhammadTahaNaveed commented on PR #2569:
URL: https://github.com/apache/age/pull/2569#issuecomment-6130312423

   @mmustafasenoglu regression tests fail... Could you please make sure the build and regression tests pass before marking the PRs ready for review? Thanks :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org