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 2020/12/10 08:14:47 UTC

[GitHub] [spark] ulysses-you opened a new pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

ulysses-you opened a new pull request #30703:
URL: https://github.com/apache/spark/pull/30703


   <!--
   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.
   -->
   The deterministic field is wider than `NonDerterministic`, we should keep same range between pull out and check analysis.
   
   ### 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 example
   ```
   select * from values(1), (4) as t(c1) order by java_method('java.lang.Math', 'abs', c1)
   ```
   
   We will get exception since `java_method` deterministic field is false but not a `NonDeterministic`
   ```
   Exception in thread "main" org.apache.spark.sql.AnalysisException: nondeterministic expressions are only allowed in
   Project, Filter, Aggregate or Window, found:
    java_method('java.lang.Math', 'abs', t.`c1`) ASC NULLS FIRST
   in operator Sort [java_method(java.lang.Math, abs, c1#1) ASC NULLS FIRST], true
                  ;;
   ```
   
   
   ### 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'.
   -->
   Yes.
   
   ### 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.
   -->
   Add 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] AmplabJenkins commented on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132607 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132607/testReport)** for PR 30703 at commit [`d1ebbab`](https://github.com/apache/spark/commit/d1ebbabd2d1479f19f8b9f8b8d6e18dfd3786a28).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30703:
URL: https://github.com/apache/spark/pull/30703#discussion_r540800267



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e
+          case udf: UserDefinedExpression if !udf.deterministic => udf

Review comment:
       ah, so we need to collect leaf non-deterministic nodes here. Shall we create a trait for them?




----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e

Review comment:
       This fix itself looks fine. Just my nit comment: naming `java_method('java.lang.Math', 'abs', c1)` "_nondeterministic " in a plan looks a bit weird.




----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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






----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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] ulysses-you commented on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #30703:
URL: https://github.com/apache/spark/pull/30703#issuecomment-744344965


   cc @cloud-fan @maropu  thanks for review !


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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] ulysses-you commented on a change in pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #30703:
URL: https://github.com/apache/spark/pull/30703#discussion_r540646718



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e

Review comment:
       Just for simple test, like the empty scala udf.




----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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] ulysses-you commented on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #30703:
URL: https://github.com/apache/spark/pull/30703#issuecomment-742901096


   retest this please


----------------------------------------------------------------
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] ulysses-you commented on a change in pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #30703:
URL: https://github.com/apache/spark/pull/30703#discussion_r540812280



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e
+          case udf: UserDefinedExpression if !udf.deterministic => udf

Review comment:
       I'd like to add a `LeafNondeterministic`, but seems there is not only leaf node, like `Rand(child)`.




----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132607 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132607/testReport)** for PR 30703 at commit [`d1ebbab`](https://github.com/apache/spark/commit/d1ebbabd2d1479f19f8b9f8b8d6e18dfd3786a28).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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






----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132557 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132557/testReport)** for PR 30703 at commit [`33eda3c`](https://github.com/apache/spark/commit/33eda3cb2575f1d11f013b87cd4196b7668db8ce).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132607 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132607/testReport)** for PR 30703 at commit [`d1ebbab`](https://github.com/apache/spark/commit/d1ebbabd2d1479f19f8b9f8b8d6e18dfd3786a28).
    * 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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132648 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132648/testReport)** for PR 30703 at commit [`9ec0654`](https://github.com/apache/spark/commit/9ec0654af4795d74dbd594cd02c921b727433abf).
    * 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 commented on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132566 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132566/testReport)** for PR 30703 at commit [`d1ebbab`](https://github.com/apache/spark/commit/d1ebbabd2d1479f19f8b9f8b8d6e18dfd3786a28).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132553 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132553/testReport)** for PR 30703 at commit [`33eda3c`](https://github.com/apache/spark/commit/33eda3cb2575f1d11f013b87cd4196b7668db8ce).


----------------------------------------------------------------
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] ulysses-you commented on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #30703:
URL: https://github.com/apache/spark/pull/30703#issuecomment-743002162


   cc @cloud-fan 


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132566 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132566/testReport)** for PR 30703 at commit [`d1ebbab`](https://github.com/apache/spark/commit/d1ebbabd2d1479f19f8b9f8b8d6e18dfd3786a28).
    * 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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132553 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132553/testReport)** for PR 30703 at commit [`33eda3c`](https://github.com/apache/spark/commit/33eda3cb2575f1d11f013b87cd4196b7668db8ce).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   @ulysses-you can you open backport PRs for 3.0/2.4? thanks!


----------------------------------------------------------------
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] ulysses-you commented on a change in pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #30703:
URL: https://github.com/apache/spark/pull/30703#discussion_r540847655



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e
+          case udf: UserDefinedExpression if !udf.deterministic => udf

