Skip to content

Conversation

@liancheng
Copy link
Contributor

When pushing down a leaf predicate, ORC SearchArgument builder requires an extra "parent" predicate (any one among AND/OR/NOT) to wrap the leaf predicate. E.g., to push down a < 1, we must build AND(a < 1) instead. Fortunately, when actually constructing the SearchArgument, the builder will eliminate all those unnecessary wrappers.

This PR is based on #8783 authored by @zhzhan. I also took the chance to simply OrcFilters a little bit to improve readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The in(attribute, _) part is wrong, because in accepts varargs instead of a list.

@SparkQA
Copy link

SparkQA commented Sep 17, 2015

Test build #42613 has finished for PR 8799 at commit 5febd85.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Sep 18, 2015

Test build #42625 has finished for PR 8799 at commit c3f6692.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@zhzhan
Copy link
Contributor

zhzhan commented Sep 18, 2015

LGTM Thanks for fixing this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will this In get changed toInSet by the optimizer when all values are literals?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a sources.In rather than expressions.In, so it should be fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok.

@yhuai
Copy link
Contributor

yhuai commented Sep 18, 2015

two comments. Otherwise, looks good.

@SparkQA
Copy link

SparkQA commented Sep 18, 2015

Test build #42688 has finished for PR 8799 at commit a694ba2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this test check if the predicate is really pushded down? Or it just check answers?

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 just checks answers. It's annoying that I couldn't find a programmatical way to verify whether its pushed down or not. Checked through logs manually though.

@yhuai
Copy link
Contributor

yhuai commented Sep 19, 2015

ok. Merging to master and branch 1.5.

@asfgit asfgit closed this in 22be2ae Sep 19, 2015
asfgit pushed a commit that referenced this pull request Sep 19, 2015
When pushing down a leaf predicate, ORC `SearchArgument` builder requires an extra "parent" predicate (any one among `AND`/`OR`/`NOT`) to wrap the leaf predicate. E.g., to push down `a < 1`, we must build `AND(a < 1)` instead. Fortunately, when actually constructing the `SearchArgument`, the builder will eliminate all those unnecessary wrappers.

This PR is based on #8783 authored by zhzhan. I also took the chance to simply `OrcFilters` a little bit to improve readability.

Author: Cheng Lian <[email protected]>

Closes #8799 from liancheng/spark-10623/fix-orc-ppd.

(cherry picked from commit 22be2ae)
Signed-off-by: Yin Huai <[email protected]>

Conflicts:
	sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala
@liancheng liancheng deleted the spark-10623/fix-orc-ppd branch September 19, 2015 07:50
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.

4 participants