MartinSahlen commented on PR #1662: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1662#issuecomment-2598306277
> > > @MartinSahlen @iffyio Please review it again. I know maybe it's not a good idea to solve it in this library. > > > > > > Given how I've shown that whether this is evaluated as a function or identifier/column depending on not just if it has parentheses or not, but also by what identifiers/columns are in scope I think this PR is not a good idea, and a bit of a slippery slope. It is easy to deal with this using a visitor pattern, which is what I think it is designed for - so this library can focus on syntax. > > @MartinSahlen but i have a question, as you said, `whether this is evaluated as a function or identifier/column depending on not just if it ...`, if this is correct. this library should not parse it into function call. this lib should leave it to caller. I have not checked out the details of this. if the "user" function in postgres is indeed parsed as as function and not an identifier yes that goes against what I said. At the same time, if this is always true in postgres then maybe it does make sense. But following this logic then, we should not allow users to decide how the library should define functions. Then all dialects should have this built in according to their own semantics. Meaning: we should not expose this functionality to callers of the library, but rather point to rewriting the AST. All this being said, it's not fully black and white I guess - if there is indeed some instances of this dialect specific logic already my argument is of course weaker. -- 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