[
https://issues.apache.org/jira/browse/SPARK-34833?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dongjoon Hyun updated SPARK-34833:
----------------------------------
Affects Version/s: 3.1.0
3.1.1
> Apply right-padding correctly for correlated subqueries
> -------------------------------------------------------
>
> Key: SPARK-34833
> URL: https://issues.apache.org/jira/browse/SPARK-34833
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.1.0, 3.2.0, 3.1.1
> Reporter: Takeshi Yamamuro
> Priority: Major
>
> This ticket aim at fixing the bug that does not apply right-padding for char
> types inside correlated subquries.
> For example, a query below returns nothing in master, but a correct result
> is `c`.
> {code}
> scala> sql(s"CREATE TABLE t1(v VARCHAR(3), c CHAR(5)) USING parquet")
> scala> sql(s"CREATE TABLE t2(v VARCHAR(5), c CHAR(7)) USING parquet")
> scala> sql("INSERT INTO t1 VALUES ('c', 'b')")
> scala> sql("INSERT INTO t2 VALUES ('a', 'b')")
> scala> val df = sql("""
> |SELECT v FROM t1
> |WHERE 'a' IN (SELECT v FROM t2 WHERE t2.c = t1.c )""".stripMargin)
> scala> df.show()
> +---+
> | v|
> +---+
> +---+
> {code}
> This is because `ApplyCharTypePadding` does not handle the case above to
> apply right-padding into `'abc'`.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]