Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Shud partition order be same in create and insert?


Copy link to this message
-
Shud partition order be same in create and insert?
Hello,

When the order of partitioning columns is different in create table and insert, I am not able to query for any data. However if the order is the same its possible to see data.

Should partitioning order be maintained through all inserts? As you see below, kv2.txt is still on HDFS and 2 different partition orders are created. Running off hive trunk.

hive> CREATE TABLE invites (foo INT, bar STRING) PARTITIONED BY (ds STRING, country STRING);                          
hive> LOAD DATA LOCAL INPATH '/tmp/kv2.txt' OVERWRITE INTO TABLE invites PARTITION (country='india', ds='2008-08-15');
hive> select * from invites;
hive>

[thiruvel@hive]$ hadoop fs -lsr /user/hive/warehouse/invites
drwxr-xr-x   - thiruvel supergroup          0 2010-08-06 12:52 /user/hive/warehouse/invites/country=india
drwxr-xr-x   - thiruvel supergroup          0 2010-08-06 12:52 /user/hive/warehouse/invites/country=india/ds=2008-08-15
-rw-r--r--   1 thiruvel supergroup       5791 2010-08-06 12:52 /user/hive/warehouse/invites/country=india/ds=2008-08-15/kv2.txt
drwxr-xr-x   - thiruvel supergroup          0 2010-08-06 12:52 /user/hive/warehouse/invites/ds=2008-08-15
drwxr-xr-x   - thiruvel supergroup          0 2010-08-06 12:52 /user/hive/warehouse/invites/ds=2008-08-15/country=india
[thiruvel@ hive]$

Thanks,
Thiruvel
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB