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

LOAD DATA statement appends .0 to the partition name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 2.1.0
    • None
    • Metastore
    • None

    Description

      STEP 1. Create file with data:

      echo 1 > /tmp/data.file
      

      STEP 2. Create table in hive:

      CREATE TABLE `issue` (`id` INT) PARTITIONED BY (`ts` TIMESTAMP);
      

      STEP 3. Insert data into table:

      SET hive.exec.dynamic.partition.mode=nonstrict;
      INSERT INTO TABLE `issue` PARTITION (`ts`) VALUES (1,'1970-01-01 00:00:00'),(2,'1980-01-01 00:00:00'),(3,'1990-01-01 00:00:00');
      

      STEP 4. Load data into table using hive:

      LOAD DATA LOCAL INPATH '/tmp/data.file' OVERWRITE INTO TABLE `issue` PARTITION (`ts`='2000-01-01 00:00:00');
      

      STEP 5. Run show partitions query:

      SHOW PARTITIONS `issue`;
      

      EXPECTED RESULT:

      ts=1970-01-01 00%3A00%3A00
      ts=1980-01-01 00%3A00%3A00
      ts=1990-01-01 00%3A00%3A00
      ts=2000-01-01 00%3A00%3A00
      

      ACTUAL RESULT

      We've gotten partitions with different precision

      ts=1970-01-01 00%3A00%3A00
      ts=1980-01-01 00%3A00%3A00
      ts=1990-01-01 00%3A00%3A00
      ts=2000-01-01 00%3A00%3A00.0
      

      Attachments

        1. HIVE-14544.1.patch
          4 kB
          Oleksiy Sayankin

        Activity

          People

            osayankin Oleksiy Sayankin
            osayankin Oleksiy Sayankin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: