You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2023/03/02 04:47:42 UTC

[spark] branch branch-3.4 updated: [SPARK-41823][CONNECT][FOLLOW-UP][TESTS] Disable ANSI mode in ProtoToParsedPlanTestSuite

This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch branch-3.4
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.4 by this push:
     new 4fa4d2fd54c [SPARK-41823][CONNECT][FOLLOW-UP][TESTS] Disable ANSI mode in ProtoToParsedPlanTestSuite
4fa4d2fd54c is described below

commit 4fa4d2fd54cc3969c674a392dc3779170def71b6
Author: Hyukjin Kwon <gu...@apache.org>
AuthorDate: Thu Mar 2 13:47:13 2023 +0900

    [SPARK-41823][CONNECT][FOLLOW-UP][TESTS] Disable ANSI mode in ProtoToParsedPlanTestSuite
    
    ### What changes were proposed in this pull request?
    
    This PR proposes to disable ANSI mode in `ProtoToParsedPlanTestSuite`.
    
    ### Why are the changes needed?
    
    The plan suite is independent from ANSI mode as it does not check the result itself, and some tests fail when ANSI mode is on (https://github.com/apache/spark/actions/runs/4299081862/jobs/7493923661):
    
    ```
    [info] - function_to_date_with_format *** FAILED *** (12 milliseconds)
    [info]   Expected and actual plans do not match:
    [info]
    [info]   === Expected Plan ===
    [info]   Project [cast(gettimestamp(s#0, yyyy-MM-dd, TimestampType, Some(America/Los_Angeles), false) as date) AS to_date(s, yyyy-MM-dd)#0]
    [info]   +- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0]
    [info]
    [info]
    [info]   === Actual Plan ===
    [info]   Project [cast(gettimestamp(s#0, yyyy-MM-dd, TimestampType, Some(America/Los_Angeles), true) as date) AS to_date(s, yyyy-MM-dd)#0]
    [info]   +- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] (ProtoToParsedPlanTestSuite.scala:129)
    [info]   org.scalatest.exceptions.TestFailedException:
    [info]   at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:472)
    [info]   at org.scalatest.Assertions.newAssertionFailedException$(Assertions.scala:471)
    [info]   at org.scalatest.funsuite.AnyFunSuite.newAssertionFailedException(AnyFunSuite.scala:1564)
    [info]   at org.scalatest.Assertions.fail(Assertions.scala:933)
    [info]   at org.scalatest.Assertions.fail$(Assertions.scala:929)
    [info]   at org.scalatest.funsuite.AnyFunSuite.fail(AnyFunSuite.scala:1564)
    [info]   at org.apache.spark.sql.connect.ProtoToParsedPlanTestSuite.$anonfun$createTest$2(ProtoToParsedPlanTestSuite.scala:129)
    [info]   at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
    [info]   at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
    [info]   at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, test-only.
    
    ### How was this patch tested?
    
    Manually tested.
    
    Closes #40245 from HyukjinKwon/SPARK-41823.
    
    Authored-by: Hyukjin Kwon <gu...@apache.org>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
    (cherry picked from commit 41d3103f4d69a9ec25d9f78f3f94ff5f3b64ef78)
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 .../scala/org/apache/spark/sql/connect/ProtoToParsedPlanTestSuite.scala  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/connector/connect/server/src/test/scala/org/apache/spark/sql/connect/ProtoToParsedPlanTestSuite.scala b/connector/connect/server/src/test/scala/org/apache/spark/sql/connect/ProtoToParsedPlanTestSuite.scala
index 26599b30b99..f6e5442bd0c 100644
--- a/connector/connect/server/src/test/scala/org/apache/spark/sql/connect/ProtoToParsedPlanTestSuite.scala
+++ b/connector/connect/server/src/test/scala/org/apache/spark/sql/connect/ProtoToParsedPlanTestSuite.scala
@@ -65,6 +65,7 @@ class ProtoToParsedPlanTestSuite extends SparkFunSuite with SharedSparkSession {
       .set(
         Connect.CONNECT_EXTENSIONS_EXPRESSION_CLASSES.key,
         "org.apache.spark.sql.connect.plugin.ExampleExpressionPlugin")
+      .set(org.apache.spark.sql.internal.SQLConf.ANSI_ENABLED.key, false.toString)
   }
 
   protected val baseResourcePath: Path = {


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