Sqoop export not working

0 votes

What is the mistake I am making?

using sqoop export :
sqoop export --connect jdbc:mysql://sqoopdb.edu.cloudlab.com/trading --username labuser --password edureka --table trade --input
-fields-terminated-by "," --export-dir /user/edureka_525450/FINAL_FROM_DF1.csv --num-mappers 1 --columns "SYMBOL, SERIES,OPEN,HIGH,LOW,CLOSE,LAST,PREVCLOSE,TOTTRDQ
TY,TOTTRDVAL,TIMESTAMP,TOTALTRADES,ISIN"

I created the table in Database trading and the table name trade using below syntax

create table trade (SYMBOL varchar(20),SERIES varchar(2),OPEN DECIMAL(10,2),HIGH DECIMAL(10,2),LOW DECIMAL(10,2),CLOSE DECIMAL(10,2),LAST DECIMAL(10,2),PREVCLOSE DECIMAL(10,2),TOTTRDQTY integer(15),TOTTRDVAL DECIMAL(15,2),TIMESTAMP varchar(10),TOTALTRADES integer(20),ISIN varchar(20))

exported the file in the below location
/ user/ edureka_525450/ FINAL_FROM_DF1.csv

Jul 16, 2019 in Big Data Hadoop by Esha
2,873 views

1 answer to this question.

0 votes

The issue that you might be getting is because of the headers that are present in your data file in the hdfs. When you are directly exporting the data to mysql, it is encountering an error because of the headers. Thus you have to remove the headers before loading the file to hdfs since hdfs is WORM that is Write Once Read Many times, so you will not be able to make changes in the hdfs. 

I have loaded another the same data without the headers in your hdfs in the same location with the name FINAL_FROM.csv and exported it to mysql. Please have a look below for the commands and the screenshots:

sqoop export --connect jdbc:mysql://sqoopdb.edu.cloudlab.com/trading --username labuser --P --table trade  --export-dir /user/edureka_525450/FINAL_FROM_DF1.csv -m 1

image

image

answered Jul 16, 2019 by Tina

Related Questions In Big Data Hadoop

0 votes
1 answer

Sqoop Job not working

I have made a little change to ...READ MORE

answered Jun 19, 2019 in Big Data Hadoop by Vishwa
934 views
+1 vote
1 answer

http://localhost:50070 not working in HADOOP

There are 2 case possible: 1. If you ...READ MORE

answered Apr 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
41,819 views
0 votes
1 answer

Hadoop demo Code not working

You can use this command: "hadoop fs ...READ MORE

answered Apr 21, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
857 views
0 votes
1 answer

Setting the Number of Map tasks and Reduce Tasks not Working

The command that you are running is ...READ MORE

answered May 4, 2018 in Big Data Hadoop by Ashish
• 2,650 points
1,482 views
+1 vote
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
• 11,380 points
11,028 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
• 11,380 points
2,536 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,832 views
–1 vote
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,350 points
4,612 views
0 votes
1 answer

Hadoop sqoop import not working. Error: ERROR manager.SqlManager: Error reading from database

In the command, try mentioning the driver ...READ MORE

answered Dec 5, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,149 views
0 votes
1 answer

Sqoop import not working

The error you are getting is because ...READ MORE

answered Dec 18, 2018 in Big Data Hadoop by Omkar
• 69,220 points
964 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP