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

Hive get wrong result when partition has the same path but different schema or authority

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.12.0
    • None
    • None

    Description

      Hive does not differentiate scheme and authority in file uris which cause wrong result when partition has the same path but different schema or authority. Here is a simple repro

      partition file path:
      asv://container1@secondary1.blob.core.windows.net/2013-08-05/00/text1.txt
      with content "2013-08-05 00:00:00"
      asv://container2@secondary1.blob.core.windows.net/2013-08-05/00/text2.txt
      with content "2013-08-05 00:00:20"

      CREATE EXTERNAL TABLE IF NOT EXISTS T1 (t STRING) PARTITIONED BY (ProcessDate STRING, Hour STRING, ClusterName STRING) ROW FORMAT DELIMITED FIELDS TERMINATED by '\t' STORED AS TEXTFILE;
      ALTER TABLE T1 DROP IF EXISTS PARTITION(processDate='2013-08-05', Hour='00', clusterName ='CLusterA');
      ALTER TABLE T1 ADD IF NOT EXISTS PARTITION(processDate='2013-08-05', Hour='00', clusterName ='ClusterA') LOCATION 'asv://container1@secondary1.blob.core.windows.net/2013-08-05/00';
      ALTER TABLE T1 DROP IF EXISTS PARTITION(processDate='2013-08-05', Hour='00', clusterName ='ClusterB');
      ALTER TABLE T1 ADD IF NOT EXISTS PARTITION(processDate='2013-08-05', Hour='00', clusterName ='ClusterB') LOCATION 'asv://container2@secondary1.blob.core.windows.net/2013-08-05/00';
      

      the expect output of the hive query

      SELECT ClusterName, t FROM T1 WHERE ProcessDate=’2013-08-05’ AND Hour=’00’;
      

      should be

      ClusterA        2013-08-05 00:00:00
      ClusterB        2013-08-05 00:00:20
      

      However it is

      ClusterA        2013-08-05 00:00:00
      ClusterA        2013-08-05 00:00:20
      

      Attachments

        1. HIVE-5023.2.patch
          6 kB
          Shuaishuai Nie
        2. HIVE-5023.1.patch
          6 kB
          Shuaishuai Nie

        Issue Links

          Activity

            People

              shuainie Shuaishuai Nie
              shuainie Shuaishuai Nie
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: