You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/23 16:57:59 UTC

[GitHub] [spark] peter-toth commented on pull request #31940: [SPARK-34833][SQL] Apply right-padding correctly for correlated subqueries

peter-toth commented on pull request #31940:
URL: https://github.com/apache/spark/pull/31940#issuecomment-805067105


   The PR LGTM.
   
   But I have a quick question, a bit unrelated to this PR but related to fixed-length string columns. Is this expected that we have in Spark:
   ```
   sql(s"CREATE TABLE t(c3 CHAR(3), c5 CHAR(5)) USING parquet")
   sql("INSERT INTO t VALUES ('a', 'a')")
   sql("SELECT c3, c5, c3 = c5, upper(c3) = upper(c5) FROM t").show()
   ```
   ```
   +---+-----+---------+-----------------------+
   | c3|   c5|(c3 = c5)|(upper(c3) = upper(c5))|
   +---+-----+---------+-----------------------+
   |a  |a    |     true|                  false|
   +---+-----+---------+-----------------------+
   ```
   But in PostgreSQL `upper(c3) = upper(c5)` is true:
   ```
   petertoth=# SELECT c3, c5, c3 = c5, upper(c3) = upper(c5) FROM t;
    c3  |  c5   | ?column? | ?column?
   -----+-------+----------+----------
    a   | a     | t        | t
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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