Uh oh!
There was an error while loading. Please reload this page.
[SPARK-21652][SQL][FOLLOW-UP] Fix rule conflict caused by InferFiltersFromConstraints - #19149
[SPARK-21652][SQL][FOLLOW-UP] Fix rule conflict caused by InferFiltersFromConstraints #19149gatorsmile wants to merge 1 commit into
Conversation
SparkQA
commented
Sep 6, 2017
Test build #81469 has finished for PR 19149 at commit
|
SparkQA
commented
Sep 6, 2017
Test build #81470 has finished for PR 19149 at commit
|
0be3b67 to
6fc7140CompareSparkQA
commented
Sep 6, 2017
Test build #81475 has finished for PR 19149 at commit
|
SparkQA
commented
Sep 6, 2017
Test build #81476 has finished for PR 19149 at commit
|
SparkQA
commented
Sep 7, 2017
Test build #81483 has finished for PR 19149 at commit
|
SparkQA
commented
Sep 7, 2017
Test build #81495 has finished for PR 19149 at commit
|
gatorsmile
commented
Sep 7, 2017
retest this please |
SparkQA
commented
Sep 7, 2017
Test build #81502 has finished for PR 19149 at commit
|
Hi, @gatorsmile . |
dongjoon-hyun
commented
Sep 8, 2017
Except that, Isolation of |
yhuai
commented
Sep 29, 2017
Can we add a test? |
adrian-ionescu
commented
Sep 29, 2017
I think the idea is good, but maybe the fix can be refined by identifying which are the rules that conflict with |
adrian-ionescu
commented
Sep 30, 2017
At least part of the issue was solved by #19201. |
Actually, the root issue is not resolve by #19201. Will add a unit test case later. |
1a22533 to
9b6fe36CompareSparkQA
commented
Dec 17, 2017
Test build #85015 has finished for PR 19149 at commit
|
gatorsmile
commented
Dec 17, 2017
retest this please |
SparkQA
commented
Dec 17, 2017
Test build #85018 has finished for PR 19149 at commit
|
gatorsmile
commented
Dec 17, 2017
| PushDownPredicate, | ||
| LimitPushDown, | ||
| ColumnPruning, | ||
| InferFiltersFromConstraints, |
There was a problem hiding this comment.
we still have it in the big batch?
There was a problem hiding this comment.
Yeah, it is filtered out in the first and the third batch.
There was a problem hiding this comment.
just curious, why not remove it from the big batch?
gatorsmile
commented
Dec 19, 2017
retest this please |
SparkQA
commented
Dec 19, 2017
Test build #85095 has finished for PR 19149 at commit
|
gatorsmile
commented
Dec 19, 2017
retest this please |
1 similar comment
cloud-fan
commented
Dec 19, 2017
retest this please |
SparkQA
commented
Dec 19, 2017
Test build #85108 has finished for PR 19149 at commit
|
gatorsmile
commented
Dec 19, 2017
Thanks! Merged to master. |
## What changes were proposed in this pull request? Previously, PR apache#19201 fix the problem of non-converging constraints. After that PR apache#19149 improve the loop and constraints is inferred only once. So the problem of non-converging constraints is gone. However, the case below will fail. ``` spark.range(5).write.saveAsTable("t") val t = spark.read.table("t") val left = t.withColumn("xid", $"id" + lit(1)).as("x") val right = t.withColumnRenamed("id", "xid").as("y") val df = left.join(right, "xid").filter("id = 3").toDF() checkAnswer(df, Row(4, 3)) ``` Because `aliasMap` replace all the aliased child. See the test case in PR for details. This PR is to fix this bug by removing useless code for preventing non-converging constraints. It can be also fixed with apache#20270, but this is much simpler and clean up the code. ## How was this patch tested? Unit test Author: Wang Gengliang <ltnwgl@gmail.com> Closesapache#20278 from gengliangwang/FixConstraintSimple.
## What changes were proposed in this pull request? Previously, PR #19201 fix the problem of non-converging constraints. After that PR #19149 improve the loop and constraints is inferred only once. So the problem of non-converging constraints is gone. However, the case below will fail. ``` spark.range(5).write.saveAsTable("t") val t = spark.read.table("t") val left = t.withColumn("xid", $"id" + lit(1)).as("x") val right = t.withColumnRenamed("id", "xid").as("y") val df = left.join(right, "xid").filter("id = 3").toDF() checkAnswer(df, Row(4, 3)) ``` Because `aliasMap` replace all the aliased child. See the test case in PR for details. This PR is to fix this bug by removing useless code for preventing non-converging constraints. It can be also fixed with #20270, but this is much simpler and clean up the code. ## How was this patch tested? Unit test Author: Wang Gengliang <ltnwgl@gmail.com> Closes#20278 from gengliangwang/FixConstraintSimple. (cherry picked from commit 8598a98) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
The optimizer rule
InferFiltersFromConstraintscould trigger our batchOperator Optimizationsexceeds the max iteration limit (i.e., 100) so that the final plan might not be properly optimized. The ruleInferFiltersFromConstraintscould conflict with the other Filter/Join predicate reduction rules. Thus, we need to separateInferFiltersFromConstraintsfrom the other rules.This PR is to separate
InferFiltersFromConstraintsfrom the main batchOperator Optimizations.How was this patch tested?
The existing test cases.