gengliangwang commented on a change in pull request #27112: [SPARK-30428][SQL]
File source V2: support partition pruning
URL: https://github.com/apache/spark/pull/27112#discussion_r363967165
##########
File path:
external/avro/src/main/scala/org/apache/spark/sql/v2/avro/AvroScan.scala
##########
@@ -34,19 +35,30 @@ case class AvroScan(
dataSchema: StructType,
readDataSchema: StructType,
readPartitionSchema: StructType,
- options: CaseInsensitiveStringMap)
- extends FileScan(sparkSession, fileIndex, readDataSchema,
readPartitionSchema) {
- override def isSplitable(path: Path): Boolean = true
-
- override def createReaderFactory(): PartitionReaderFactory = {
- val caseSensitiveMap = options.asCaseSensitiveMap.asScala.toMap
- // Hadoop Configurations are case sensitive.
- val hadoopConf =
sparkSession.sessionState.newHadoopConfWithOptions(caseSensitiveMap)
- val broadcastedConf = sparkSession.sparkContext.broadcast(
- new SerializableConfiguration(hadoopConf))
- // The partition values are already truncated in `FileScan.partitions`.
- // We should use `readPartitionSchema` as the partition schema here.
- AvroPartitionReaderFactory(sparkSession.sessionState.conf,
broadcastedConf,
- dataSchema, readDataSchema, readPartitionSchema, caseSensitiveMap)
- }
+ options: CaseInsensitiveStringMap,
+ partitionFilters: Seq[Expression] = Seq.empty) extends FileScan {
+ override def isSplitable(path: Path): Boolean = true
Review comment:
I found the indent is wrong in `AvroScan`. Fix it as well.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]