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

[CALCITE-3207] Fail to convert Join RelNode with like condition to sql statement #1328

Closed
wants to merge 1 commit into from

Conversation

wojustme
Copy link
Contributor

Calcite cannot convert rel node to sql statement, which case is the condition of join is 'like' expression.

Copy link
Contributor

@chunweilei chunweilei left a comment

Choose a reason for hiding this comment

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

Please change the commit message since 'fix' should better not appear.
How about "Fail to convert Join RelNode with like condition to sql statement"?

@danny0405
Copy link
Contributor

@wojustme Seems a little weird that why we should enumerate all these SqlKind here, which is error prone, can you please also check other operator (are there else operators missing)?

@wojustme
Copy link
Contributor Author

@chunweilei thx for your comment. I change commit message for describe the problem.

@wojustme
Copy link
Contributor Author

@danny0405 THX for your reminder, I will check other operator later.

@wojustme
Copy link
Contributor Author

wojustme commented Jul 27, 2019

Hi @danny0405
I rethink this problem. Should we handle the condition in join syntax according to operator, not according to sqlkind.
If this direction is correct, I could try to fix it.

@danny0405 danny0405 changed the title [CALCITE-3207] Fix rel node fail to convert sql statement [CALCITE-3207] Fail to convert Join RelNode with like condition to sql statement Jul 27, 2019
Copy link
Contributor

@danny0405 danny0405 left a comment

Choose a reason for hiding this comment

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

Thanks @wojustme , i recheck the code the it seems there is no common way to enumerate all these condition operators, per the like operator, it is a SqlSpecialOperator, so i think this fix is ok.

I'm + 1 for this

@danny0405 danny0405 added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Jul 27, 2019
@wojustme
Copy link
Contributor Author

@danny0405
Thank you for reviewing my code.
I think there is more common way to handle this case , when condition syntax is in the join expression, just like the handler of the filter expression.
If my thoughts is wrong, Please tell me to correct my mistake.

@danny0405
Copy link
Contributor

@danny0405
Thank you for reviewing my code.
I think there is more common way to handle this case , when condition syntax is in the join expression, just like the handler of the filter expression.
If my thoughts is wrong, Please tell me to correct my mistake.

I think the main reason that the SqlImplementor needs to handle the join condition separately is that the Join has 2 Context[1], and each binary operators needs to figure out which context their operands references belong to, so sync the logic with Filter seems not a good idea.
[1]

@danny0405 danny0405 closed this Jul 30, 2019
@danny0405 danny0405 reopened this Jul 30, 2019
@danny0405
Copy link
Contributor

Colse to retrigger tests.

@wojustme
Copy link
Contributor Author

@danny0405
Yeah, your view is right.
Thank you for your advice. I learned more from talking with you.

@wojustme
Copy link
Contributor Author

Hi @chunweilei
I have to change the commit, please to review my pr again.

@danny0405 danny0405 closed this in 3309396 Jul 30, 2019
KhawlaMhb pushed a commit to KhawlaMhb/calcite that referenced this pull request Aug 5, 2019
wangxlong pushed a commit to wangxlong/calcite that referenced this pull request Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM-will-merge-soon Overall PR looks OK. Only minor things left.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants