File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
sql/hive/src/main/scala/org/apache/spark/sql/hive/orc Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .sql .hive .orc
1919
20- import java .io .FileNotFoundException
2120import java .net .URI
2221import java .util .Properties
2322
24- import scala .util .Try
25-
2623import org .apache .hadoop .conf .Configuration
2724import org .apache .hadoop .fs .{FileStatus , Path }
2825import org .apache .hadoop .hive .conf .HiveConf .ConfVars
@@ -57,12 +54,10 @@ class OrcFileFormat extends FileFormat with DataSourceRegister with Serializable
5754 sparkSession : SparkSession ,
5855 options : Map [String , String ],
5956 files : Seq [FileStatus ]): Option [StructType ] = {
60- // Safe to ignore FileNotFoundException in case no files are found.
61- val schema = Try (OrcFileOperator .readSchema(
62- files.map(_.getPath.toUri.toString),
63- Some (sparkSession.sessionState.newHadoopConf())))
64- .recover { case _ : FileNotFoundException => None }
65- schema.get
57+ OrcFileOperator .readSchema(
58+ files.map(_.getPath.toUri.toString),
59+ Some (sparkSession.sessionState.newHadoopConf())
60+ )
6661 }
6762
6863 override def prepareWrite (
You can’t perform that action at this time.
0 commit comments