Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Run the following physical plan:
{ head:{ type:"APACHE_DRILL_PHYSICAL", version:"1", generator:{ type:"manual" } }, graph:[ { @id:1, pop:"mock-scan", url: "http://apache.org", entries:[ {records: 100, types: [ {name: "blue", type: "BIT", mode: "REQUIRED"}, {name: "red", type: "BIGINT", mode: "REQUIRED"}, {name: "green", type: "INT", mode: "OPTIONAL"} ]} ] }, { @id:2, child: 1, pop:"selection-vector-remover" }, { @id: 3, child: 2, pop: "screen" } ] }
It fails with:
Failure while running fragment., index: 0, length: 8192 (expected: range(0, 1024))
Couple of issues:
1. We don't transfer valueCapacity as part of TransferPair.transfer(). This causes the vector that got the buffers to have 0 as valueCapacity. During the realloc of vector that got the buffer, we rely on valueCapacity to decide whether to realloc or not.
2. When BitVector.Mutator.setValueCount() is called we try to reallocate the buffer as the valueCapacity is zero. As part of realloc, we allocate a buffer of size 1028bytes and try to copy the existing buffer. Problem is existing buffer has size more than 1028bytes and we fail in copying.