0

I am trying to copy data from MySQL to HIVE using SQOOP. However, I am getting below error even though I have set HIVE_CONF_DIR variable in bashrc file. Below is my code:

sqoop import --connect jdbc:mysql://localhost/sampleOne \
--username root \
-P \
--table SAMPLEDATA  \
--target-dir /WithFieldss_T11  \
--hive-import \
--hive-table sampleone.customers  

variable in bashrc file:

export HIVE_CONF_DIR=/usr/local/hive/conf  

Error:

ERROR hive.HiveConfig: Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly.
18/04/29 20:48:53 ERROR tool.ImportTool: Import failed: java.io.IOException: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf

What else I need to add/modify here ??

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
RushHour
  • 494
  • 6
  • 25

1 Answers1

2

add this in ~/.bashrc export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/lib/hive/lib/* and copy the respective hive-common jar like hive-common-3.1.1.jar for hive3.1 to "sqoop/lib" folder

user3123372
  • 704
  • 1
  • 10
  • 26