You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "deniskuzZ (via GitHub)" <gi...@apache.org> on 2023/12/14 14:43:39 UTC
[PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
deniskuzZ opened a new pull request, #9301:
URL: https://github.com/apache/iceberg/pull/9301
…
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds `orcFileReader` to closeable, however, close() is called on `OrcRowIterator` and not `OrcIterable`, leaving the `orcFileReader` open.
In case of `ParquetIterator` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not the case for ORC `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426870221
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
In the `ParquetInterable` class we use the `CloseableGroup` `addCloseable` to make sure everything is closed
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds orcFileReader to closeable, but it never gets invoked (OrcIterable.close()). `MergeIterator` is operating on a` CloseableIterator` that might have filter and transformation and losses the closeable.
In case of `ParquetInterable` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not the case for `OrcIterable` that uses `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427131740
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
> Thanks for the explanation. So basically the `addCloseable(reader);` is not used here, neither in `ParquetIterable`, as the returned `CloseableIterator` `close` method is used clean up the resources. And in case of the Vectorized ORC reads, we return not the `OrcRowIterator` which closes the reader, but the `VectorizedRowBatchIterator` which closes the `RecordReader rows` which is generated like this: `orcFileReader.rows(options)`. And the `RecordReaderImpl` generated this way does not close the underlying `ReaderImpl`.
>
> Am I right here? Could we eventually fix this in ORC too? If so, it would be nice to have a ORC jira saying that this could be removed once it is fixed in ORC...
Yes, see [HIVE-25736](https://issues.apache.org/jira/browse/HIVE-25736) description :)
````
After [ORC-498](https://issues.apache.org/jira/browse/ORC-498) the Orc readers should be closed explicitly
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427582845
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
Any chance for a test?
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
Any chance for a test?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427023155
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
<img width="520" alt="Screenshot 2023-12-14 at 18 31 23" src="https://github.com/apache/iceberg/assets/2761528/9b699158-6cf7-4a48-b357-67eeecca3e58">
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds `orcFileReader` to closeable, however, close() is called on `OrcRowIterator` and not Iterable, leaving the `orcFileReader` open.
In case of `ParquetInterable` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not the case for `OrcIterable` that uses `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427000705
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
````
CloseableIterable<>hasNext() -> inner{FilterIterator}.hasNext() -> FilterIterator.close() -> OrcIterable.OrcRowIterator.close() -> VectorizedRowBatchIterator.close()
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427131740
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
> Thanks for the explanation. So basically the `addCloseable(reader);` is not used here, neither in `ParquetIterable`, as the returned `CloseableIterator` `close` method is used clean up the resources. And in case of the Vectorized ORC reads, we return not the `OrcRowIterator` which closes the reader, but the `VectorizedRowBatchIterator` which closes the `RecordReader rows` which is generated like this: `orcFileReader.rows(options)`. And the `RecordReaderImpl` generated this way does not close the underlying `ReaderImpl`.
>
> Am I right here? Could we eventually fix this in ORC too? If so, it would be nice to have a ORC jira saying that this could be removed once it is fixed in ORC...
Yes, see [HIVE-25736](https://issues.apache.org/jira/browse/HIVE-25736) :)
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1428070146
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
created test and then noticed that `file` is being closed in `rows.close()`
````
public void close() throws IOException {
...
dataReader.close();
}
````
RecordReaderUtils.DefaultDataReader
````
public void close() throws IOException {
...
if (pool != null) {
pool.clear();
}
// close both zcr and file
try (HadoopShims.ZeroCopyReaderShim myZcr = zcr) {
if (file != null) {
file.close();
file = null;
}
}
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427000705
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
````
CloseableIterable<>hasNext() -> inner{FilterIterator}.hasNext() -> FilterIterator.close() -> OrcIterable.OrcRowIterator.close() -> VectorizedRowBatchIterator.close()
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1428070146
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
created test and then noticed that 'file' is being closed in `rows.close()`
````
public void close() throws IOException {
...
dataReader.close();
}
````
RecordReaderUtils.DefaultDataReader
````
public void close() throws IOException {
...
if (pool != null) {
pool.clear();
}
// close both zcr and file
try (HadoopShims.ZeroCopyReaderShim myZcr = zcr) {
if (file != null) {
file.close();
file = null;
}
}
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds orcFileReader to closeable, but it never gets invoked. `MergeIterator` is operating on a` CloseableIterator` that might have filter and transformation and losses the closeable.
In case of `ParquetInterable` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not. the case for OrcIterable that uses `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
OrcIterable also extends CloseableGroup and adds orcFileReader to closeable, but it never gets invoked. MergeIterator is operating on a CloseableIterator that might have filter and transformations and losses the closeable.
In case of `ParquetInterable` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not. the case for OrcIterable that uses `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds orcFileReader to closeable, but close() is called on `OrcRowIterator` and not Iterable, leaving the `orcFileReader` open.
In case of `ParquetInterable` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not the case for `OrcIterable` that uses `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#issuecomment-1860221881
@pvary, thanks for the review!
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427017701
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
Thanks for the explanation.
So basically the `addCloseable(reader);` is not used here, neither in `ParquetIterable`, as the returned `CloseableIterator` `close` method is used clean up the resources.
And in case of the Vectorized ORC reads, we return not the `OrcRowIterator` which closes the reader, but the `VectorizedRowBatchIterator` which closes the `RecordReader rows` which is generated like this: `orcFileReader.rows(options)`. And the `RecordReaderImpl` generated this way does not close the underlying `ReaderImpl`.
Am I right here? Could we eventually fix this in ORC too?
If so, it would be nice to have a ORC jira saying that this could be removed once it is fixed in ORC...
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427131740
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
> Thanks for the explanation. So basically the `addCloseable(reader);` is not used here, neither in `ParquetIterable`, as the returned `CloseableIterator` `close` method is used clean up the resources. And in case of the Vectorized ORC reads, we return not the `OrcRowIterator` which closes the reader, but the `VectorizedRowBatchIterator` which closes the `RecordReader rows` which is generated like this: `orcFileReader.rows(options)`. And the `RecordReaderImpl` generated this way does not close the underlying `ReaderImpl`.
>
> Am I right here? Could we eventually fix this in ORC too? If so, it would be nice to have a ORC jira saying that this could be removed once it is fixed in ORC...
Yes, see [HIVE-25736](https://issues.apache.org/jira/browse/HIVE-25736) description :)
> After [ORC-498](https://issues.apache.org/jira/browse/ORC-498) the Orc readers should be closed explicitly
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ closed pull request #9301: BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes
URL: https://github.com/apache/iceberg/pull/9301
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427582320
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
Ohh.. I understand it now! The ORC "fix" added the feature, that we need to close the reader explicitly...
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427582938
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
Any chance for a test?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds `orcFileReader` to closeable, however, close() is called on `OrcRowIterator` and not `OrcIterable`, leaving the `orcFileReader` open.
In case of `ParquetIterator` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
````
but that's not the case for ORC `VectorizedRowBatchIterator`
````
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427023155
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
<img width="504" alt="Screenshot 2023-12-14 at 18 25 54" src="https://github.com/apache/iceberg/assets/2761528/d2f65f7d-cc22-4524-98c2-47d89aac04be">
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1427579685
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
Based on this, I would think that this does not affect Apache Iceberg:
https://github.com/apache/iceberg/blob/c6bbbdbc11d42713c86dd52185f577b81d946963/gradle/libs.versions.toml#L71
We use newer ORC version, which should contain ORC-498.
Maybe we still miss something.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds `orcFileReader` to closeable, however, close() is called on `OrcRowIterator` and not `OrcIterable`, leaving the `orcFileReader` open.
In case of `ParquetInterable` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not the case for `OrcIterable` that uses `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds orcFileReader to closeable, but it never gets invoked. `MergeIterator` is operating on a` CloseableIterator` that might have filter and transformation and losses the closeable.
In case of `ParquetInterable` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not the case for `OrcIterable` that uses `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds `orcFileReader` to closeable, however, close() is called on `OrcRowIterator` and not `OrcIterable`, leaving the `orcFileReader` open.
In case of `ParquetIterator` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not the case for `OrcIterable` that uses `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#discussion_r1426947971
##########
orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java:
##########
@@ -134,7 +134,13 @@ private static VectorizedRowBatchIterator newOrcIterator(
try {
return new VectorizedRowBatchIterator(
- file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch);
+ file.location(), readerSchema, orcFileReader.rows(options), recordsPerBatch) {
+ @Override
+ public void close() throws IOException {
Review Comment:
`OrcIterable` also extends `CloseableGroup` and adds `orcFileReader` to closeable, however, close() is called on `OrcRowIterator` and not `OrcIterable`, leaving the `orcFileReader` open.
In case of `ParquetIterator` we close the reader.
````
public void close() throws IOException {
ParquetReader.close();
}
}
````
but that's not the case for `VectorizedRowBatchIterator`
````
@Override
public void close() throws IOException {
orcFileReader.rows(options).close();
}
````
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] BugFix: ORC reader is not closed when SortedMerge iterator is used for positional deletes [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on PR #9301:
URL: https://github.com/apache/iceberg/pull/9301#issuecomment-1858092550
Cool! Thanks @deniskuzZ for coming back with the results!
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org