1
votes

I have a partitioned_table in hive which partitioned by "year,month",so my hdfs list is

/user/hive/warehouse/demo.db/employee/year=2017/month=6

when I used "export" to export table and use "import" to create a new table ,the result is the year and month exchanged, the list is

/user/hive/warehouse/demo.db/new_employee/month=6/year=2017

my hive version is 1.2.2 and the query:

export table employee into /user/hadoop/data

import table new_employee from /user/hadoop/data

the partitions in hive have no different with the original table(which one I export). Even I add a new partition, the directory is not changed, it work as '/month=7/year=6'

so what's wrong happened?Thanks for help!

1
try show partitions tablename had you find any difference? - HbnKing
What query did you use for import statement? - Nishu Tayal
partitions have no changed - Helt

1 Answers

0
votes

Is there issue in the way you are looking at the data as long as you dont have that issue then it is not a problem.by the way this is right export command for exporting the partition table

export table employee partition (year="2017", month="6") to 'hdfs_exports_location/employee';
import from 'hdfs_exports_location/employee';

well if you have more partition on year and month ..like each year will have 12 month of data i think you may have to do for each month separate command ..i have not tried..just try it with the above command let us know how it is coming