Skip to content
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

clickhouse: add support for parsing ARRAY JOIN #982

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lustefaniak
Copy link
Contributor

@lustefaniak lustefaniak commented Sep 24, 2023

Copy link
Collaborator

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution @lustefaniak -- I had a comment about this one

{
let expr = self.parse_expr()?;

let alias = self.parse_optional_table_alias(keywords::RESERVED_FOR_TABLE_ALIAS)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about ARRAY JOIN always being a "field accessor" -- would't it makes sense to parse the argument as TableFactor and that way it can support being a table / subquery / etc rather than just an expression? That would also handle aliases as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand what TableFactor is or its purpose in the lib 🤔 I will have to give it more read.
I checked Clickhouse's latest docs and there is more syntax I need to support e.g.

SELECT s, `nest.x`, `nest.y`
FROM nested_test
ARRAY JOIN `nest.x`, `nest.y`;

From what I could tell, this behaves much like UNNEST, and there are important limitations to what could be inside such ARRAY JOIN hence I'm not so sure if making it generic TableFactor actually makes sense 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think of TableFactor as basically anything that could be JOINEd (aka show up as a element in the FROM clause)

@alamb
Copy link
Collaborator

alamb commented Nov 22, 2023

This one appears to be stalled. Marking as Draft until we sort out what is needed

@alamb alamb marked this pull request as draft November 22, 2023 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants