MaxGekk commented on a change in pull request #29145:
URL: https://github.com/apache/spark/pull/29145#discussion_r458108943
##########
File path:
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala
##########
@@ -128,31 +128,42 @@ private[sql] class AvroFileFormat extends FileFormat
reader.asInstanceOf[DataFileReader[_]].getMetaString,
SQLConf.get.getConf(SQLConf.LEGACY_AVRO_REBASE_MODE_IN_READ))
+ val avroFilters = if (SQLConf.get.avroFilterPushDown) {
+ new OrderedFilters(filters, requiredSchema)
+ } else {
+ new NoopFilters
+ }
+
val deserializer = new AvroDeserializer(
- userProvidedSchema.getOrElse(reader.getSchema), requiredSchema,
datetimeRebaseMode)
+ userProvidedSchema.getOrElse(reader.getSchema),
+ requiredSchema,
+ datetimeRebaseMode,
+ avroFilters)
new Iterator[InternalRow] {
private[this] var completed = false
+ private[this] var nextRow: Option[InternalRow] = None
override def hasNext: Boolean = {
- if (completed) {
- false
- } else {
+ do {
Review comment:
Extracted common code to `AvroUtils.RowReader`
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]