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/03/28 20:11:30 UTC

[GitHub] [spark] tanelk opened a new pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

tanelk opened a new pull request #31983:
URL: https://github.com/apache/spark/pull/31983


   <!--
   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'.
   -->
   
   ### 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.
   -->
   Replaced the `agg(if (('gid = 1)) 'cat1 else null)` pattern in `RewriteDistinctAggregates` with `agg('cat1) FILTER (WHERE 'gid = 1)`
   
   ### 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.
   -->
   For aggregate functions, that do not ignore NULL values (`First`, `Last` or `UDAF`s) the current approach can return wrong results.
   
   The example query 
   ```
   SELECT
       first(DISTINCT a), last(DISTINCT a),
       first(a), last(a),
       first(DISTINCT b), last(DISTINCT b),
       first(b), last(b)
   FROM testData WHERE a IS NOT NULL AND b IS NOT NULL;
   ```
   returned 
   ```
   -- !query schema
   struct<first(DISTINCT a):int,last(DISTINCT a):int,first(a):int,last(a):int,first(DISTINCT b):int,last(DISTINCT b):int,first(b):int,last(b):int>
   -- !query output
   NULL	1	1	3	1	NULL	1	2
   ```
   before this PR. There should be no  NULL values, because those were filtered out.
   
   ### 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'.
   -->
   Bugfix
   
   ### 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.
   -->
   UT
   


-- 
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] maropu commented on pull request #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809918608


   branch-2.4/3.0/3.1 has the same issue?


-- 
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] maropu commented on a change in pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #31983:
URL: https://github.com/apache/spark/pull/31983#discussion_r604529387



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2834,6 +2835,29 @@ class DataFrameSuite extends QueryTest
       df10.select(zip_with(col("array1"), col("array2"), (b1, b2) => reverseThenConcat2(b1, b2)))
     checkAnswer(test10, Row(Array(Row("cbaihg"), Row("fedlkj"))) :: Nil)
   }
