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

   ## Which issue does this PR close?
   Fixes #14141.
   
   ## Rationale for this change
   When a reserved function like `user` is called without parenthesis, it may 
as well be a column. This works in PostgreSQL for example:
   
   ```text
   psql (17.5 (Debian 17.5-1.pgdg120+1))
   Type "help" for help.
   
   postgres=# create table t(a int, "user" text);
   CREATE TABLE
   postgres=# insert into t values (1, 'foo');
   INSERT 0 1
   postgres=# select t.user from t;
    user
   ------
    foo
   (1 row)
   postgres=# select user from t;
      user
   ----------
    postgres
   (1 row)
   ```
   
   However sqlparser tries to detect these functions, see 
https://github.com/apache/datafusion-sqlparser-rs/issues/1909
   
   ## What changes are included in this PR?
   We now first try to use the respective function and then also consider 
columns.
   
   ## Are these changes tested?
   More sqllogictests
   
   ## Are there any user-facing changes?
   More queries work as expected (IMHO).
   


-- 
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: github-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to