[ 
https://issues.apache.org/jira/browse/SPARK-19809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16027476#comment-16027476
 ] 

Dongjoon Hyun edited comment on SPARK-19809 at 5/27/17 4:18 PM:
----------------------------------------------------------------

[~hyukjin.kwon]. I don't think so. Parquet file does not need 
`spark.sql.files.ignoreCorruptFiles` option.

{code}
scala> sql("create table empty_parquet(a int) stored as parquet location 
'/tmp/empty_parquet'").show
++
||
++
++

$ touch /tmp/empty_parquet/zero.parquet

scala> sql("select * from empty_parquet").show
+---+
|  a|
+---+
+---+
{code}

You can test this in Spark with SPARK-20728.

{code}
scala> sql("create table empty_orc2(a int) using orc location 
'/tmp/empty_orc'").show
++
||
++
++

scala> sql("select * from empty_orc2").show
+---+
|  a|
+---+
+---+
{code}

I think this is a part of SPARK-20901. And ORC community will handle this. What 
we need is just to use latest ORC. One thing I'm wondering is this is tracked 
in https://issues.apache.org/jira/browse/ORC-162 (Open).


was (Author: dongjoon):
[~hyukjin.kwon]. I don't think so. Parquet file does not need 
`spark.sql.files.ignoreCorruptFiles` option.

{code}
scala> sql("create table empty_parquet(a int) stored as parquet location 
'/tmp/empty_parquet'").show
++
||
++
++

$ touch /tmp/empty_parquet/zero.parquet

scala> sql("select * from empty_parquet").show
+---+
|  a|
+---+
+---+
{code}

Also latest ORC file does not, too. It's fixed in 
https://issues.apache.org/jira/browse/ORC-162 . You can test this in Spark with 
SPARK-20728.
{code}
scala> sql("create table empty_orc2(a int) using orc location 
'/tmp/empty_orc'").show
++
||
++
++

scala> sql("select * from empty_orc2").show
+---+
|  a|
+---+
+---+
{code}

I think this is a part of SPARK-20901. And ORC community already resolved this. 
What we need is just to use latest ORC.

> NullPointerException on empty ORC file
> --------------------------------------
>
>                 Key: SPARK-19809
>                 URL: https://issues.apache.org/jira/browse/SPARK-19809
>             Project: Spark
>          Issue Type: Bug
>          Components: Input/Output
>    Affects Versions: 1.6.3, 2.0.2, 2.1.1
>            Reporter: MichaƂ Dawid
>
> When reading from hive ORC table if there are some 0 byte files we get 
> NullPointerException:
> {code}java.lang.NullPointerException
>       at 
> org.apache.hadoop.hive.ql.io.orc.OrcInputFormat$BISplitStrategy.getSplits(OrcInputFormat.java:560)
>       at 
> org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.generateSplitsInfo(OrcInputFormat.java:1010)
>       at 
> org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.getSplits(OrcInputFormat.java:1048)
>       at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:199)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:242)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:240)
>       at scala.Option.getOrElse(Option.scala:120)
>       at org.apache.spark.rdd.RDD.partitions(RDD.scala:240)
>       at 
> org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:242)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:240)
>       at scala.Option.getOrElse(Option.scala:120)
>       at org.apache.spark.rdd.RDD.partitions(RDD.scala:240)
>       at 
> org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:242)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:240)
>       at scala.Option.getOrElse(Option.scala:120)
>       at org.apache.spark.rdd.RDD.partitions(RDD.scala:240)
>       at org.apache.spark.rdd.UnionRDD$$anonfun$1.apply(UnionRDD.scala:66)
>       at org.apache.spark.rdd.UnionRDD$$anonfun$1.apply(UnionRDD.scala:66)
>       at 
> scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
>       at 
> scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
>       at scala.collection.immutable.List.foreach(List.scala:318)
>       at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
>       at scala.collection.AbstractTraversable.map(Traversable.scala:105)
>       at org.apache.spark.rdd.UnionRDD.getPartitions(UnionRDD.scala:66)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:242)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:240)
>       at scala.Option.getOrElse(Option.scala:120)
>       at org.apache.spark.rdd.RDD.partitions(RDD.scala:240)
>       at 
> org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:242)
>       at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:240)
>       at scala.Option.getOrElse(Option.scala:120)
>       at org.apache.spark.rdd.RDD.partitions(RDD.scala:240)
>       at 
> org.apache.spark.sql.execution.SparkPlan.executeTake(SparkPlan.scala:190)
>       at 
> org.apache.spark.sql.execution.Limit.executeCollect(basicOperators.scala:165)
>       at 
> org.apache.spark.sql.execution.SparkPlan.executeCollectPublic(SparkPlan.scala:174)
>       at 
> org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$execute$1$1.apply(DataFrame.scala:1499)
>       at 
> org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$execute$1$1.apply(DataFrame.scala:1499)
>       at 
> org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:56)
>       at 
> org.apache.spark.sql.DataFrame.withNewExecutionId(DataFrame.scala:2086)
>       at 
> org.apache.spark.sql.DataFrame.org$apache$spark$sql$DataFrame$$execute$1(DataFrame.scala:1498)
>       at 
> org.apache.spark.sql.DataFrame.org$apache$spark$sql$DataFrame$$collect(DataFrame.scala:1505)
>       at 
> org.apache.spark.sql.DataFrame$$anonfun$head$1.apply(DataFrame.scala:1375)
>       at 
> org.apache.spark.sql.DataFrame$$anonfun$head$1.apply(DataFrame.scala:1374)
>       at org.apache.spark.sql.DataFrame.withCallback(DataFrame.scala:2099)
>       at org.apache.spark.sql.DataFrame.head(DataFrame.scala:1374)
>       at org.apache.spark.sql.DataFrame.take(DataFrame.scala:1456)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:497)
>       at 
> org.apache.zeppelin.spark.ZeppelinContext.showDF(ZeppelinContext.java:209)
>       at 
> org.apache.zeppelin.spark.SparkSqlInterpreter.interpret(SparkSqlInterpreter.java:129)
>       at 
> org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94)
>       at 
> org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:341)
>       at org.apache.zeppelin.scheduler.Job.run(Job.java:176)
>       at 
> org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>       at java.lang.Thread.run(Thread.java:745){code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to