Review comment:
       ok. try 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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132557 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132557/testReport)** for PR 30703 at commit [`33eda3c`](https://github.com/apache/spark/commit/33eda3cb2575f1d11f013b87cd4196b7668db8ce).
    * 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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 edited a comment on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
cloud-fan edited a comment on pull request #30703:
URL: https://github.com/apache/spark/pull/30703#issuecomment-744481443


   thanks, merging to master/3.1!


----------------------------------------------------------------
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] ulysses-you commented on a change in pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #30703:
URL: https://github.com/apache/spark/pull/30703#discussion_r540741674



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e
+          case udf: UserDefinedExpression if !udf.deterministic => udf

Review comment:
       First time, I tried this [33eda3c](https://github.com/apache/spark/pull/30703/commits/33eda3cb2575f1d11f013b87cd4196b7668db8ce), but the behavior is unexpected.
   
   Let's say we have a sql `select * from t order by rand()`, then it will pull out `SortOrder(rand())` into `Project`.
   




----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #30703:
URL: https://github.com/apache/spark/pull/30703


   


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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






----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132557 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132557/testReport)** for PR 30703 at commit [`33eda3c`](https://github.com/apache/spark/commit/33eda3cb2575f1d11f013b87cd4196b7668db8ce).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132566 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132566/testReport)** for PR 30703 at commit [`d1ebbab`](https://github.com/apache/spark/commit/d1ebbabd2d1479f19f8b9f8b8d6e18dfd3786a28).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132648 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132648/testReport)** for PR 30703 at commit [`9ec0654`](https://github.com/apache/spark/commit/9ec0654af4795d74dbd594cd02c921b727433abf).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30703:
URL: https://github.com/apache/spark/pull/30703#discussion_r540729020



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e
+          case udf: UserDefinedExpression if !udf.deterministic => udf

Review comment:
       shall we just write `case e if !e.deterministic => e`?




----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   late lgtm. thanks for fixing it, @ulysses-you 


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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






----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132648 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132648/testReport)** for PR 30703 at commit [`9ec0654`](https://github.com/apache/spark/commit/9ec0654af4795d74dbd594cd02c921b727433abf).


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e

Review comment:
       Ah, ok. I misunderstood it a bit. nvm.




----------------------------------------------------------------
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] ulysses-you commented on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #30703:
URL: https://github.com/apache/spark/pull/30703#issuecomment-744946762


   @cloud-fan will do 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] SparkQA commented on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   **[Test build #132553 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132553/testReport)** for PR 30703 at commit [`33eda3c`](https://github.com/apache/spark/commit/33eda3cb2575f1d11f013b87cd4196b7668db8ce).
    * 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] ulysses-you commented on pull request #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #30703:
URL: https://github.com/apache/spark/pull/30703#issuecomment-742400631


   retest this please


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


   thanks, merging to master/3.1/3.0!


----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30703:
URL: https://github.com/apache/spark/pull/30703#discussion_r540843065



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2963,7 +2963,11 @@ class Analyzer(override val catalogManager: CatalogManager)
 
     private def getNondeterToAttr(exprs: Seq[Expression]): Map[Expression, NamedExpression] = {
       exprs.filterNot(_.deterministic).flatMap { expr =>
-        val leafNondeterministic = expr.collect { case n: Nondeterministic => n }
+        val leafNondeterministic = expr.collect {
+          case n: Nondeterministic => n
+          case e: CallMethodViaReflection => e
+          case udf: UserDefinedExpression if !udf.deterministic => udf

Review comment:
       Can we make `CallMethodViaReflection` to extend `Nondeterministic`? I think `UserDefinedExpression` is the only exception that its deterministic is a flag.




----------------------------------------------------------------
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 #30703: [SPARK-33733][SQL] PullOutNondeterministic should check and collect deterministic field

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


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


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