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/07/17 03:05:32 UTC

[spark] branch master updated: [SPARK-44429][SQL][TESTS] Make `MsSqlServerIntegrationSuite` robust in ANSI mode

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3ef146cfca3 [SPARK-44429][SQL][TESTS] Make `MsSqlServerIntegrationSuite` robust in ANSI mode
3ef146cfca3 is described below

commit 3ef146cfca35d47350f26fc452839f4d2e806237
Author: Yuming Wang <yu...@ebay.com>
AuthorDate: Mon Jul 17 12:05:20 2023 +0900

    [SPARK-44429][SQL][TESTS] Make `MsSqlServerIntegrationSuite` robust in ANSI mode
    
    ### What changes were proposed in this pull request?
    
    This PR changes the filter condition from `col("c") === 0` to `!col("c")` in `MsSqlServerIntegrationSuite` to avoid `AnalysisException` when ANSI is enabled by default. The root cause is that `AnsiTypeCoercion` does not contain [`BooleanEquality`](https://github.com/apache/spark/blob/618b52097c07105d734aaf9b2a22b372920b3f31/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala#L842).
    
    ### Why are the changes needed?
    
    Make `MsSqlServerIntegrationSuite` robust in ANSI mode. This test has nothing to do with whether ANSI is enabled or not.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    N/A.
    
    Closes #42006 from wangyum/SPARK-44429.
    
    Authored-by: Yuming Wang <yu...@ebay.com>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 .../scala/org/apache/spark/sql/jdbc/MsSqlServerIntegrationSuite.scala   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MsSqlServerIntegrationSuite.scala b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MsSqlServerIntegrationSuite.scala
index a4e2dba5343..f2614f46bc3 100644
--- a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MsSqlServerIntegrationSuite.scala
+++ b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MsSqlServerIntegrationSuite.scala
@@ -372,7 +372,7 @@ class MsSqlServerIntegrationSuite extends DockerJDBCIntegrationSuite {
     val df = spark.read.jdbc(jdbcUrl, "bits", new Properties)
     val rows = df.collect()
     assert(rows.length == 1)
-    val filtered = df.where(col("c") === 0).collect()
+    val filtered = df.where(!col("c")).collect()
     assert(filtered.length == 0)
   }
 


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