-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
Conversation
Test build #24042 has finished for PR 3556 at commit
|
Can you please add a test to |
Test build #24071 has finished for PR 3556 at commit
|
Test build #24079 has finished for PR 3556 at commit
|
val (pruningPredicates, otherPredicates) = predicates.partition { | ||
_.references.subsetOf(partitionKeyIds) | ||
val (pruningPredicates, otherPredicates) = predicates.partition { x => | ||
x.references.baseSet != null && |
There was a problem hiding this comment.
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?
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! |
@marmbrus Thank you for your comments. I will do it right away. |
…ins an empty AttributeSet() references
…ins an empty AttributeSet() references
Test build #24581 has finished for PR 3556 at commit
|
…ins an empty AttributeSet() references
Test build #24582 has finished for PR 3556 at commit
|
@marmbrus Please review again. Thanks. |
Thanks! Merged to master. |
val (pruningPredicates, otherPredicates) = predicates.partition { | ||
_.references.subsetOf(partitionKeyIds) | ||
val (pruningPredicates, otherPredicates) = predicates.partition { predicate => | ||
!predicate.references.isEmpty && |
There was a problem hiding this comment.
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
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)).