leno23 opened a new pull request, #22294:
URL: https://github.com/apache/datafusion/pull/22294

   ## Which issue does this PR close?
   
   Closes #22254.
   
   ## Rationale for this change
   
   PostgreSQL returns `NULL` for expressions like `(array[10,20,30])[-1]`, 
while DataFusion previously treated negative subscripts as end-relative 
indexing (returning `30`).
   
   ## What changes are included in this PR?
   
   - When `datafusion.sql_parser.dialect` is `postgresql`, `array_element` 
returns NULL for negative indexes instead of counting from the end
   - Default (non-PostgreSQL) behavior is unchanged
   - Unit test for PostgreSQL-style negative subscript handling
   
   ## Are these changes tested?
   
   - [x] `cargo test -p datafusion-functions-nested test_array_element`
   
   ## Are there any user-facing changes?
   
   Yes. With PostgreSQL dialect configured, negative array subscripts now match 
PostgreSQL semantics.
   
   Made with [Cursor](https://cursor.com)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to