+
+  test("SPARK-34882: Aggregate with multiple distinct null sensitive aggregators") {
+    spark.udf.register("countNulls", udaf(new Aggregator[JLong, JLong, JLong] {

Review comment:
       nit: wrap `withUserDefinedFunction`?




-- 
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] maropu commented on pull request #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809970767


   Thanks for the check, @viirya . I changed `Affects Version/s:` in the jira.


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809606497


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41236/
   


-- 
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 a change in pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #31983:
URL: https://github.com/apache/spark/pull/31983#discussion_r603278300



##########
File path: sql/core/src/test/resources/sql-tests/inputs/group-by.sql
##########
@@ -179,3 +179,11 @@ SELECT count(*) FROM test_agg WHERE k = 1 or k = 2 or count(*) + 1L > 1L or max(
 
 -- Aggregate with multiple distinct decimal columns
 SELECT AVG(DISTINCT decimal_col), SUM(DISTINCT decimal_col) FROM VALUES (CAST(1 AS DECIMAL(9, 0))) t(decimal_col);
+
+-- SPARK-34882: Aggregate with multiple distinct null sensitive aggregators
+SELECT
+    first(DISTINCT a), last(DISTINCT a),
+    first(a), last(a),
+    first(DISTINCT b), last(DISTINCT b),
+    first(b), last(b)

Review comment:
       does it work if you specify order-by? first last are indeterministic so we should avoid relying on the order in any event




-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810314162


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41303/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810849943


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41331/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809080227


   **[Test build #136634 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136634/testReport)** for PR 31983 at commit [`c727a0c`](https://github.com/apache/spark/commit/c727a0c1a14afaec6190c2950de0059a1930d749).


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-808954952


   **[Test build #136618 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136618/testReport)** for PR 31983 at commit [`fb91ac0`](https://github.com/apache/spark/commit/fb91ac0dd35c2990ac02f19c75d5866d6e538444).


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-808960938


   Kubernetes integration test unable to build dist.
   
   exiting with code: 1
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41200/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809135646


   **[Test build #136634 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136634/testReport)** for PR 31983 at commit [`c727a0c`](https://github.com/apache/spark/commit/c727a0c1a14afaec6190c2950de0059a1930d749).
    * This patch **fails Spark unit 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] AmplabJenkins removed a comment on pull request #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810316188


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41303/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809191669


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41217/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809144454


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136634/
   


-- 
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] maropu commented on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-811513397


   Thanks, all! Merged 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] SparkQA commented on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809064604


   Kubernetes integration test unable to build dist.
   
   exiting with code: 1
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41209/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809080227


   **[Test build #136634 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136634/testReport)** for PR 31983 at commit [`c727a0c`](https://github.com/apache/spark/commit/c727a0c1a14afaec6190c2950de0059a1930d749).


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810527052


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136721/
   


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809615686


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41236/
   


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810307904


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41303/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810512486


   **[Test build #136721 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136721/testReport)** for PR 31983 at commit [`6b01428`](https://github.com/apache/spark/commit/6b01428ed74eb3406fe5df783d3511e5e6b9f719).
    * 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] AmplabJenkins removed a comment on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-808962576


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41200/
   


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810256867


   **[Test build #136721 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136721/testReport)** for PR 31983 at commit [`6b01428`](https://github.com/apache/spark/commit/6b01428ed74eb3406fe5df783d3511e5e6b9f719).


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809079490


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41209/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810849943


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41331/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810821233


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41331/
   


-- 
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] maropu commented on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-811132301


   Hm, in the other PRs (e.g., https://github.com/apache/spark/runs/2235050518?check_suite_focus=true), it seems the test can pass successfully (I've never seen that error before.). I'm not exactly sure now why it failed in this PR. Let me see the test result of the current running GA test job.


-- 
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] maropu commented on a change in pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #31983:
URL: https://github.com/apache/spark/pull/31983#discussion_r604527294



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2834,6 +2835,29 @@ class DataFrameSuite extends QueryTest
       df10.select(zip_with(col("array1"), col("array2"), (b1, b2) => reverseThenConcat2(b1, b2)))
     checkAnswer(test10, Row(Array(Row("cbaihg"), Row("fedlkj"))) :: Nil)
   }
+
+  test("SPARK-34882: Aggregate with multiple distinct null sensitive aggregators") {
+    spark.udf.register("countNulls", udaf(new Aggregator[JLong, JLong, JLong] {

Review comment:
       We need this udaf when adding this test in not `SQLQueryTestSuite` but `DataFrameSuite`?




-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809614005


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41236/
   


-- 
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] tanelk commented on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
tanelk commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809343926


   @cloud-fan, @maropu 
   
   Perhaps you have some idea.
   On jenkins and GA:
   `SQLQueryTestSuite.group-by.sql` gets `1	3	1	3	2	1	1	2`
   `ThriftServerQueryTestSuite.group-by.sql` gets `2	1	1	3	1	2	1	2`
   On my computer I get the `ThriftServerQueryTestSuite` results on both.
   
   
   


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809430362


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136654/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810256867


   **[Test build #136721 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136721/testReport)** for PR 31983 at commit [`6b01428`](https://github.com/apache/spark/commit/6b01428ed74eb3406fe5df783d3511e5e6b9f719).


-- 
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] tanelk commented on pull request #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
tanelk commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809972512


   Indeed. I'm also hesitant in applying this to 3.0 and 3.1, because it would introduce a performance regression. Codegen for the filter in agg is supported only since 3.2 - https://issues.apache.org/jira/browse/SPARK-30027


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810782549


   **[Test build #136749 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136749/testReport)** for PR 31983 at commit [`2530e89`](https://github.com/apache/spark/commit/2530e89304c874bee785eefcb8b8c09648046d17).


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810827186


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41331/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810527052


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136721/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-811035931


   ```
   [info] org.apache.spark.sql.TPCDSQueryTestSuite *** ABORTED *** (1 second, 282 milliseconds)
   [info]   java.net.BindException: Cannot assign requested address: Service 'sparkDriver' failed after 100 retries (on a random free port)! Consider explicitly setting the appropriate binding address for the service 'sparkDriver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding address.
   ```
   
   @maropu seems like a test issue?


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810980778


   **[Test build #136749 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136749/testReport)** for PR 31983 at commit [`2530e89`](https://github.com/apache/spark/commit/2530e89304c874bee785eefcb8b8c09648046d17).
    * 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] tanelk commented on a change in pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
tanelk commented on a change in pull request #31983:
URL: https://github.com/apache/spark/pull/31983#discussion_r603281097



##########
File path: sql/core/src/test/resources/sql-tests/inputs/group-by.sql
##########
@@ -179,3 +179,11 @@ SELECT count(*) FROM test_agg WHERE k = 1 or k = 2 or count(*) + 1L > 1L or max(
 
 -- Aggregate with multiple distinct decimal columns
 SELECT AVG(DISTINCT decimal_col), SUM(DISTINCT decimal_col) FROM VALUES (CAST(1 AS DECIMAL(9, 0))) t(decimal_col);
+
+-- SPARK-34882: Aggregate with multiple distinct null sensitive aggregators
+SELECT
+    first(DISTINCT a), last(DISTINCT a),
+    first(a), last(a),
+    first(DISTINCT b), last(DISTINCT b),
+    first(b), last(b)

Review comment:
       Doesn't order by sort the output rows? And here is only one. I'll still give it a try.




-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810316188


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41303/
   


-- 
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] maropu edited a comment on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu edited a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-811132301


   Hm, in the other PRs (e.g., https://github.com/apache/spark/runs/2235050518?check_suite_focus=true), it seems the test can pass successfully (I've never seen that error before.). I'm not exactly sure now why it failed in this PR. Let me see the test result of the current running GA test job.


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-808954952


   **[Test build #136618 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136618/testReport)** for PR 31983 at commit [`fb91ac0`](https://github.com/apache/spark/commit/fb91ac0dd35c2990ac02f19c75d5866d6e538444).


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809079490


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41209/
   


-- 
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] maropu commented on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-811512086


   okay, the latest TPCDS test in GA passed, so I think the last failure is not related to this PR (I'll keep watching the job for a while to check if it is stable or not), anyway.


-- 
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] maropu commented on a change in pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #31983:
URL: https://github.com/apache/spark/pull/31983#discussion_r604626741



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2834,6 +2835,29 @@ class DataFrameSuite extends QueryTest
       df10.select(zip_with(col("array1"), col("array2"), (b1, b2) => reverseThenConcat2(b1, b2)))
     checkAnswer(test10, Row(Array(Row("cbaihg"), Row("fedlkj"))) :: Nil)
   }
+
+  test("SPARK-34882: Aggregate with multiple distinct null sensitive aggregators") {
+    spark.udf.register("countNulls", udaf(new Aggregator[JLong, JLong, JLong] {

Review comment:
       Ah, okay. I misunderstood it.




-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809430362


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136654/
   


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809429671


   **[Test build #136654 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136654/testReport)** for PR 31983 at commit [`0d4ffa9`](https://github.com/apache/spark/commit/0d4ffa95b413b8fdd4a5b10ba4bf498218f06427).
    * This patch **fails Spark unit 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] AmplabJenkins commented on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810998372


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136749/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-808962576


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41200/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-808970591


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136618/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809191669


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41217/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809042768


   **[Test build #136626 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136626/testReport)** for PR 31983 at commit [`1b94589`](https://github.com/apache/spark/commit/1b94589fa35d39ccae7e5e16aee3fd7fe8cc81dd).


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809144454


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136634/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-808970531


   **[Test build #136618 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136618/testReport)** for PR 31983 at commit [`fb91ac0`](https://github.com/apache/spark/commit/fb91ac0dd35c2990ac02f19c75d5866d6e538444).
    * This patch **fails Spark unit 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] AmplabJenkins removed a comment on pull request #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809615686


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41236/
   


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809382428


   **[Test build #136654 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136654/testReport)** for PR 31983 at commit [`0d4ffa9`](https://github.com/apache/spark/commit/0d4ffa95b413b8fdd4a5b10ba4bf498218f06427).


-- 
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] tanelk commented on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
tanelk commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809167970


   Seems like `ThriftServerQueryTestSuite` and `SQLQueryTestSuite` are returning different results for the same query.


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810998372


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136749/
   


-- 
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] maropu closed pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu closed pull request #31983:
URL: https://github.com/apache/spark/pull/31983


   


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810279248


   This is very corner case and I think it's fine to fix in the master branch only.


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-810782549


   **[Test build #136749 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136749/testReport)** for PR 31983 at commit [`2530e89`](https://github.com/apache/spark/commit/2530e89304c874bee785eefcb8b8c09648046d17).


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-808970591


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136618/
   


-- 
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] tanelk commented on a change in pull request #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
tanelk commented on a change in pull request #31983:
URL: https://github.com/apache/spark/pull/31983#discussion_r603837975



##########
File path: sql/core/src/test/resources/sql-tests/inputs/group-by.sql
##########
@@ -179,3 +179,11 @@ SELECT count(*) FROM test_agg WHERE k = 1 or k = 2 or count(*) + 1L > 1L or max(
 
 -- Aggregate with multiple distinct decimal columns
 SELECT AVG(DISTINCT decimal_col), SUM(DISTINCT decimal_col) FROM VALUES (CAST(1 AS DECIMAL(9, 0))) t(decimal_col);
+
+-- SPARK-34882: Aggregate with multiple distinct null sensitive aggregators
+SELECT
+    first(DISTINCT a), last(DISTINCT a),
+    first(a), last(a),
+    first(DISTINCT b), last(DISTINCT b),
+    first(b), last(b)

Review comment:
       It did not help. I'll rewrite the test to use a `UDAF`.




-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809275383


   Kubernetes integration test unable to build dist.
   
   exiting with code: 141
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41217/
   


-- 
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] tanelk commented on a change in pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
tanelk commented on a change in pull request #31983:
URL: https://github.com/apache/spark/pull/31983#discussion_r604597457



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2834,6 +2835,29 @@ class DataFrameSuite extends QueryTest
       df10.select(zip_with(col("array1"), col("array2"), (b1, b2) => reverseThenConcat2(b1, b2)))
     checkAnswer(test10, Row(Array(Row("cbaihg"), Row("fedlkj"))) :: Nil)
   }
+
+  test("SPARK-34882: Aggregate with multiple distinct null sensitive aggregators") {
+    spark.udf.register("countNulls", udaf(new Aggregator[JLong, JLong, JLong] {

Review comment:
       I added the `withUserDefinedFunction`, but I did not understand the first question.
   I added this udaf, because the built in aggregates, that are "null sensitive" (`First` and `Last`) gave unstable test results in the `SQLQueryTestSuite`.




-- 
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] maropu commented on pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-811512617


   The last GA test failures are not related to this, so I'll merge this.


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809062638


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136626/
   


-- 
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 #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809062638


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136626/
   


-- 
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 #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809382428


   **[Test build #136654 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136654/testReport)** for PR 31983 at commit [`0d4ffa9`](https://github.com/apache/spark/commit/0d4ffa95b413b8fdd4a5b10ba4bf498218f06427).


-- 
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] maropu commented on pull request #31983: [WIP][SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #31983:
URL: https://github.com/apache/spark/pull/31983#issuecomment-809918862


   cc: @viirya 


-- 
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