alamb opened a new issue, #3115:
URL: https://github.com/apache/arrow-datafusion/issues/3115

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   In https://github.com/sqlparser-rs/sqlparser-rs/pull/566, @MazterQyou  is 
adding some more sophisticated support for `array` parsing in SQL and it turns 
out that postgres treats the the `array` keyword specially so it can't be a 
function
   
   Datafusion already has support for the equivalent array creation using the 
postgres syntax `array[]` (note the brackets):
   
   ```sql
   ❯ select array[1,2];
   +-------------+
   | List([1,2]) |
   +-------------+
   | [1, 2]      |
   +-------------+
   1 row in set. Query took 0.053 seconds.
   ❯ select array(1,2);
   +--------------------------+
   | array(Int64(1),Int64(2)) |
   +--------------------------+
   | [1, 2]                   |
   +--------------------------+
   1 row in set. Query took 0.016 seconds.
   ```
   
   **Describe the solution you'd like**
   I propose removing support for `select array(1,2)` syntax to conform with 
posgres:
   
   ```
   alamb=# select array[1,2];
    array 
   -------
    {1,2}
   (1 row)
   
   alamb=# select array(1,2);
   ERROR:  syntax error at or near "1"
   LINE 1: select array(1,2);
                        ^
   ```
   
   
   
   
   
   **Describe alternatives you've considered**
   Do something special with parser
   
   **Additional context**
   
   This change will likely be required when we update to the next change of 
sqlparser: https://github.com/sqlparser-rs/sqlparser-rs/pull/566


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