Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-25132

Case-insensitive field resolution when reading from Parquet

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.3.1
    • Fix Version/s: 2.4.0
    • Component/s: SQL
    • Labels:

      Description

      Spark SQL returns NULL for a column whose Hive metastore schema and Parquet schema are in different letter cases, regardless of spark.sql.caseSensitive set to true or false.

      Here is a simple example to reproduce this issue:

      scala> spark.range(5).toDF.write.mode("overwrite").saveAsTable("t1")

      spark-sql> show create table t1;
      CREATE TABLE `t1` (`id` BIGINT)
      USING parquet
      OPTIONS (
      `serialization.format` '1'
      )

      spark-sql> CREATE TABLE `t2` (`ID` BIGINT)
      > USING parquet
      > LOCATION 'hdfs://localhost/user/hive/warehouse/t1';

      spark-sql> select * from t1;
      0
      1
      2
      3
      4

      spark-sql> select * from t2;
      NULL
      NULL
      NULL
      NULL
      NULL

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                seancxmao Chenxiao Mao
                Reporter:
                seancxmao Chenxiao Mao
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: