You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/06/06 10:41:23 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #36774: [WIP][SPARK-39388][SQL] Reuse `orcScheam` when push down Orc predicates

LuciferYang commented on code in PR #36774:
URL: https://github.com/apache/spark/pull/36774#discussion_r890028863


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:
##########
@@ -153,10 +152,9 @@ class OrcFileFormat
       } else {
         // ORC predicate pushdown
         if (orcFilterPushDown && filters.nonEmpty) {
-          OrcUtils.readCatalystSchema(filePath, conf, ignoreCorruptFiles).foreach { fileSchema =>

Review Comment:
   `FileFormatException` will be thrown on line 146 because it also create a orc `reader`
   
   For example, run `Enabling/disabling ignoreCorruptFiles` of `OrcV1QuerySuite`, the log as folows:
   
   ```
   17:47:49.865 WARN org.apache.spark.sql.execution.datasources.FileScanRDD: Skipped the rest of the content in the corrupted file: path: file:///private/var/folders/0x/xj61_dbd0dldn793s6cyb7rr0000gp/T/spark-3da6c142-804c-4735-9323-9acbc032be2f/third/part-00001-73ff50ec-30b5-4c6f-a49c-3a0bed19960f-c000.json, range: 0-8, partition values: [empty row]
   org.apache.orc.FileFormatException: Malformed ORC file file:/private/var/folders/0x/xj61_dbd0dldn793s6cyb7rr0000gp/T/spark-3da6c142-804c-4735-9323-9acbc032be2f/third/part-00001-73ff50ec-30b5-4c6f-a49c-3a0bed19960f-c000.json. Invalid postscript.
   	at org.apache.orc.impl.ReaderImpl.ensureOrcFooter(ReaderImpl.java:463)
   	at org.apache.orc.impl.ReaderImpl.extractFileTail(ReaderImpl.java:799)
   	at org.apache.orc.impl.ReaderImpl.<init>(ReaderImpl.java:566)
   	at org.apache.orc.OrcFile.createReader(OrcFile.java:385)
   	at org.apache.spark.sql.execution.datasources.orc.OrcFileFormat.$anonfun$buildReaderWithPartitionValues$2(OrcFileFormat.scala:147)
   	at org.apache.spark.util.Utils$.tryWithResource(Utils.scala:2740)
   	at org.apache.spark.sql.execution.datasources.orc.OrcFileFormat.$anonfun$buildReaderWithPartitionValues$1(OrcFileFormat.scala:147)
   	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.org$apache$spark$sql$execution$datasources$FileScanRDD$$anon$$readCurrentFile(FileScanRDD.scala:211)
   	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1$$anon$2.getNext(FileScanRDD.scala:239)
   	at org.apache.spark.util.NextIterator.hasNext(NextIterator.scala:73)
   	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.hasNext(FileScanRDD.scala:118)
   	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.nextIterator(FileScanRDD.scala:276)
   	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.hasNext(FileScanRDD.scala:118)
   	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.nextIterator(FileScanRDD.scala:276)
   	at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.hasNext(FileScanRDD.scala:118)
   	at org.apache.spark.sql.execution.FileSourceScanExec$$anon$1.hasNext(DataSourceScanExec.scala:580)
   	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.columnartorow_nextBatch_0$(Unknown Source)
   	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.processNext(Unknown Source)
   	at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
   	at org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$1.hasNext(WholeStageCodegenExec.scala:760)
   	at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
   	at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
   	at org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1908)
   	at org.apache.spark.rdd.RDD.$anonfun$count$1(RDD.scala:1274)
   	at org.apache.spark.rdd.RDD.$anonfun$count$1$adapted(RDD.scala:1274)
   	at org.apache.spark.SparkContext.$anonfun$runJob$5(SparkContext.scala:2267)
   	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:92)
   	at org.apache.spark.scheduler.Task.run(Task.scala:139)
   	at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:548)
   	at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1481)
   	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:750)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org