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

[SPARK-4693] [SQL] PruningPredicates may be wrong if predicates contains an empty AttributeSet() references #3556

Closed
wants to merge 14 commits into from

Conversation

YanTangZhai
Copy link
Contributor

The sql "select * from spark_test::for_test where abs(20141202) is not null" has predicates=List(IS NOT NULL HiveSimpleUdf#org.apache.hadoop.hive.ql.udf.UDFAbs(20141202)) and
partitionKeyIds=AttributeSet(). PruningPredicates is List(IS NOT NULL HiveSimpleUdf#org.apache.hadoop.hive.ql.udf.UDFAbs(20141202)). Then the exception "java.lang.IllegalArgumentException: requirement failed: Partition pruning predicates only supported for partitioned tables." is thrown.
The sql "select * from spark_test::for_test_partitioned_table where abs(20141202) is not null and type_id=11 and platform = 3" with partitioned key insert_date has predicates=List(IS NOT NULL HiveSimpleUdf#org.apache.hadoop.hive.ql.udf.UDFAbs(20141202), (type_id#12 = 11), (platform#8 = 3)) and partitionKeyIds=AttributeSet(insert_date#24). PruningPredicates is List(IS NOT NULL HiveSimpleUdf#org.apache.hadoop.hive.ql.udf.UDFAbs(20141202)).

@SparkQA
Copy link

SparkQA commented Dec 2, 2014

Test build #24042 has finished for PR 3556 at commit e572b9a.

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

@marmbrus
Copy link
Contributor

marmbrus commented Dec 2, 2014

Can you please add a test to HiveQuerySuite?

@SparkQA
Copy link

SparkQA commented Dec 3, 2014

Test build #24071 has finished for PR 3556 at commit 72accf1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 3, 2014

Test build #24079 has finished for PR 3556 at commit efa9b03.

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

val (pruningPredicates, otherPredicates) = predicates.partition {
_.references.subsetOf(partitionKeyIds)
val (pruningPredicates, otherPredicates) = predicates.partition { x =>
x.references.baseSet != null &&
Copy link
Contributor

Choose a reason for hiding this comment

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

When can it be null?

@marmbrus
Copy link
Contributor

ping, do you think you will have time to address the comments? Otherwise I might do it as this would be a good bug to fix. Thanks!

@YanTangZhai
Copy link
Contributor Author

@marmbrus Thank you for your comments. I will do it right away.

@SparkQA
Copy link

SparkQA commented Dec 18, 2014

Test build #24581 has finished for PR 3556 at commit 37cfdf5.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 18, 2014

Test build #24582 has finished for PR 3556 at commit 620ebe3.

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

@YanTangZhai
Copy link
Contributor Author

@marmbrus Please review again. Thanks.

@marmbrus
Copy link
Contributor

Thanks! Merged to master.

@asfgit asfgit closed this in e7de7e5 Dec 19, 2014
val (pruningPredicates, otherPredicates) = predicates.partition {
_.references.subsetOf(partitionKeyIds)
val (pruningPredicates, otherPredicates) = predicates.partition { predicate =>
!predicate.references.isEmpty &&
Copy link
Member

Choose a reason for hiding this comment

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

This line sounds useless in Spark 2.0

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