Skip to content

Commit

Permalink
Fix for Scala 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial committed Aug 13, 2021
1 parent e69db44 commit f930354
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -36,7 +36,7 @@ object Parquet extends LogSupport {
hadoopConf: Configuration = new Configuration(),
config: ParquetReader.Builder[A] => ParquetReader.Builder[A] = identity[ParquetReader.Builder[A]](_)
): ParquetReader[A] = {
val b = AirframeParquetReader.builder[A](path, hadoopConf)
val b: ParquetReader.Builder[A] = AirframeParquetReader.builder[A](path, hadoopConf)
config(b).build()
}

Expand All @@ -47,18 +47,18 @@ object Parquet extends LogSupport {
config: ParquetReader.Builder[A] => ParquetReader.Builder[A] = identity[ParquetReader.Builder[A]](_)
): ParquetReader[A] = {
// Read Parquet schema for resolving column types
val schema = readSchema(path)
val plan = ParquetQueryPlanner.parse(sql, schema)
val b = AirframeParquetReader.builder[A](path, conf = hadoopConf, plan = Some(plan))
val schema = readSchema(path)
val plan = ParquetQueryPlanner.parse(sql, schema)
val b: ParquetReader.Builder[A] = AirframeParquetReader.builder[A](path, conf = hadoopConf, plan = Some(plan))

val conf = plan.predicate match {
val newConf = plan.predicate match {
case Some(pred) =>
// Set Parquet filter
config(b).withFilter(FilterCompat.get(pred))
case _ =>
config(b)
}
conf.build()
newConf.build()
}

def readSchema(path: String, hadoopConf: Configuration = new Configuration()): MessageType = {
Expand Down

0 comments on commit f930354

Please sign in to comment.