Github user mgyucht commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21425#discussion_r191023831
  
    --- Diff: 
sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out
 ---
    @@ -0,0 +1,97 @@
    +-- Automatically generated by SQLQueryTestSuite
    +-- Number of queries: 7
    +
    +
    +-- !query 0
    +CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES
    +  (null, null),
    +  (null, 1.0),
    +  (2, 3.0),
    +  (4, 5.0)
    +  AS m(a, b)
    +-- !query 0 schema
    +struct<>
    +-- !query 0 output
    +
    +
    +
    +-- !query 1
    +-- Case 1 (not possible to write a literal with no rows, so we ignore it.)
    +  -- (subquery is empty -> row is returned)
    +
    +  -- Case 2
    +  -- (subquery contains a row with null in all columns -> row not returned)
    +SELECT *
    +FROM   m
    +WHERE  (a, b) NOT IN ((CAST (null AS INT), CAST (null AS DECIMAL(2, 1))))
    +-- !query 1 schema
    +struct<a:int,b:decimal(2,1)>
    +-- !query 1 output
    +2  3
    +4  5
    +NULL       1
    +
    +
    +-- !query 2
    +-- Case 3
    +  -- (probe-side columns are all null -> row not returned)
    +SELECT *
    +FROM   m
    +WHERE  a IS NULL AND b IS NULL -- Matches only (null, null)
    +       AND (a, b) NOT IN ((0, 1.0), (2, 3.0), (4, CAST(null AS DECIMAL(2, 
1))))
    +-- !query 2 schema
    +struct<a:int,b:decimal(2,1)>
    +-- !query 2 output
    +NULL       NULL
    --- End diff --
    
    Filed https://issues.apache.org/jira/browse/SPARK-24395 to fix this.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to