Yibo Dong created SPARK-61970:
---------------------------------

             Summary: Nested CHAR table field misses a short string literal
                 Key: SPARK-61970
                 URL: https://issues.apache.org/jira/browse/SPARK-61970
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 5.0.0
         Environment: Spark 5.0.0-SNAPSHOT, upstream master at 
\{{dada2a6db5d73b152d6ba16e4fe21406f86abfe3}} (2026-11-15), local mode, default 
SQL settings
            Reporter: Yibo Dong


h2. What happened

A nested CHAR field fails to match a short string literal, although the 
equivalent top-level CHAR column matches it.
h2. How to reproduce

Run in a fresh Spark SQL session with a fresh warehouse. The last query is the 
top-level control.
{code:sql}
CREATE TABLE nested_char (id INT, s STRUCT<c: CHAR(3)>) USING PARQUET;
INSERT INTO nested_char VALUES (1, named_struct('c', 'A')), (2, 
named_struct('c', 'B'));

CREATE TABLE top_char (id INT, c CHAR(3)) USING PARQUET;
INSERT INTO top_char VALUES (1, 'A'), (2, 'B');

SELECT id FROM nested_char WHERE s.c = 'A' ORDER BY id;
SELECT id FROM top_char WHERE c = 'A' ORDER BY id;
{code}
h2. Expected result

The nested filter should return ID 1, just like the top-level control.
h2. Actual result

The nested filter returns no rows; the top-level control returns ID 1. 



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to