Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4033

ALTER TABLE ADD PARTITION treats string-partition key values as case insensitive.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.5.0, Impala 2.6.0, Impala 2.7.0
    • Fix Version/s: Impala 2.9.0
    • Component/s: Frontend
    • Labels:

      Description

      Partition-key values should be treated no different than regular data values, so string partition-key values should be case sensitive.

      However, in ALTER TABLE ADD PARTITION, Impala treats string partition-key values as case insensitive.

      Repro:

      create table t (c int) partitioned by (p string);
      alter table t add partition (p="abc");
      alter table t add partition (p="ABC");
      ERROR: AnalysisException: Partition spec already exists: (p='ABC').
      

      Creating the same partition via static or dynamic insert works finr:

      insert into t partition(p="ABC") values(1);
      insert into t partition(p) values(1, "aBc");
      show partitions t;
      +-------+-------+--------+------+--------------+-------------------+--------+-------------------+-----------------------------------------------+
      | p     | #Rows | #Files | Size | Bytes Cached | Cache Replication | Format | Incremental stats | Location                                      |
      +-------+-------+--------+------+--------------+-------------------+--------+-------------------+-----------------------------------------------+
      | ABC   | -1    | 1      | 2B   | NOT CACHED   | NOT CACHED        | TEXT   | false             | hdfs://localhost:20500/test-warehouse/t/p=ABC |
      | aBc   | -1    | 1      | 2B   | NOT CACHED   | NOT CACHED        | TEXT   | false             | hdfs://localhost:20500/test-warehouse/t/p=aBc |
      | abc   | -1    | 0      | 0B   | NOT CACHED   | NOT CACHED        | TEXT   | false             | hdfs://localhost:20500/test-warehouse/t/p=abc |
      | Total | -1    | 2      | 4B   | 0B           |                   |        |                   |                                               |
      +-------+-------+--------+------+--------------+-------------------+--------+-------------------+-----------------------------------------------+
      

        Attachments

          Activity

            People

            • Assignee:
              amosbird Amos Bird
              Reporter:
              alex.behm Alexander Behm
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: