Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9774#discussion_r45235195
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/SqlNewHadoopRDD.scala ---
    @@ -150,9 +155,30 @@ private[spark] class SqlNewHadoopRDD[V: ClassTag](
               configurable.setConf(conf)
             case _ =>
           }
    -      private[this] var reader = format.createRecordReader(
    -        split.serializableHadoopSplit.value, hadoopAttemptContext)
    -      reader.initialize(split.serializableHadoopSplit.value, 
hadoopAttemptContext)
    +      private[this] var reader: RecordReader[Void, V] = null
    +
    +      /**
    +        * If the format is ParquetInputFormat, try to create the optimized 
RecordReader. If this
    +        * fails (for example, unsupported schema), try with the normal 
reader.
    +        * TODO: plumb this through a different way?
    +        */
    +      if (enableUnsafeRowParquetReader &&
    +          format.getClass.getName == 
"org.apache.parquet.hadoop.ParquetInputFormat") {
    +        reader = Utils.classForName(
    +          
"org.apache.spark.sql.execution.datasources.parquet.UnsafeRowParquetRecordReader")
    --- End diff --
    
    Why are we using reflection to create an instance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to