Skip to content

Commit

Permalink
Addresses PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Mar 26, 2016
1 parent a26973e commit 25d894f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ private[sql] class DefaultSource
// case, `OrcFileOperator.readSchema` returns `None`, and we can simply return an empty
// iterator.
val maybePhysicalSchema = OrcFileOperator.readSchema(Seq(file.filePath), Some(conf))

maybePhysicalSchema.fold(Iterator.empty: Iterator[InternalRow]) { physicalSchema =>
if (maybePhysicalSchema.isEmpty) {
Iterator.empty
} else {
val physicalSchema = maybePhysicalSchema.get
OrcRelation.setRequiredColumns(conf, physicalSchema, dataSchema)

val orcRecordReader = {
Expand Down

0 comments on commit 25d894f

Please sign in to comment.