You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2021/03/23 07:21:00 UTC

[jira] [Commented] (SPARK-34833) Apply right-padding correctly for correlated subqueries

    [ https://issues.apache.org/jira/browse/SPARK-34833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17306835#comment-17306835 ] 

Apache Spark commented on SPARK-34833:
--------------------------------------

User 'maropu' has created a pull request for this issue:
https://github.com/apache/spark/pull/31940

> 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.2.0
>            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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org