i have a question on sqoop import utility. I understand we can run a "sqoop import" and get the data from an RDBMS (SQL Server in my case) and directly put it in a hive table (will be created dynamically).
My question is how to create partitions in this hive table if i have to, with the "sqoop import" utility (is it possible?).
After "sqoop import to Hive" is done, i always see a Hive table which is not partitioned. My requirement is to have a partitioned tables on columns x,y,z..
Thanks, Sid
you can import data directly to hive table and can create partition table and load it directly using sqoop. Please find below code:
As you can see that this sqoop import will create a partitioned table UDB.EMPLOYEE_PARTITION_TABLE in hive and create a partitioned column as EMPLOYEE_CITY.
this will create a managed table in hive with data in text format. below is the schema of hive table:
You need to make sure few things. your hive-partition-key column name should not be part of your database table when you are using hive-import. else you will get below error.
keep your partition column at the end of your select statement while specifying the query in sqoop import.
Let me know if this works for you.