-
Notifications
You must be signed in to change notification settings - Fork 609
listagg
support?
#169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You're right, and PRs are welcome! According to the spec, the syntax seems to be:
|
Should this be an extension to the |
Well, #40 made the point that the more complex enum variants are more convenient to work with when they wrap a separate type, like The most straightforward approach would be to add an |
Makes sense. I started implementing this as an entirely new type a la |
A new type is fine, the question is how it integrates with the existing AST types. TOP is not a good analogy in this regard, as it's referred to via a
|
By the way, I just noticed your example had this: |
My plan was to tie this new type into That is not a typo, that’s valid Redshift (and I would assume Postgres) SQL. |
Sure, if you just meant Top to be an example of a separate type, that's cool. Thanks for confirming that Redshift decided to make WITHIN GROUP optional, and the delimiter too, it appears:
( https://modern-sql.com/feature/listagg doesn't list Postgres a supporting LISTAGG at all yet.) |
Interesting—I didn’t realize Postgres doesn’t support it. It seems like there’s not yet a Redshift dialect in the codebase. I’d be interested in this since that’s our primary use case but happy to address that separately if that makes sense to you. |
Yes, if you're willing to discuss a Redshift dialect, let's do it in a separate thread. At this time adding a dialect is not a prerequisite for handling its quirks, as the active dialect currently can affect the tokenizer only, not the parser. Just make a note about the quirks you choose to implement (example). |
This patch provides an initial implemenation of LISTAGG[1]. Notably this implemenation deviates from ANSI SQL by allowing both WITHIN GROUP and the delimiter to be optional. We do so because Redshift SQL works this way and this approach is ultimately more flexible. Fixes apache#169. [1] https://modern-sql.com/feature/listagg
This patch provides an initial implemenation of LISTAGG[1]. Notably this implemenation deviates from ANSI SQL by allowing both WITHIN GROUP and the delimiter to be optional. We do so because Redshift SQL works this way and this approach is ultimately more flexible. Fixes apache#169. [1] https://modern-sql.com/feature/listagg
This patch provides an initial implemenation of LISTAGG[1]. Notably this implemenation deviates from ANSI SQL by allowing both WITHIN GROUP and the delimiter to be optional. We do so because Redshift SQL works this way and this approach is ultimately more flexible. Fixes apache#169. [1] https://modern-sql.com/feature/listagg
This patch provides an initial implemenation of LISTAGG[1]. Notably this implemenation deviates from ANSI SQL by allowing both WITHIN GROUP and the delimiter to be optional. We do so because Redshift SQL works this way and this approach is ultimately more flexible. Fixes apache#169. [1] https://modern-sql.com/feature/listagg
This patch provides an initial implemenation of LISTAGG[1]. Notably this implemenation deviates from ANSI SQL by allowing both WITHIN GROUP and the delimiter to be optional. We do so because Redshift SQL works this way and this approach is ultimately more flexible. Fixes apache#169. [1] https://modern-sql.com/feature/listagg
This patch provides an initial implemenation of LISTAGG[1]. Notably this implemenation deviates from ANSI SQL by allowing both WITHIN GROUP and the delimiter to be optional. We do so because Redshift SQL works this way and this approach is ultimately more flexible. Fixes apache#169. [1] https://modern-sql.com/feature/listagg
This patch provides an initial implemenation of LISTAGG[1]. Notably this implemenation deviates from ANSI SQL by allowing both WITHIN GROUP and the delimiter to be optional. We do so because Redshift SQL works this way and this approach is ultimately more flexible. Fixes #169. [1] https://modern-sql.com/feature/listagg
It seems the parser doesn't currently support listagg. For instance, the following Redshift example fails to parse:
The text was updated successfully, but these errors were encountered: