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 in Big Data Hadoop by Esha
19 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 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 in Big Data Hadoop by Vishwa
11 views
0 votes
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
• 10,490 points
4,678 views
0 votes
1 answer

Hadoop demo Code not working

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

answered Apr 20, 2018 in Big Data Hadoop by kurt_cobain
• 9,240 points
37 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 3, 2018 in Big Data Hadoop by Ashish
• 2,630 points
122 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
• 10,490 points
2,340 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
• 10,490 points
238 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
12,015 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,240 points
885 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
• 67,290 points
186 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
• 67,290 points
128 views