-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23399][SQL] Register a task completion listener first for OrcColumnarBatchReader #20590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
198f186
3b8cb0a
d4cc32e
5a9fa0b
18c2485
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,6 +188,9 @@ class OrcFileFormat | |
| if (enableVectorizedReader) { | ||
| val batchReader = new OrcColumnarBatchReader( | ||
| enableOffHeapColumnVector && taskContext.isDefined, copyToSpark, capacity) | ||
| val iter = new RecordReaderIterator(batchReader) | ||
| Option(TaskContext.get()).foreach(_.addTaskCompletionListener(_ => iter.close())) | ||
|
|
||
| batchReader.initialize(fileSplit, taskAttemptContext) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the reported case, the ORC file is opened here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cloud-fan and @gatorsmile . Could you take a look this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dongjoon-hyun Thanks for this fix! My question is how do we know if
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I tried to verify it manually in local, seems |
||
| batchReader.initBatch( | ||
| reader.getSchema, | ||
|
|
@@ -196,8 +199,6 @@ class OrcFileFormat | |
| partitionSchema, | ||
| file.partitionValues) | ||
|
|
||
| val iter = new RecordReaderIterator(batchReader) | ||
| Option(TaskContext.get()).foreach(_.addTaskCompletionListener(_ => iter.close())) | ||
| iter.asInstanceOf[Iterator[InternalRow]] | ||
| } else { | ||
| val orcRecordReader = new OrcInputFormat[OrcStruct] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add comment why we put this registration here with
SPARK-23399. Since we would forget this investigation in the future :), this comment will help us and will remind to run the test case manually.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!