[
https://issues.apache.org/jira/browse/DRILL-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16903528#comment-16903528
]
ASF GitHub Bot commented on DRILL-7341:
---------------------------------------
weijietong commented on pull request #1838: DRILL-7341: Vector reAlloc may
fails after exchange
URL: https://github.com/apache/drill/pull/1838#discussion_r312317242
##########
File path: exec/vector/src/main/codegen/templates/FixedValueVectors.java
##########
@@ -210,10 +210,16 @@ public void reAlloc() {
// a zero-length buffer. Instead, just allocate a 256 byte
// buffer if we start at 0.
- final long newAllocationSize = allocationSizeInBytes == 0
+ long newAllocationSize = allocationSizeInBytes == 0
? 256
: allocationSizeInBytes * 2L;
+ // Some operations, such as Value Vector#exchange, can be change DrillBuf
data field without corresponding allocation size changes.
+ // Check that the size of the allocation is sufficient to copy the old
buffer.
+ while (newAllocationSize < data.capacity()) {
Review comment:
The change is to keep backward compatible. The reason I guess is that most
of the fixed VV is number type. Initializing to zero is to keep the java
default value convention.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> Vector reAlloc may fails after exchange.
> ----------------------------------------
>
> Key: DRILL-7341
> URL: https://issues.apache.org/jira/browse/DRILL-7341
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.16.0
> Reporter: Oleg Zinoviev
> Priority: Major
> Attachments: stacktrace.log
>
>
> There are several methods that modify the BaseDataValueVector#data field.
> Some of them, such as BaseDataValueVector#exchange, do not change
> allocationSizeInBytes.
> Therefore, if BaseDataValueVector#exchange was executed for vectors with
> different size, *ValueVector#reAlloc may create a buffer of insufficient size.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)