weijietong commented on a change in 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]
With regards,
Apache Git Services