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 2022/05/06 10:24:48 UTC

[GitHub] [spark] ulysses-you opened a new pull request, #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

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

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### 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.
   -->
   - skip folding children inside `ConditionalExpression` if it's not foldable
   - mark `CaseWhen` and `If` as foldable if it's children are foldable
   
   ### 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 a conditional expression, we can not partially fold the constant inside it's children. For example if c1 or c2 is not null, the last branch should be never hit:
   ```sql
   SELECT COALESCE(c1, c2, 1/0);
   ```
   Besides, for CaseWhen and If, we should mark it as foldable if it's children are foldable. It is safe since the both non-codegen and codegen code path have already respected the evaluation order.
   
   ### 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, bug fix
   
   ### 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.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   add more test in sql file


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868756052


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,23 +53,46 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
-  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(AlwaysProcess.fn, ruleId) {
-    case q: LogicalPlan => q.transformExpressionsDownWithPruning(
-      AlwaysProcess.fn, ruleId) {
-      // Skip redundant folding of literals. This rule is technically not necessary. Placing this
-      // here avoids running the next rule for Literal values, which would create a new Literal
-      // object and running eval unnecessarily.
-      case l: Literal => l
-
-      case Size(c: CreateArray, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length)
-      case Size(c: CreateMap, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length / 2)
-
-      // Fold expressions that are foldable.
-      case e if e.foldable => Literal.create(e.eval(EmptyRow), e.dataType)
+  /**
+   * The method is used to fold the children expression inside a conditional expression which
+   * is not foldable. Some branches may not be evaluated at runtime, so here we should in case of
+   * the exception and leave it to runtime
+   */
+  private def conditionalExpressionFolding(child: Expression): Expression = {

Review Comment:
   sure, better to unify 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868772038


##########
sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql:
##########
@@ -1,6 +1,41 @@
 -- Tests for conditional functions
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1, 0),(2, 1) AS t(c1, c2);
+--SET spark.sql.maxMetadataStringLength = 500
+
+CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2);
 
 SELECT nanvl(c1, c1/c2 + c1/c2) FROM t;
+-- do not fail at compile side

Review Comment:
   Then we don't need to test EXPLAIN here and set `spark.sql.maxMetadataStringLength`



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868770083


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -43,6 +44,9 @@ import org.apache.spark.unsafe.types.UTF8String
  * equivalent [[Literal]] values.
  */
 object ConstantFolding extends Rule[LogicalPlan] {
+  // This tag is for avoid repeatedly evaluating expression inside conditional expression
+  // which has already failed to evaluate before.
+  private val FAILED_TO_EVALUATE = TreeNodeTag[Boolean]("FAILED_TO_EVALUATE")

Review Comment:
   ```suggestion
     private val FAILED_TO_EVALUATE = TreeNodeTag[Unit]("FAILED_TO_EVALUATE")
   ```
   
   We only need to check if the tag exists or not, no need to read its value.



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868772636


##########
sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql:
##########
@@ -1,6 +1,41 @@
 -- Tests for conditional functions
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1, 0),(2, 1) AS t(c1, c2);
+--SET spark.sql.maxMetadataStringLength = 500
+
+CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2);
 
 SELECT nanvl(c1, c1/c2 + c1/c2) FROM t;
+-- do not fail at compile side
+EXPLAIN SELECT nanvl(c1, c1/c2 + c1/c2) FROM t;
+
+SELECT nanvl(c2, c1/c2 + c1/c2) FROM t;
+SELECT nanvl(c1, 1/0) FROM t;
+SELECT nanvl(1-0, 1/0) FROM t;
+SELECT nanvl(1/0, 1/0) FROM t;

