You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Saravanan Rajendran <sa...@julysystems.com> on 2010/11/08 07:01:26 UTC

Dynamic partition is not working as expected.

Hi,
I am trying to test Dynamic-partition Insert. But this is not working as
expected. Kindly help how to solve this problem.

Created source table
------------------
CREATE EXTERNAL TABLE testmove (
    a  string,
    b string
  )
  PARTITIONED BY (cust string, dt string);
Data has been kept in /usr/hive/warehouse/testmove/cust=a/dt=20100102/a.txt
a.txt has 1 row the value is "a", "b"

Created Destination table
-----------------------
CREATE EXTERNAL TABLE testmove1 (
    a  string,
    b string
  )
  PARTITIONED BY (cust string, dt string)
Run the query for dynamic partion insert
---------------------------------------
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;

FROM testmove t
    INSERT OVERWRITE TABLE testmove1 PARTITION (cust, dt)
        SELECT t.a, t.b, 'a', '20100102';

output
-------
otal MapReduce jobs = 2
Launching Job 1 out of 2
Number of reduce tasks is set to 0 since there's no reduce operator
Execution log at:
/tmp/root/root_20101103170404_9e869676-7bb5-4655-b027-5bcb4b7fa2cb.log
Job running in-process (local Hadoop)
2010-11-03 17:04:06,818 null map = 100%,  reduce = 0%
Ended Job = job_local_0001
Ended Job = -645725555, job is filtered out (removed at runtime).
Moving data to:
file:/tmp/hive-root/hive_2010-11-03_17-03-59_979_5901061386316364507/-ext-10000
Loading data to table testmove1 partition (cust=null, dt=null)
[Warning] could not update stats.
OK


It is loading as Loading data to table testmove1 partition (cust=null,
dt=null). The data is moved as expected.


If i run as static partition is the data is inserted in to destination
table.

FROM testmove t
    INSERT OVERWRITE TABLE testmove1 PARTITION (cust='a', dt='20100102')
        SELECT t.a, t.b;