Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-36352 Spark should check result plan's output schema name
  3. SPARK-36093

(RemoveRedundantAliases should keep output schema name) The result incorrect if the partition path case is inconsistent

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.0, 3.1.3, 3.0.4
    • SQL

    Description

      Please reproduce this issue using HDFS. Local HDFS can not reproduce this issue.

      sql("create table t1(cal_dt date) using parquet")
      sql("insert into t1 values (date'2021-06-27'),(date'2021-06-28'),(date'2021-06-29'),(date'2021-06-30')")
      sql("create view t1_v as select * from t1")
      sql("CREATE TABLE t2 USING PARQUET PARTITIONED BY (CAL_DT) AS SELECT 1 AS FLAG,CAL_DT FROM t1_v WHERE CAL_DT BETWEEN '2021-06-27' AND '2021-06-28'")
      sql("INSERT INTO t2 SELECT 2 AS FLAG,CAL_DT FROM t1_v WHERE CAL_DT BETWEEN '2021-06-29' AND '2021-06-30'")
      sql("SELECT * FROM t2 WHERE CAL_DT BETWEEN '2021-06-29' AND '2021-06-30'").show
      sql("SELECT * FROM t2 ").show
      
      // It should not empty.
      scala> sql("SELECT * FROM t2 WHERE CAL_DT BETWEEN '2021-06-29' AND '2021-06-30'").show
      +----+------+
      |FLAG|CAL_DT|
      +----+------+
      +----+------+
      
      
      scala> sql("SELECT * FROM t2 ").show
      +----+----------+
      |FLAG|    CAL_DT|
      +----+----------+
      |   1|2021-06-27|
      |   1|2021-06-28|
      +----+----------+
      
      scala> sql("SELECT 2 AS FLAG,CAL_DT FROM t1_v WHERE CAL_DT BETWEEN '2021-06-29' AND '2021-06-30'").show
      +----+----------+
      |FLAG|    CAL_DT|
      +----+----------+
      |   2|2021-06-29|
      |   2|2021-06-30|
      +----+----------+
      

      Attachments

        Activity

          People

            angerszhu angerszhu
            yumwang Yuming Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: