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 in Apache Spark by Shail
48 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 by Vishwa

Related Questions In Apache Spark

0 votes
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 in Apache Spark by Gitika
• 25,420 points
585 views
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,280 points
273 views
0 votes
1 answer
0 votes
1 answer

How to get ID of a map task in Spark?

you can access task information using TaskContext: import org.apache.spark.TaskContext sc.parallelize(Seq[Int](), ...READ MORE

answered Nov 20, 2018 in Apache Spark by Frankie
• 9,810 points
553 views
+1 vote
1 answer
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,800 points
3,577 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,800 points
454 views
+1 vote
11 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
18,432 views
0 votes
1 answer

Load CSV file data inot MySQL

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

answered Jul 25 in Apache Spark by Sita
31 views
0 votes
7 answers

How to print the contents of RDD in Apache Spark?

Simple and easy: line.foreach(println) READ MORE

answered Dec 10, 2018 in Apache Spark by Kuber
14,336 views