wangyum commented on a change in pull request #27518: [SPARK-30768][SQL]
Constraints should be inferred from inequality attributes
URL: https://github.com/apache/spark/pull/27518#discussion_r377057880
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/QueryPlanConstraints.scala
##########
@@ -67,6 +67,10 @@ trait ConstraintHelper {
val candidateConstraints = constraints - eq
Review comment:
I think the method documentation is correct. We support the following
pattern before this PR:
```sql
spark-sql> explain select t1.* from SPARK_30768_1 t1 join SPARK_30768_2 t2
on (t1.c1 = t2.c1) where t1.c1 > 3;
== Physical Plan ==
*(2) Project [c1#5, c2#6]
+- *(2) BroadcastHashJoin [c1#5], [c1#7], Inner, BuildRight
:- *(2) Project [c1#5, c2#6]
: +- *(2) Filter (isnotnull(c1#5) AND (c1#5 > 3))
: +- *(2) ColumnarToRow
: +- FileScan parquet default.spark_30768_1[c1#5,c2#6] Batched:
true, DataFilters: [isnotnull(c1#5), (c1#5 > 3)], Format: Parquet, Location:
InMemoryFileIndex[file:/Users/yumwang/spark-3.0.0-preview2-bin-hadoop2.7/spark-warehous...,
PartitionFilters: [], PushedFilters: [IsNotNull(c1), GreaterThan(c1,3)],
ReadSchema: struct<c1:int,c2:int>
+- BroadcastExchange HashedRelationBroadcastMode(List(cast(input[0, int,
true] as bigint))), [id=#233]
+- *(1) Project [c1#7]
+- *(1) Filter ((c1#7 > 3) AND isnotnull(c1#7))
+- *(1) ColumnarToRow
+- FileScan parquet default.spark_30768_2[c1#7] Batched:
true, DataFilters: [(c1#7 > 3), isnotnull(c1#7)], Format: Parquet, Location:
InMemoryFileIndex[file:/Users/yumwang/spark-3.0.0-preview2-bin-hadoop2.7/spark-warehous...,
PartitionFilters: [], PushedFilters: [GreaterThan(c1,3), IsNotNull(c1)],
ReadSchema: struct<c1:int>
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]