You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:30:30 UTC
[GitHub] [spark] cloud-fan opened a new pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
cloud-fan opened a new pull request #32885:
URL: https://github.com/apache/spark/pull/32885
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error message, please read the guideline first:
https://spark.apache.org/error-message-guidelines.html
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
Currently, there are some expressions that overwrite `semanticEquals`, which makes it not symmetrical. Ideally, expressions should overwrite `canonicalized` instead of `semanticEquals`.
This PR marks `semanticEquals` as final, and implement `canonicalized` for the few expressions that overwrote `semanticEquals` before.
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
To avoid subtle bugs (I haven't found a real bug yet).
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
no
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->
a new test
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861315658
thanks for the review, merging to master!
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-859785610
BTW, could you make CI happy?
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-860753838
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44301/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861276633
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139789/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r651019687
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt", null) match {
+ Option(sqlContext).map { sc =>
Review comment:
This is a hidden bug. `SubqueryExpression` will be sent to the executor side and build `Projection`, and be put in `EquivalentExpressions`, which needs to call `canonicalized`.
This means, Spark may serialize and send `HashAggregateExec` to the executor side, where `sqlContext` should be null.
It's hidden for a long time because `ScalarSubquery` didn't implement `canonicalized`, so the bug is not triggered. However, it also means `semanticHash` is wrong.
I think it only affects common subquery elimination, and shouldn't be a serious bug.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-860752265
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139775/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan closed pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #32885:
URL: https://github.com/apache/spark/pull/32885
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] peter-toth commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
peter-toth commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r652028836
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt", null) match {
+ Option(sqlContext).map { sc =>
Review comment:
Ok, thanks. I will try to open a PR this week.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861149798
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44315/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861132129
**[Test build #139789 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139789/testReport)** for PR 32885 at commit [`5095fff`](https://github.com/apache/spark/commit/5095fffcd0cd76548eadef802cdb81261029ff12).
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] peter-toth commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
peter-toth commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r651638388
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt", null) match {
+ Option(sqlContext).map { sc =>
Review comment:
Sorry, for the late comment @cloud-fan. I think I've run into this issue before:
https://github.com/apache/spark/pull/28885/files#diff-9b62cef6bfdeb6c802bb120c7a724a974d5067a69585285bebb64c48603f8d6fR105-R108. The point is that there might be other nodes where canonicalization on executor side can cause issues. `SortExec.enableRadixSort` is the other one I found.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
viirya commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861276752
LGTM
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-860752265
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139775/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-859924503
**[Test build #139711 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139711/testReport)** for PR 32885 at commit [`73aa6f2`](https://github.com/apache/spark/commit/73aa6f23c1280b8b047d177ddbb6b41d3d6e02cc).
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861145546
Kubernetes integration test unable to build dist.
exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44315/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-859719503
cc @viirya @maropu
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] peter-toth commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
peter-toth commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r651679641
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt", null) match {
+ Option(sqlContext).map { sc =>
Review comment:
Sounds good to me.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r650141027
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala
##########
@@ -76,13 +76,6 @@ abstract class SubqueryExpression(
AttributeSet.fromAttributeSets(outerAttrs.map(_.references))
override def children: Seq[Expression] = outerAttrs ++ joinCond
override def withNewPlan(plan: LogicalPlan): SubqueryExpression
- override def semanticEquals(o: Expression): Boolean = o match {
Review comment:
all the subclasses of `SubqueryExpression` have implemented `canonicalized`.
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala
##########
@@ -278,11 +278,6 @@ case class AttributeReference(
case _ => false
}
- override def semanticEquals(other: Expression): Boolean = other match {
- case ar: AttributeReference => sameRef(ar)
- case _ => false
- }
-
Review comment:
The default implementation works for `AttributeReference`
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala
##########
@@ -127,11 +126,6 @@ case class InSubqueryExec(
override def withNewPlan(plan: BaseSubqueryExec): InSubqueryExec = copy(plan = plan)
final override def nodePatternsInternal: Seq[TreePattern] = Seq(IN_SUBQUERY_EXEC)
- override def semanticEquals(other: Expression): Boolean = other match {
- case in: InSubqueryExec => child.semanticEquals(in.child) && plan.sameResult(in.plan)
- case _ => false
- }
-
Review comment:
It's already there, in L164
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861256012
**[Test build #139789 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139789/testReport)** for PR 32885 at commit [`5095fff`](https://github.com/apache/spark/commit/5095fffcd0cd76548eadef802cdb81261029ff12).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-859924503
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r650152680
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala
##########
@@ -278,11 +278,6 @@ case class AttributeReference(
case _ => false
}
- override def semanticEquals(other: Expression): Boolean = other match {
- case ar: AttributeReference => sameRef(ar)
- case _ => false
- }
-
Review comment:
Don't need `canonicalized`?
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala
##########
@@ -127,11 +126,6 @@ case class InSubqueryExec(
override def withNewPlan(plan: BaseSubqueryExec): InSubqueryExec = copy(plan = plan)
final override def nodePatternsInternal: Seq[TreePattern] = Seq(IN_SUBQUERY_EXEC)
- override def semanticEquals(other: Expression): Boolean = other match {
- case in: InSubqueryExec => child.semanticEquals(in.child) && plan.sameResult(in.plan)
- case _ => false
- }
-
Review comment:
ditto
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861132129
**[Test build #139789 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139789/testReport)** for PR 32885 at commit [`5095fff`](https://github.com/apache/spark/commit/5095fffcd0cd76548eadef802cdb81261029ff12).
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r651020692
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt", null) match {
+ Option(sqlContext).map { sc =>
Review comment:
In the long term, I think we should only send an "expression evaluator" to the executor side. The semantic check should only be done in the driver side.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861276633
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139789/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r650208683
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
##########
@@ -238,7 +238,7 @@ abstract class Expression extends TreeNode[Expression] {
*
* See [[Canonicalize]] for more details.
*/
- def semanticEquals(other: Expression): Boolean =
+ final def semanticEquals(other: Expression): Boolean =
Review comment:
Yes, I agree with the idea.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r652023192
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt", null) match {
+ Option(sqlContext).map { sc =>
Review comment:
I'm quite busy this week and may not have time to implement this idea recently. @peter-toth feel free to pick up this idea and open a PR if you have time, or I'll do it next or next next week. Thanks in advance!
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-859927179
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-859927179
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] peter-toth commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
peter-toth commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r651638388
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt", null) match {
+ Option(sqlContext).map { sc =>
Review comment:
Sorry for the late comment @cloud-fan, but I think I've run into this issue before:
https://github.com/apache/spark/pull/28885/files#diff-9b62cef6bfdeb6c802bb120c7a724a974d5067a69585285bebb64c48603f8d6fR105-R108. The point is that there might be other nodes where canonicalization on executor side can cause issues. `SortExec.enableRadixSort` is the other one I found.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r651669404
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt", null) match {
+ Option(sqlContext).map { sc =>
Review comment:
`InSubqueryExec` already implements `canonicalized` before this PR, so we need to fix these bugs anyway.
I have an idea to fix this problem in all physical plans:
1. remove `SparkPlan.sqlContext`, so that we can catch all the callers of it
2. add `@transient final val session = SparkSession.getActiveSession.orNull`, to replace the previous `sqlContext`
3. override `conf` in `SparkPlan`: `if (session != null) session.sessionState.conf else SQLConf.get`
@peter-toth what do you think? AFAIK the only reason to access `SparkPlan.sqlContext` at executor side is to read a conf, and we can do that with `SQLConf.get` at executor side.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-860753838
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44301/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-861149798
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44315/
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #32885:
URL: https://github.com/apache/spark/pull/32885#issuecomment-860131816
Yeah, +1 if CI passes.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #32885: [SPARK-35742][SQL] Expression.semanticEquals should be symmetrical
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r651409123
##########
File path: sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt
##########
@@ -188,22 +188,6 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales]
InputAdapter
ReusedExchange [c_customer_sk,sum,isEmpty] #8
InputAdapter
- BroadcastExchange #19
- WholeStageCodegen (33)
- SortMergeJoin [c_customer_sk,c_customer_sk]
- InputAdapter
- WholeStageCodegen (29)
- Sort [c_customer_sk]
- InputAdapter
- ReusedExchange [c_customer_sk,c_first_name,c_last_name] #15
- InputAdapter
- WholeStageCodegen (32)
- Sort [c_customer_sk]
- Project [c_customer_sk]
- Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))]
- ReusedSubquery [tpcds_cmax] #3
- HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty]
- InputAdapter
- ReusedExchange [c_customer_sk,sum,isEmpty] #8
+ ReusedExchange [c_customer_sk,c_first_name,c_last_name] #19
Review comment:
After the fix, more exchange reuse happens :)
Seems the problem was caused by `ReusedSubquery`.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org