[
https://issues.apache.org/jira/browse/HIVE-25400?focusedWorklogId=630702&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-630702
]
ASF GitHub Bot logged work on HIVE-25400:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Jul/21 18:23
Start Date: 28/Jul/21 18:23
Worklog Time Spent: 10m
Work Description: pavibhai commented on a change in pull request #2543:
URL: https://github.com/apache/hive/pull/2543#discussion_r678549917
##########
File path:
storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/BytesColumnVector.java
##########
@@ -213,18 +211,17 @@ public void setVal(int elementNum, byte[] sourceBuf) {
* Ensures that we have space allocated for the next value, which has size
* length bytes.
*
- * Updates currentValue, currentOffset, and sharedBufferOffset for this
value.
+ * Updates currentValue and currentOffset for this value.
*
- * Always use before getValPreallocatedBytes, getValPreallocatedStart,
- * and setValPreallocated.
+ * Always use before getValPreallocatedBytes, getValPreallocatedStart.
+ * setValPreallocated must be called to actually reserve the bytes.
*/
public void ensureValPreallocated(int length) {
if ((sharedBufferOffset + length) > sharedBuffer.length) {
currentValue = allocateBuffer(length);
Review comment:
This is unrelated to the fix but feels like only currentValue is getting
assigned while currentOffset is also being changed inside allocateBuffer method.
Since allocateBuffer is private and not used elsewhere, we could move both
the assignments of currentValue and currentOffset into the allocateBuffer
method and have this as
```java
if ((sharedBufferOffset + length) > sharedBuffer.length) {
allocateBuffer(length);
} else {
currentValue = sharedBuffer;
currentOffset = sharedBufferOffset;
}
```
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 630702)
Time Spent: 20m (was: 10m)
> Move the offset updating in BytesColumnVector to setValPreallocated.
> --------------------------------------------------------------------
>
> Key: HIVE-25400
> URL: https://issues.apache.org/jira/browse/HIVE-25400
> Project: Hive
> Issue Type: Bug
> Reporter: Owen O'Malley
> Assignee: Owen O'Malley
> Priority: Major
> Labels: pull-request-available
> Fix For: storage-2.7.3, storage-2.8.1, storage-2.9.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> HIVE-25190 changed the semantics of BytesColumnVector so that
> ensureValPreallocated reserved the room, which interacted badly with ORC's
> redact mask code. The redact mask code needs to be able to increase the
> allocation as it goes so it can call the ensureValPreallocated multiple times.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)