Issues with sqoop import

Hello All,
I created my own db in hive and imported all tables and there was no issue with it. But while importing data by joining using below command I am getting below error. But the table is created and data also there in hive.

16/11/30 15:42:32 WARN hive.TableDefWriter: Column order_date had to be cast to a less precise type in Hive
16/11/30 15:42:32 INFO hive.HiveImport: Loading uploaded data into Hive

Logging initialized using configuration in jar:file:/usr/hdp/!/
Time taken: 1.597 seconds
Loading data to table raghavendra_db.ord_join_items
Failed with exception User does not belong to hdfs
at org.apache.hadoop.hdfs.server.namenode.FSDirAttrOp.setOwner(
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.setOwner(
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.setOwner(
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setOwner(
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$
at org.apache.hadoop.ipc.RPC$
at org.apache.hadoop.ipc.Server$Handler$
at org.apache.hadoop.ipc.Server$Handler$
at Method)
at org.apache.hadoop.ipc.Server$

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask

and the 2nd question is select count(*) is working for other tables but not for newly created table.

[raghavendrakumars@gw01 ~]$ hive -e “use raghavendra_db;select count(*) from ord_join_items;”

Logging initialized using configuration in file:/etc/hive/
Time taken: 1.038 seconds
Time taken: 0.963 seconds, Fetched: 1 row(s)
[raghavendrakumars@gw01 ~]$


Which environment you are running this job?

I am running in bigdata-labs

Can you paste the sqoop import command you are trying to run?

Please find the command below.

sqoop import
–connect “jdbc:mysql://”
–username retail_dba --password itversity
–query “select * from orders join order_items on orders.order_id = order_items.order_item_order_id where $CONDITIONS”
–target-dir /user/raghavendrakumars/sqoop_import
–hive-database raghavendra_db
–hive-table ord_join_items
–split-by order_id
–num-mappers 12

@RaghavendraKumars - Try with --target-dir=/apps/hive/warehouse/raghavendra_db.db/ord_join_items \

Target dir is to specify the path of HDFS I think. @itversity please correct me.

@gnanaprakasam It solved the error. And as well as select count(*) also working on that table. In this case --target-dir is to provide the path of HIVE not HDFS. @itversity please confirm.

@RaghavendraKumars… target-dir is used to provide the path where you want to import data. Path can be of both HDFS/Hive.