Skip to content

Commit

Permalink
Avoids schema merging and partition discovery when data schema and pa…
Browse files Browse the repository at this point in the history
…rtition schema are defined
  • Loading branch information
liancheng committed Jun 2, 2015
1 parent 8fbd93f commit 088abaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private[sql] class ParquetRelation2(
}
}

override def dataSchema: StructType = metadataCache.dataSchema
override def dataSchema: StructType = maybeDataSchema.getOrElse(metadataCache.dataSchema)

override private[sql] def refresh(): Unit = {
super.refresh()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ abstract class HadoopFsRelation private[sql](maybePartitionSpec: Option[Partitio
*/
override lazy val schema: StructType = {
val dataSchemaColumnNames = dataSchema.map(_.name.toLowerCase).toSet
StructType(dataSchema ++ partitionSpec.partitionColumns.filterNot { column =>
StructType(dataSchema ++ partitionColumns.filterNot { column =>
dataSchemaColumnNames.contains(column.name.toLowerCase)
})
}
Expand Down

0 comments on commit 088abaa

Please sign in to comment.