harshmotw-db commented on code in PR #48172:
URL: https://github.com/apache/spark/pull/48172#discussion_r1772084759
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala:
##########
@@ -628,18 +640,39 @@ case class FileSourceScanExec(
}
}
+ val topLevelVariantMetrics: VariantMetrics = new VariantMetrics()
+ val nestedVariantMetrics: VariantMetrics = new VariantMetrics()
+
lazy val inputRDD: RDD[InternalRow] = {
val options = relation.options +
(FileFormat.OPTION_RETURNING_BATCH -> supportsColumnar.toString)
- val readFile: (PartitionedFile) => Iterator[InternalRow] =
- relation.fileFormat.buildReaderWithPartitionValues(
- sparkSession = relation.sparkSession,
- dataSchema = relation.dataSchema,
- partitionSchema = relation.partitionSchema,
- requiredSchema = requiredSchema,
- filters = pushedDownFilters,
- options = options,
- hadoopConf =
relation.sparkSession.sessionState.newHadoopConfWithOptions(relation.options))
+ val readFile: (PartitionedFile) => Iterator[InternalRow] = {
+ val hadoopConf =
relation.sparkSession.sessionState.newHadoopConfWithOptions(relation.options)
+ relation.fileFormat match {
+ case f: JsonFileFormat =>
Review Comment:
I tried doing this initially but that required me to unnecessarily change
every definition of this method in child classes of `FileFormat` which would
make the PR bigger. I think there were also some issues after I overrode every
definition but I don't fully remember them.
Let me know if you think this suggestion is important. In my opinion, people
who wish to add metrics in the future can just follow my idiom.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]