You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "zhuml (Jira)" <ji...@apache.org> on 2022/07/27 02:27:00 UTC

[jira] [Created] (SPARK-39887) Expression transform error

zhuml created SPARK-39887:
-----------------------------

             Summary: Expression transform error
                 Key: SPARK-39887
                 URL: https://issues.apache.org/jira/browse/SPARK-39887
             Project: Spark
          Issue Type: Bug
          Components: Optimizer
    Affects Versions: 3.2.2, 3.3.0, 3.2.1
            Reporter: zhuml


{code:java}
spark.sql(
  """
    |select to_date(a) a, to_date(b) b from
    |(select  a, a as b from
    |(select to_date(a) a from
    | values ('2020-02-01') as t1(a)
    | group by to_date(a)) t3
    |union all
    |select a, b from
    |(select to_date(a) a, to_date(b) b from
    |values ('2020-01-01','2020-01-02') as t1(a, b)
    | group by to_date(a), to_date(b)) t4) t5
    |group by to_date(a), to_date(b)
    |""".stripMargin).show(){code}
result is (2020-02-01, 2020-02-01), (2020-01-01, 2020-01-01)
expected (2020-02-01, 2020-02-01), (2020-01-01, 2020-01-02)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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