Returning DataFrame for text file

2017-03-29 Thread George Obama
Hi,

I saw that the API, either R or Scala, we are returning DataFrame for 
sparkSession.read.text()

What’s the rational behind this? 

Regards,
George

Getting 2.0.2 for the link http://d3kbcqa49mib13.cloudfront.net/spark-2.1.0-bin-hadoop2.7.tgz

2017-03-17 Thread George Obama
Hello,

I download spark-2.1.0-bin-hadoop2.7.tgz from 
http://d3kbcqa49mib13.cloudfront.net/spark-2.1.0-bin-hadoop2.7.tgz 
 and get 
Spark 2.0.2: verified for the Scala, Python and R.

The link is from the download page http://spark.apache.org/downloads.html 
.


Is that only me or something we need to fix?

Regards,
Junfeng

CSV empty columns handling in Spark 2.0.2

2017-03-16 Thread George Obama
Hello,



I am using spark 2.0.2 to read the CSV file with empty columns and is hitting 
the issue:
scala>val df = sqlContext.read.option("header", true).option("inferSchema", 
true).csv("file location")
17/03/13 07:26:26 WARN DataSource: Error while looking for metadata directory.

scala> df.show()
17/03/13 07:26:41 ERROR Executor: Exception in task 0.0 in stage 3.0 (TID 4)
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.parseInt(Integer.java:615)
at 
scala.collection.immutable.StringLike$class.toInt(StringLike.scala:272)
at scala.collection.immutable.StringOps.toInt(StringOps.scala:29)
at 
org.apache.spark.sql.execution.datasources.csv.CSVTypeCast$.castTo(CSVInferSchema.scala:241)
at 
org.apache.spark.sql.execution.datasources.csv.CSVRelation$$anonfun$csvParser$3.apply(CSVRelation.scala:116)
at 
org.apache.spark.sql.execution.datasources.csv.CSVRelation$$anonfun$csvParser$3.apply(CSVRelation.scala:85)
at 
org.apache.spark.sql.execution.datasources.csv.CSVFileFormat$$anonfun$buildReader$1$$anonfun$apply$2.apply(CSVFileFormat.scala:128)
at 
org.apache.spark.sql.execution.datasources.csv.CSVFileFormat$$anonfun$buildReader$1$$anonfun$apply$2.apply(CSVFileFormat.scala:127)
at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:434)
at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:408)

Could you help me with this issue please? 


Besides, what does the warning mean?
17/03/13 07:26:26 WARN DataSource: Error while looking for metadata directory.
Regards,
John