Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

sqoop-merge: class file not found

Highlighted

sqoop-merge: class file not found

Explorer

Hi,

I ran the following sqoop-codegen command followed by sqoop-merge command, but get

java.lang.ClassNotFoundException: Class /user/output/bin/customerInfo.class not found

Tried with /user/output/bin/customerInfo and get the same error. The .java, .class and .jar file are in LFS in dir /user/output/bin.

sqoop codegen --connect jdbc:mysql://sandbox.hortonworks.com:3306/test --username root --password askfor1 --table customerInfo --map-column-java mtts=String,startdte=String --null-string "" --null-non-string "" --driver com.mysql.jdbc.Driver --bindir /user/output/bin --outdir /user/output/bin

then ran the sqoop merge:

sqoop merge --class-name /user/output/bin/customerInfo.class --jar-file /user/output/bin/customerInfo.jar --new-data /user/output/part-m-00000 --onto /user/output/part-m-00001 --target-dir /user/output --merge-key Name

3299-kxx1d.png

Am I missing anything?

Thank you.

1 REPLY 1
Highlighted

Re: sqoop-merge: class file not found

Explorer

@Revathy Mourouguessane

Not sure if you already solved it, I was facing the same issue today and finally was able to resolve it.

You dont have to give .class extension in the argument, just give --class-name customerInfo

This is the command I ran and its working fine, merging data from two directories into a new hdfs directory, keeping newer directory data as priority:

sqoop merge --class-name customerInfo --jar-file customerInfo.jar --new-date /user/cloudera/new_dir/ --onto /user/cloudera/old_dir --merge-key id --target-dir /user/cloudera/new_emp_dir

I kept the .jar and .class files in the bin directory of sqoop where i run commands, if you have it in some other paths - give the complete path and make sure it has the appropriate access. Hope this helps.
I'd be interested and thrilled if we could help each other learn in future too!

Don't have an account?
Coming from Hortonworks? Activate your account here