Error while creating avrodatafile?

0 votes

I am trying to create a avrodatafile using the below command.

sqoop import \
--connect jdbc:mysql://localhost/test \
--username root \
--table dept \
--as-avrodatafile \
--target-dir /user/edureka/dept

I am getting the below error. can you please help to resolve this issue.

18/01/19 12:28:30 INFO mapreduce.Job: The url to track the job: http://localhost:8088/proxy/application_1542433891662_0009/
18/01/19 12:28:30 INFO mapreduce.Job: Running job: job_1542433891662_0009
18/01/19 12:28:36 INFO mapreduce.Job: Job job_1542433891662_0009 running in uber mode : false
18/01/19 12:28:36 INFO mapreduce.Job: map 0% reduce 0%
18/01/19 12:28:47 INFO mapreduce.Job: Task Id : attempt_1542433891662_0009_m_000000_0, Status : FAILED
Error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:721)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:339)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:129)
... 7 more
Caused by: java.lang.NoClassDefFoundError: org/apache/avro/mapred/AvroWrapper
at org.apache.sqoop.mapreduce.AvroImportMapper.(AvroImportMapper.java:51)
... 12 more
Caused by: java.lang.ClassNotFoundException: org.apache.avro.mapred.AvroWrapper
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Jan 22 in Big Data Hadoop by Yazim
25 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The error you are getting is AvroWrapper class not found. You have to download the Avro jar. You can get it from the URL below:

http://central.maven.org/maven2/org/apache/avro/avro-mapred/1.7.7/avro-mapred-1.7.7.jar

Now, place the above-downloaded jar into the Sqoop lib folder,

cp /home/user/Downloads/avro-mapred-1.7.7.jar /usr/lib/sqoop-1.4.4/lib/
answered Jan 22 by Omkar
• 66,910 points

Related Questions In Big Data Hadoop

+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

Getting error while building Hadoop core jar using ant.

I think you are missing libtool library. ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by coldcode
• 2,010 points
33 views
0 votes
1 answer

Error while copying the file from local to HDFS

Well, the reason you are getting such ...READ MORE

answered May 2, 2018 in Big Data Hadoop by Ashish
• 2,630 points
284 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 9,410 points
1,843 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 9,410 points
159 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
9,131 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,260 points
656 views
0 votes
1 answer

Error while creating Hive Database table

In your error, it says that the ...READ MORE

answered Jan 8 in Big Data Hadoop by Omkar
• 66,910 points
47 views
+4 votes
3 answers

Unable to find file error- while Streaming Hadoop

Is python installed running on the slaves that ...READ MORE

answered Oct 16, 2018 in Big Data Hadoop by Vinith
180 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.