2016-04-12 2 views

Répondre

1

Utilisez ce projet https://github.com/databricks/spark-csv

Il est un exemple de la première page:

import org.apache.spark.sql.SQLContext 

val sqlContext = new SQLContext(sc) 
val df = sqlContext.read 
    .format("com.databricks.spark.csv") 
    .option("header", "true") // Use first line of all files as header 
    .option("inferSchema", "true") // Automatically infer data types 
    .load("cars.csv")