uros-b commented on code in PR #56591:
URL: https://github.com/apache/spark/pull/56591#discussion_r3444085099
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:
##########
@@ -104,11 +105,21 @@ case class OrcPartitionReaderFactory(
val taskConf = new Configuration(conf)
val fileSplit = new FileSplit(filePath, file.start, file.length,
Array.empty)
- val attemptId = new TaskAttemptID(new TaskID(new JobID(), TaskType.MAP,
0), 0)
- val taskAttemptContext = new TaskAttemptContextImpl(taskConf, attemptId)
- val orcRecordReader = new OrcInputFormat[OrcStruct]
- .createRecordReader(fileSplit, taskAttemptContext)
+ val orcRecordReader = {
+ val fs = filePath.getFileSystem(taskConf)
+ val orcReader = OrcFile.createReader(
+ filePath,
+ OrcFile.readerOptions(taskConf)
+ .maxLength(OrcConf.MAX_FILE_LENGTH.getLong(taskConf))
+ .filesystem(fs)
+ .orcTail(readerOptions.getOrcTail))
+ val options = org.apache.orc.mapred.OrcInputFormat
Review Comment:
Nit: Do we need the fully-qualified inline here? An aliased import would
probably read a bit better.
--
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]