Repository navigation
Conversation
There was a problem hiding this comment.
Looks good to me. Although we don't have a test coverage here, I believe this patch is fully tested with Hive tests, @difin .
- I copied your JIRA description into the PR description and revise it to make a rich commit log.
- I added one minor comment about a function description. You can reuse the most of the existing comments. Please add the background of this new wrapper
resetmethod, especially, the increased length.
|
cc @omalley , @williamhyun , @guiyanakuang |
reset(DiskRangeList input, long length) to InStream impl class
|
Although this |
reset(DiskRangeList input, long length) to InStream impl classreset(DiskRangeList input, long length) to InStream impl class
|
Could we add a simple unit test like this: |
…tting UncompressedStream.
|
I've added unit tests as suggested. |
|
Thank you for updating, @difin . |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM. Merged to main/1.8 for Apache ORC 1.8.3.
… impl class ### What changes were proposed in this pull request? Adding a possibility to re-set the length of the UncompressedStream when calling reset() on it. ### Why are the changes needed? In short, in some cases, after resetting an UncompressedStream, its actual length is longer than its initial length. Before 'ORC-516 - Update InStream for column compression', InStream.UncompressedStream class had 'length' field and the length was modifiable in reset() method. ORC-516 was the root cause of this regression reported in HIVE-27128. The `reset()` method was used in `SettableUncompressedStream` class in `setBuffers()` method: ```java public void setBuffers(DiskRangeInfo diskRangeInfo) { reset(diskRangeInfo.getDiskRanges(), diskRangeInfo.getTotalLength()); setOffset(diskRangeInfo.getDiskRanges()); } ``` After Orc version upgrade in Hive to 1.6.7., and since `SettableUncompressedStream` class was removed from Orc code base, Hive manages it own copy of `SettableUncompressedStream` which doesn't pass new length to `UncompressedStream` when calling reset (because `UncompressedStream` doesn't accept new length any more in the reset method): ```java public void setBuffers(DiskRangeInfo diskRangeList) { reset(diskRangeList.getDiskRanges()); setOffset(diskRangeList.getDiskRanges()); } ``` When investigating the issue reported in HIVE-27128 and comparing the lengths of the InStream.UncompressedStream prior to the upgrade of ORC version in Hive to 1.6.7. (which included ORC-516) and after I noticed that the issue happens with ORC-516 changes because the length of the InStream.UncompressedStream is set once for all row groups, while without those changes the length is dynamic and sometimes is set to bigger value than the initial value. ### How was this patch tested? 1. Passing CI pipeline tests 2. Running Hive Q-test https://github.com/difin/hive/commits/orc_read_err_qtest on the local dev env with a change in Hive's SettableUncompressedStream to pass diskRangeList.getTotalLength() to the reset method of UncompressedStream. Closes #1432 from difin/ORC-1393. Authored-by: Dmitriy Fingerman <dfingerman@cloudera.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit b56d2d1) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
|
Thank you for your contribution. ORC-1393 is resolved and assigned to you. |
… impl class
### What changes were proposed in this pull request?
Adding a possibility to re-set the length of the UncompressedStream when calling reset() on it.
### Why are the changes needed?
In short, in some cases, after resetting an UncompressedStream, its actual length is longer than its initial length.
Before 'ORC-516 - Update InStream for column compression', InStream.UncompressedStream class had 'length' field and the length was modifiable in reset() method. ORC-516 was the root cause of this regression reported in HIVE-27128.
The `reset()` method was used in `SettableUncompressedStream` class in `setBuffers()` method:
```java
public void setBuffers(DiskRangeInfo diskRangeInfo) {
reset(diskRangeInfo.getDiskRanges(), diskRangeInfo.getTotalLength());
setOffset(diskRangeInfo.getDiskRanges());
}
```
After Orc version upgrade in Hive to 1.6.7., and since `SettableUncompressedStream` class was removed from Orc code base, Hive manages it own copy of `SettableUncompressedStream` which doesn't pass new length to `UncompressedStream` when calling reset (because `UncompressedStream` doesn't accept new length any more in the reset method):
```java
public void setBuffers(DiskRangeInfo diskRangeList) {
reset(diskRangeList.getDiskRanges());
setOffset(diskRangeList.getDiskRanges());
}
```
When investigating the issue reported in HIVE-27128 and comparing the lengths of the InStream.UncompressedStream prior to the upgrade of ORC version in Hive to 1.6.7. (which included ORC-516) and after I noticed that the issue happens with ORC-516 changes because the length of the InStream.UncompressedStream is set once for all row groups, while without those changes the length is dynamic and sometimes is set to bigger value than the initial value.
### How was this patch tested?
1. Passing CI pipeline tests
2. Running Hive Q-test https://github.com/difin/hive/commits/orc_read_err_qtest on the local dev env with a change in Hive's SettableUncompressedStream to pass diskRangeList.getTotalLength() to the reset method of UncompressedStream.
Closes apache#1432 from difin/ORC-1393.
Authored-by: Dmitriy Fingerman <dfingerman@cloudera.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
Adding a possibility to re-set the length of the UncompressedStream when calling reset() on it.
Why are the changes needed?
In short, in some cases, after resetting an UncompressedStream, its actual length is longer than its initial length.
Before 'ORC-516 - Update InStream for column compression', InStream.UncompressedStream class had 'length' field and the length was modifiable in reset() method. ORC-516 was the root cause of this regression reported in HIVE-27128.
The
reset()method was used inSettableUncompressedStreamclass insetBuffers()method:After Orc version upgrade in Hive to 1.6.7., and since
SettableUncompressedStreamclass was removed from Orc code base, Hive manages it own copy ofSettableUncompressedStreamwhich doesn't pass new length toUncompressedStreamwhen calling reset (becauseUncompressedStreamdoesn't accept new length any more in the reset method):When investigating the issue reported in HIVE-27128 and comparing the lengths of the InStream.UncompressedStream prior to the upgrade of ORC version in Hive to 1.6.7. (which included ORC-516) and after I noticed that the issue happens with ORC-516 changes because the length of the InStream.UncompressedStream is set once for all row groups, while without those changes the length is dynamic and sometimes is set to bigger value than the initial value.
How was this patch tested?