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/09/11 03:02:46 UTC

[GitHub] [spark] maropu opened a new pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

maropu opened a new pull request #29721:
URL: https://github.com/apache/spark/pull/29721


   <!--
   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.
   -->
   This PR intends to set `CODEGEN_ONLY` at `CODEGEN_FACTORY_MODE` in test spark context so that tests can fail if errors happen when generating expr code.
   
   ### 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.
   -->
   I noticed that the code generation of `SafeProjection` failed in the existing test (https://issues.apache.org/jira/browse/SPARK-32828) but it passed because `FALLBACK` was set at `CODEGEN_FACTORY_MODE` (by default) in `SharedSparkSession`. To get aware of these failures quickly, I think its worth setting `CODEGEN_ONLY` at `CODEGEN_FACTORY_MODE`.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Existing tests.
   


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in test.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] cloud-fan commented on a change in pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] HyukjinKwon commented on a change in pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] HyukjinKwon commented on a change in pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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


   **[Test build #128571 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128571/testReport)** for PR 29721 at commit [`a0b69cf`](https://github.com/apache/spark/commit/a0b69cfed44501d4f72a405f5b8fac69a519f7cc).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] maropu closed pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] maropu closed pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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


   


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


   **[Test build #128555 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128555/testReport)** for PR 29721 at commit [`0484de4`](https://github.com/apache/spark/commit/0484de44d9d44ce41af3439469b59521693b44c2).


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


   Merged build finished. Test FAILed.


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] HyukjinKwon commented on a change in pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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


   Thanks! Merged to master.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] maropu commented on pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


   GA passed. cc: @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.

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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~

##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] HyukjinKwon commented on a change in pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Shall we add a JIRA prefix?




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


   **[Test build #128547 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128547/testReport)** for PR 29721 at commit [`8b9b5e4`](https://github.com/apache/spark/commit/8b9b5e429262167f3b384873b745b10a9ab72956).


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


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


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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


   **[Test build #128571 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128571/testReport)** for PR 29721 at commit [`a0b69cf`](https://github.com/apache/spark/commit/a0b69cfed44501d4f72a405f5b8fac69a519f7cc).


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


   **[Test build #128555 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128555/testReport)** for PR 29721 at commit [`0484de4`](https://github.com/apache/spark/commit/0484de44d9d44ce41af3439469b59521693b44c2).
    * This patch **fails due to an unknown error code, -9**.
    * 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] maropu commented on a change in pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       >  It's just used to trigger FailedCodegenProjection
   
   Yea, yes. This test just triggers the the codegen failure of `FailedCodegenProjection` in executor sides and it checks the failure correctly propagates to a driver side in `SharedSparkSession` by setting the config `CODEGEN_FACTORY_MODE`=`codegen_only` in `SparkConf`:
   https://github.com/apache/spark/pull/29721/files#diff-ef6933b96996929c402e3a36296b2590R71
   
   `CodeGeneratorWithInterpretedFallbackSuite` is placed in the catalyst package, so it is not related to adding the config in `SharedSparkSession`. But, if the existing tests in  `CodeGeneratorWithInterpretedFallbackSuite` look enough, I think it is okay to drop the added tests and just add the config `CODEGEN_FACTORY_MODE` in `SharedSparkSession`.




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in test.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in test.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in test.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in test.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in test.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in test.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in test.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] cloud-fan commented on a change in pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in 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] maropu closed pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


   **[Test build #128547 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128547/testReport)** for PR 29721 at commit [`8b9b5e4`](https://github.com/apache/spark/commit/8b9b5e429262167f3b384873b745b10a9ab72956).
    * This patch **fails due to an unknown error code, -9**.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback `


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       okay ~




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that if `eval` fails, the query fails. I think we should override `doCodeGen` and produce invalid code there?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Then shall we just add a test in `CodeGeneratorWithInterpretedFallbackSuite`,  to make sure that `FailedCodegenProjection` fails with default codegen mode?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       Yea I think it's OK to just change the config in 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] SparkQA commented on pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating projection code

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


   **[Test build #128571 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128571/testReport)** for PR 29721 at commit [`a0b69cf`](https://github.com/apache/spark/commit/a0b69cfed44501d4f72a405f5b8fac69a519f7cc).
    * 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 removed a comment on pull request #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       My point is that, the test here is not really an end-to-end test. It's just used to trigger `FailedCodegenProjection`




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


   Merged build finished. Test FAILed.


----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
##########
@@ -104,6 +104,16 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
                                 | LIMIT 20
                               """.stripMargin
 
+  test("should fail if errors happen when generating expr code") {

Review comment:
       Sure!




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2555,6 +2555,24 @@ class DataFrameSuite extends QueryTest
     val df = Seq(0.0 -> -0.0).toDF("pos", "neg")
     checkAnswer(df.select($"pos" > $"neg"), Row(false))
   }
+
+  test("SPARK-32851: should fail if errors happen when generating expr code") {
+    val errMsg = intercept[SparkException] {
+      withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
+        val df = spark.range(1)
+        df.select(Column(FailedCodegenExpr(df("id").expr)) :: Nil: _*).show()
+      }
+    }.getCause.getMessage
+    assert(errMsg.contains("failed to compile:"))
+  }
 }
 
 case class GroupByKey(a: Int, b: Int)
+
+case class FailedCodegenExpr(child: Expression) extends UnaryExpression with CodegenFallback {
+  private lazy val proj = FailedCodegenProjection.createObject(child :: Nil)
+  override def dataType: DataType = LongType
+  override def eval(input: InternalRow): Any = {
+    proj(input).getLong(0)

Review comment:
       This test proves that, if the codegen of `proj` fails, the query fails.  If `CODEGEN_FACTORY_MODE`=fallback, `proj` falls back into an interpreted one.




----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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






----------------------------------------------------------------
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 #29721: [SPARK-32851][SQL][TEST] Tests should fail if errors happen when generating expr code

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


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


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