Review Comment:
   let's only test the cases that do not fail without constant folding, and fails with constant folding before this PR.
   
   For more detailed test, please put it in `ConstantFoldingSuite`



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868218630


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,23 +53,46 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
-  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(AlwaysProcess.fn, ruleId) {
-    case q: LogicalPlan => q.transformExpressionsDownWithPruning(
-      AlwaysProcess.fn, ruleId) {
-      // Skip redundant folding of literals. This rule is technically not necessary. Placing this
-      // here avoids running the next rule for Literal values, which would create a new Literal
-      // object and running eval unnecessarily.
-      case l: Literal => l
-
-      case Size(c: CreateArray, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length)
-      case Size(c: CreateMap, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length / 2)
-
-      // Fold expressions that are foldable.
-      case e if e.foldable => Literal.create(e.eval(EmptyRow), e.dataType)
+  /**
+   * The method is used to fold the children expression inside a conditional expression which
+   * is not foldable. Some branches may not be evaluated at runtime, so here we should in case of
+   * the exception and leave it to runtime
+   */
+  private def conditionalExpressionFolding(child: Expression): Expression = {

Review Comment:
   Actually, I think it's better to add a new flag `isConditionalBranch: Boolean` in `constantFolding`. We should have a unified constant folding so that we can fold part of the expression in the conditional branches as well, e.g. `if(cond, a + 2 * 3, b - 3 * 4)`, we should optimize it to `if(cond, a + 6, b - 12)`.



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868771621


##########
sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql:
##########
@@ -1,6 +1,41 @@
 -- Tests for conditional functions
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1, 0),(2, 1) AS t(c1, c2);
+--SET spark.sql.maxMetadataStringLength = 500
+
+CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2);
 
 SELECT nanvl(c1, c1/c2 + c1/c2) FROM t;
+-- do not fail at compile side

Review Comment:
   ```suggestion
   -- do not fail during query compilation
   ```



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868755471


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,23 +53,46 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
-  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(AlwaysProcess.fn, ruleId) {
-    case q: LogicalPlan => q.transformExpressionsDownWithPruning(
-      AlwaysProcess.fn, ruleId) {
-      // Skip redundant folding of literals. This rule is technically not necessary. Placing this
-      // here avoids running the next rule for Literal values, which would create a new Literal
-      // object and running eval unnecessarily.
-      case l: Literal => l
-
-      case Size(c: CreateArray, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length)
-      case Size(c: CreateMap, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length / 2)
-
-      // Fold expressions that are foldable.
-      case e if e.foldable => Literal.create(e.eval(EmptyRow), e.dataType)
+  /**
+   * The method is used to fold the children expression inside a conditional expression which
+   * is not foldable. Some branches may not be evaluated at runtime, so here we should in case of
+   * the exception and leave it to runtime
+   */
+  private def conditionalExpressionFolding(child: Expression): Expression = {
+    if (child.foldable) {
+      try {
+        Literal.create(child.eval(EmptyRow), child.dataType)

Review Comment:
   make sense, add a tag `FAILED_TO_EVALUATED`



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r869042405


##########
sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql:
##########
@@ -1,6 +1,41 @@
 -- Tests for conditional functions
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1, 0),(2, 1) AS t(c1, c2);
+--SET spark.sql.maxMetadataStringLength = 500
+
+CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2);
 
 SELECT nanvl(c1, c1/c2 + c1/c2) FROM t;
+-- do not fail at compile side

Review Comment:
   moved some tests to `ConstantFoldingSuite`



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r867323315


##########
sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-case.sql:
##########
@@ -67,14 +67,12 @@ SELECT '7' AS `None`,
   CASE WHEN rand() < udf(0) THEN 1
   END AS `NULL on no matches`;
 
--- [SPARK-33008] Spark SQL throws an exception
 -- Constant-expression folding shouldn't evaluate unreachable subexpressions
 SELECT CASE WHEN udf(1=0) THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
 SELECT CASE 1 WHEN 0 THEN 1/udf(0) WHEN 1 THEN 1 ELSE 2/0 END;
 
--- However we do not currently suppress folding of potentially
--- reachable subexpressions
-SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl;
+-- SPARK-39122: Python UDF does not follow the conditional expression evaluation order
+-- SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl;

Review Comment:
   We share the result between scala udf and python udf but after this pr they have different results. The scala udf follows the condition expression evluation order but python udf not. This is because we will pull out python udf and run them eagerly whatever can be reached or not.
   
   Ignore this and I create a ticket SPARK-39122 for the issue. cc @HyukjinKwon @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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868223880


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,23 +53,46 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
-  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(AlwaysProcess.fn, ruleId) {
-    case q: LogicalPlan => q.transformExpressionsDownWithPruning(
-      AlwaysProcess.fn, ruleId) {
-      // Skip redundant folding of literals. This rule is technically not necessary. Placing this
-      // here avoids running the next rule for Literal values, which would create a new Literal
-      // object and running eval unnecessarily.
-      case l: Literal => l
-
-      case Size(c: CreateArray, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length)
-      case Size(c: CreateMap, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length / 2)
-
-      // Fold expressions that are foldable.
-      case e if e.foldable => Literal.create(e.eval(EmptyRow), e.dataType)
+  /**
+   * The method is used to fold the children expression inside a conditional expression which
+   * is not foldable. Some branches may not be evaluated at runtime, so here we should in case of
+   * the exception and leave it to runtime
+   */
+  private def conditionalExpressionFolding(child: Expression): Expression = {

Review Comment:
   Ah you already did it, but it's better to unify it, e.g. you forget to avoid evaluating `Literal` here.



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868225414


##########
sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-case.sql:
##########
@@ -67,14 +67,12 @@ SELECT '7' AS `None`,
   CASE WHEN rand() < udf(0) THEN 1
   END AS `NULL on no matches`;
 
--- [SPARK-33008] Spark SQL throws an exception
 -- Constant-expression folding shouldn't evaluate unreachable subexpressions
 SELECT CASE WHEN udf(1=0) THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
 SELECT CASE 1 WHEN 0 THEN 1/udf(0) WHEN 1 THEN 1 ELSE 2/0 END;
 
--- However we do not currently suppress folding of potentially
--- reachable subexpressions
-SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl;
+-- SPARK-39122: Python UDF does not follow the conditional expression evaluation order
+-- SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl;

Review Comment:
   Unfortunately I think it's very hard to fix. We can probably have a "result holder" for python udf, and the "result holder" will only fail if it's actually accessed. +1 to ignore for now.



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

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

   thank you @cloud-fan @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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r866823202


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,22 +52,28 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
+  private def constantFolding(e: Expression): Expression = e match {
+    // do not partially fold children inside ConditionalExpression
+    case c: ConditionalExpression if !c.foldable => c

Review Comment:
   Yea, we should use try-catch and keep doing constant folding on conditional expressions as long as they don't error out.



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r866699096


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,22 +52,28 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
+  private def constantFolding(e: Expression): Expression = e match {
+    // do not partially fold children inside ConditionalExpression
+    case c: ConditionalExpression if !c.foldable => c

Review Comment:
   Ideally we can fold the `alwaysEvaluatedInputs` if it's foldable and replace them with literal, but we need add a new method like `withNewChidlren` in `ConditionalExpression`. It seems a little overkill. What do you think ? @cloud-fan @viirya @HyukjinKwon 



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868771361


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,22 +56,42 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
+  private def constantFolding(
+      e: Expression,
+      isConditionalBranch: Boolean = false): Expression = e match {
+    case c: ConditionalExpression if !c.foldable =>
+      c.mapChildren(constantFolding(_, isConditionalBranch = true))
+
+    // Skip redundant folding of literals. This rule is technically not necessary. Placing this
+    // here avoids running the next rule for Literal values, which would create a new Literal
+    // object and running eval unnecessarily.
+    case l: Literal => l
+
+    case Size(c: CreateArray, _) if c.children.forall(hasNoSideEffect) =>
+      Literal(c.children.length)
+    case Size(c: CreateMap, _) if c.children.forall(hasNoSideEffect) =>
+      Literal(c.children.length / 2)
+
+    case e if e.getTagValue(FAILED_TO_EVALUATE).getOrElse(false) => e
+
+    // Fold expressions that are foldable.
+    case e if e.foldable =>
+      try {
+        Literal.create(e.eval(EmptyRow), e.dataType)
+      } catch {
+        case NonFatal(_) if isConditionalBranch =>
+          // Fold the children expression inside a conditional expression which is not foldable.
+          // Some branches may not be evaluated at runtime, so here we should in case the exception
+          // and leave it to runtime.

Review Comment:
   ```
   When doing constant folding inside conditional expressions, we should not fail
   during expression evaluation, as the branch we are evaluating may not be reached at
   runtime, and we shouldn't fail the query, to match the original behavior.
   ```



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding
URL: https://github.com/apache/spark/pull/36468


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868755295


##########
sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql:
##########
@@ -1,6 +1,41 @@
 -- Tests for conditional functions
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1, 0),(2, 1) AS t(c1, c2);
+--SET spark.sql.maxMetadataStringLength = 500

Review Comment:
   Explain include the location metadata which is a long string. Default length will cause `location...` which failed to comprare plan.



##########
sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql:
##########
@@ -1,6 +1,41 @@
 -- Tests for conditional functions
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1, 0),(2, 1) AS t(c1, c2);
+--SET spark.sql.maxMetadataStringLength = 500

Review Comment:
   Explain include the location metadata which is a long string. Default length will cause `location...` which failed to compare plan.



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868755471


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,23 +53,46 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
-  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(AlwaysProcess.fn, ruleId) {
-    case q: LogicalPlan => q.transformExpressionsDownWithPruning(
-      AlwaysProcess.fn, ruleId) {
-      // Skip redundant folding of literals. This rule is technically not necessary. Placing this
-      // here avoids running the next rule for Literal values, which would create a new Literal
-      // object and running eval unnecessarily.
-      case l: Literal => l
-
-      case Size(c: CreateArray, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length)
-      case Size(c: CreateMap, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length / 2)
-
-      // Fold expressions that are foldable.
-      case e if e.foldable => Literal.create(e.eval(EmptyRow), e.dataType)
+  /**
+   * The method is used to fold the children expression inside a conditional expression which
+   * is not foldable. Some branches may not be evaluated at runtime, so here we should in case of
+   * the exception and leave it to runtime
+   */
+  private def conditionalExpressionFolding(child: Expression): Expression = {
+    if (child.foldable) {
+      try {
+        Literal.create(child.eval(EmptyRow), child.dataType)

Review Comment:
   make sense, add a tag `FAILED_TO_EVALUATE`



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

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

   thanks, merging to master/3.3!


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868204386


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,23 +53,46 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
-  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(AlwaysProcess.fn, ruleId) {
-    case q: LogicalPlan => q.transformExpressionsDownWithPruning(
-      AlwaysProcess.fn, ruleId) {
-      // Skip redundant folding of literals. This rule is technically not necessary. Placing this
-      // here avoids running the next rule for Literal values, which would create a new Literal
-      // object and running eval unnecessarily.
-      case l: Literal => l
-
-      case Size(c: CreateArray, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length)
-      case Size(c: CreateMap, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length / 2)
-
-      // Fold expressions that are foldable.
-      case e if e.foldable => Literal.create(e.eval(EmptyRow), e.dataType)
+  /**
+   * The method is used to fold the children expression inside a conditional expression which
+   * is not foldable. Some branches may not be evaluated at runtime, so here we should in case of
+   * the exception and leave it to runtime
+   */
+  private def conditionalExpressionFolding(child: Expression): Expression = {

Review Comment:
   nit: how about naming it `constantFoldingInConditionalBranches`



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on a diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
viirya commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r867290168


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala:
##########
@@ -48,6 +48,8 @@ case class If(predicate: Expression, trueValue: Expression, falseValue: Expressi
   override def second: Expression = trueValue
   override def third: Expression = falseValue
   override def nullable: Boolean = trueValue.nullable || falseValue.nullable
+  override def foldable: Boolean = children.forall(_.foldable)

Review Comment:
   I think this is applied for all `ConditionalExpression`s?



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r867302077


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala:
##########
@@ -48,6 +48,8 @@ case class If(predicate: Expression, trueValue: Expression, falseValue: Expressi
   override def second: Expression = trueValue
   override def third: Expression = falseValue
   override def nullable: Boolean = trueValue.nullable || falseValue.nullable
+  override def foldable: Boolean = children.forall(_.foldable)

Review Comment:
   +1, pull out to `ConditionalExpressions`



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r866809228


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,22 +52,28 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
+  private def constantFolding(e: Expression): Expression = e match {
+    // do not partially fold children inside ConditionalExpression
+    case c: ConditionalExpression if !c.foldable => c

Review Comment:
   Acutally it affects many code place if we do not partially foldable the children. One option is add a try catch to suppress the exception during compile so we can do partially foldable the children inside `ConditionalExpression`.



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868212836


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,23 +53,46 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
-  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(AlwaysProcess.fn, ruleId) {
-    case q: LogicalPlan => q.transformExpressionsDownWithPruning(
-      AlwaysProcess.fn, ruleId) {
-      // Skip redundant folding of literals. This rule is technically not necessary. Placing this
-      // here avoids running the next rule for Literal values, which would create a new Literal
-      // object and running eval unnecessarily.
-      case l: Literal => l
-
-      case Size(c: CreateArray, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length)
-      case Size(c: CreateMap, _) if c.children.forall(hasNoSideEffect) =>
-        Literal(c.children.length / 2)
-
-      // Fold expressions that are foldable.
-      case e if e.foldable => Literal.create(e.eval(EmptyRow), e.dataType)
+  /**
+   * The method is used to fold the children expression inside a conditional expression which
+   * is not foldable. Some branches may not be evaluated at runtime, so here we should in case of
+   * the exception and leave it to runtime
+   */
+  private def conditionalExpressionFolding(child: Expression): Expression = {
+    if (child.foldable) {
+      try {
+        Literal.create(child.eval(EmptyRow), child.dataType)

Review Comment:
   To avoid repeatedly evaluating it, how about we use a TreeNodeTag to remember already-evaluated-but-failed expressions?



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868219001


##########
sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql:
##########
@@ -1,6 +1,41 @@
 -- Tests for conditional functions
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1, 0),(2, 1) AS t(c1, c2);
+--SET spark.sql.maxMetadataStringLength = 500

Review Comment:
   what does this do?



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868225414


##########
sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-case.sql:
##########
@@ -67,14 +67,12 @@ SELECT '7' AS `None`,
   CASE WHEN rand() < udf(0) THEN 1
   END AS `NULL on no matches`;
 
--- [SPARK-33008] Spark SQL throws an exception
 -- Constant-expression folding shouldn't evaluate unreachable subexpressions
 SELECT CASE WHEN udf(1=0) THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
 SELECT CASE 1 WHEN 0 THEN 1/udf(0) WHEN 1 THEN 1 ELSE 2/0 END;
 
--- However we do not currently suppress folding of potentially
--- reachable subexpressions
-SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl;
+-- SPARK-39122: Python UDF does not follow the conditional expression evaluation order
+-- SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl;

Review Comment:
   Unfortunately I think it's very hard to fix. We can probably have a "result holder" for python udf, and the "result holder" will only fail if it's actually accessed.



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 diff in pull request #36468: [SPARK-39106][SQL] Correct conditional expression constant folding

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868771935


##########
sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql:
##########
@@ -1,6 +1,41 @@
 -- Tests for conditional functions
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1, 0),(2, 1) AS t(c1, c2);
+--SET spark.sql.maxMetadataStringLength = 500
+
+CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2);
 
 SELECT nanvl(c1, c1/c2 + c1/c2) FROM t;
+-- do not fail at compile side

Review Comment:
   For testing this kind of detail, I think a unit test is better. Can we add a few test cases in `ConstantFoldingSuite`?



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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