How to load data of csv file in MySQL Database Table

0 votes

Hi,
I need to load many records from .csv file to MySql database table. Could you please suggest how can I do that? Please share the code.

Jul 22, 2019 in Apache Spark by Shail
1,912 views

1 answer to this question.

0 votes

You can do it using a code similar to the one mentioned below:

LOAD DATA LOCAL INFILE 'path/to/file/and/filename' INTO TABLE <table name> FIELDS TERMINATED BY "," ENCLOSED BY "" LINES TERMINATED BY "\n" IGNORE 1 ROWS;
answered Jul 22, 2019 by Vishwa

Related Questions In Apache Spark

+1 vote
1 answer

How to read a data from text file in Spark?

Hey, You can try this: from pyspark import SparkContext SparkContext.stop(sc) sc ...READ MORE

answered Aug 6, 2019 in Apache Spark by Gitika
• 65,770 points
5,041 views
0 votes
1 answer
0 votes
1 answer

How to get the number of elements in partition?

rdd.mapPartitions(iter => Array(iter.size).iterator, true) This command will ...READ MORE

answered May 8, 2018 in Apache Spark by kurt_cobain
• 9,350 points
2,225 views
0 votes
1 answer
+1 vote
2 answers
+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,072 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,571 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
109,060 views
0 votes
1 answer

Load CSV file data inot MySQL

If you are trying to load file ...READ MORE

answered Jul 25, 2019 in Apache Spark by Sita
1,095 views
+1 vote
8 answers

How to print the contents of RDD in Apache Spark?

Save it to a text file: line.saveAsTextFile("alicia.txt") Print contains ...READ MORE

answered Dec 10, 2018 in Apache Spark by Akshay
61,862 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