Yana Kadiyska created SPARK-12369:
-------------------------------------

             Summary: ataFrameReader fails on globbing parquet paths
                 Key: SPARK-12369
                 URL: https://issues.apache.org/jira/browse/SPARK-12369
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.5.2
            Reporter: Yana Kadiyska


Start with a list of parquet paths where some or all do not exist:

{noformat}
val paths=List("/foo/month=05/*.parquet","/foo/month=06/*.parquet")

 sqlContext.read.parquet(paths:_*)
java.lang.NullPointerException
        at org.apache.hadoop.fs.Globber.glob(Globber.java:218)
        at org.apache.hadoop.fs.FileSystem.globStatus(FileSystem.java:1625)
        at 
org.apache.spark.deploy.SparkHadoopUtil.globPath(SparkHadoopUtil.scala:251)
        at 
org.apache.spark.deploy.SparkHadoopUtil.globPathIfNecessary(SparkHadoopUtil.scala:258)
        at 
org.apache.spark.sql.DataFrameReader$$anonfun$3.apply(DataFrameReader.scala:264)
        at 
org.apache.spark.sql.DataFrameReader$$anonfun$3.apply(DataFrameReader.scala:260)
        at 
scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at 
scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at 
scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
        at 
org.apache.spark.sql.DataFrameReader.parquet(DataFrameReader.scala:260)
{noformat}

It would be better to produce a dataframe from the paths that do exist and log 
a warning that a path was missing. Not sure for "all paths are missing case" -- 
could return an emptyDF with no schema or a nicer exception...But I would 
prefer not to have to pre-validate paths





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to