Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-16609

col='__HIVE_DEFAULT_PARTITION__' condition in select statement may produce wrong result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • Metastore
    • None
    • Reviewed

    Description

      A variation of alter_partition_change_col.q produces wrong result:

      SET hive.exec.dynamic.partition.mode = nonstrict;
      create table alter_partition_change_col0 (c1 string, c2 string);
      load data local inpath 'dec.txt' overwrite into table alter_partition_change_col0;
      create table alter_partition_change_col1 (c1 string, c2 string) partitioned by (p1 string comment 'Column p1', p2 string comment 'Column p2');
      
      insert overwrite table alter_partition_change_col1 partition (p1, p2)
        select c1, c2, 'abc', '123' from alter_partition_change_col0
        union all
        select c1, c2, cast(null as string), '123' from alter_partition_change_col0;
      select * from alter_partition_change_col1 where p1='__HIVE_DEFAULT_PARTITION__' or lower(p1)='a';
      

      The "select" statement does not produce the rows containing "_HIVE_DEFAULT_PARTITION_".

      We need another condition containing a udf so the condition is not recognized by PartFilterExprUtil.makeExpressionTree in ObjectStore. Looks like HIVE-11208 breaks it.

      Attachments

        1. HIVE-16609.2.patch
          7 kB
          Daniel Dai
        2. HIVE-16609.1.patch
          7 kB
          Daniel Dai

        Activity

          People

            daijy Daniel Dai
            daijy Daniel Dai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: