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

Insert into table with partition : overwriting the partition instead of appending records while running the hql script

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 0.8.1
    • None
    • CLI
    • None

    Description

      insert into table with partition works well with CLI. But overwriting the partition when executed through hql script.

      Table Schema
      (Table Name: jobs_status, partitioned on column job_name)
      completed_time string
      job_name string

      hive script (status.hql) contains the below commands
      use sample_db;
      insert into table job_status
      partition(job_name='testJob')
      select t.completionTime as completed_time from (select count(1) as cnt, from_unixtime(unix_timestamp()) as completionTime)t;

      The above commands when executed through CLI works well and append new records into the partition. But when executing the script as hive -f status.hql, it overwrites the existing records from the partition and insert only the new record.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sujesh.chirackkal Sujesh Chirackkal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: