Github user liancheng commented on a diff in the pull request: https://github.com/apache/spark/pull/12319#discussion_r60365527 --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcRelation.scala --- @@ -160,19 +160,22 @@ private[sql] class DefaultSource val job = Job.getInstance(conf) FileInputFormat.setInputPaths(job, file.filePath) - val inputFormat = new OrcNewInputFormat val fileSplit = new FileSplit( new Path(new URI(file.filePath)), file.start, file.length, Array.empty ) - - val attemptId = new TaskAttemptID(new TaskID(new JobID(), TaskType.MAP, 0), 0) - val hadoopAttemptContext = new TaskAttemptContextImpl(conf, attemptId) - inputFormat.createRecordReader(fileSplit, hadoopAttemptContext) + // Create RecordReader here. This will help in getting + // ObjectInspector during recordReader creation itself and can + // avoid NN call in unwrapOrcStructs to get ObjectInspector for the + // file. Would be helpful for partitioned datasets. --- End diff -- It would be good to emphasize that this `OrcRecordReader` is a customized one. People who are not familiar with ORC may think it's the default ORC record reader.
--- 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