alamb opened a new pull request, #3122:
URL: https://github.com/apache/arrow-datafusion/pull/3122

   Draft:
   - [ ] builds on https://github.com/apache/arrow-datafusion/pull/3121
   - [ ] Needs improved type errors
   
   # Which issue does this PR close?
   
   Closes  https://github.com/apache/arrow-datafusion/issues/3115
   
    # Rationale for this change
   The core rationale is to be ready to support the next release of 
sqlparser-rs (which includes 
https://github.com/sqlparser-rs/sqlparser-rs/pull/566) we can
   
   More details here: 
https://github.com/sqlparser-rs/sqlparser-rs/pull/566#discussion_r941921187
   
   The `array()` function is Spark syntax.
   
   Postgres syntax is `array[]` and postgres actually treats the `array` 
keyword specially (it can not be used as a function)
   
   ```sql
   alamb=# select array(1,2);
   ERROR:  syntax error at or near "1"
   LINE 1: select array(1,2);
   ```
   
   # What changes are included in this PR?
   `. Rename `array()` to `make_array()` (so it doesn't conflict with postgres)
   2. Update SQL planner to support `array[]` call make_array for `array[]` 
syntax
   3. Tests for same
   
   # Are there any user-facing changes?
   1. `array()` is now written `make_array()`
   2. `array[]` supports columns rather than just constants (e.g. 
`array[column, column, ..]` now works)
   3. `make_array()` will error if the types can not be coerced to a common 
type, as in postgres and spark
   


-- 
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]

Reply via email to