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

HIVE-13582: Support for Quantified predicates for non-correlated queries #612

Closed
wants to merge 1 commit into from

Conversation

vineetgarg02
Copy link
Contributor

This adds the support for Quantified predicates (ANY/SOME, ALL) in WHERE and SELECT.
Note that <>ANY and =ALL is not yet supported.

#### A masked pattern was here ####
CBO PLAN:
HiveAggregate(group=[{}], agg#0=[count()])
HiveFilter(condition=[AND(OR(IS NULL($4), =($1, 0)), OR(IS NOT NULL($0), =($1, 0), IS NOT NULL($4)), OR(>=($2, $1), =($1, 0), IS NOT NULL($4), IS NULL($0)))])
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this condition not pushed to inner join below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm that's a good point and I am not sure why not. Is there a rule which does this? Or the join itself needs to be created with the condition?

Copy link
Contributor

Choose a reason for hiding this comment

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

HiveFilterJoinRule should be the rule responsible to push filters into join conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like HiveFilterJoinRule isn't able to push the filter on LEFT join (before join re-ordering FILTER is on top of LEFT JOIN instead of on INNER JOIN).
I can create a follow-up to further investigate this and may be fix/improve it if possible. Let me know what do you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it makes sense... This may be a problem with other queries too, since algorithm ends up reordering joins considering that one of them is a cartesian product (but it is not).

@vineetgarg02 vineetgarg02 force-pushed the HIVE-13582 branch 3 times, most recently from 3accd61 to f4fb5f2 Compare May 7, 2019 18:05
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.

2 participants