[
https://issues.apache.org/jira/browse/DRILL-3313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14646814#comment-14646814
]
ASF GitHub Bot commented on DRILL-3313:
---------------------------------------
Github user jaltekruse commented on a diff in the pull request:
https://github.com/apache/drill/pull/81#discussion_r35816854
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/BaseRepeatedValueVector.java
---
@@ -100,7 +100,7 @@ public void setInitialCapacity(int numRecords) {
@Override
public int getValueCapacity() {
- final int offsetValueCapacity = offsets.getValueCapacity() - 1;
+ final int offsetValueCapacity = Math.max(offsets.getValueCapacity() -
1, 0);
--- End diff --
Small comment, but there are two patterns used to handle special zero cases
in the vector code. The one I have seen is actually for a slightly different
case, the example copied below is out of the VarCharVector.setValueCount(int)
method. It might be worth making the pattern consistent by using the ternary
operator for both of these cases, so the fact that they are distinct is more
obvious. This might seem a little contradictory, having them look totally
different might be better. However, on first glance I thought this was a
different way to express the same concept.
valueCount == 0 ? 0 : valueCount+1
> Eliminate redundant #load methods and unit-test loading & exporting of vectors
> ------------------------------------------------------------------------------
>
> Key: DRILL-3313
> URL: https://issues.apache.org/jira/browse/DRILL-3313
> Project: Apache Drill
> Issue Type: Sub-task
> Components: Execution - Data Types
> Affects Versions: 1.0.0
> Reporter: Hanifi Gunes
> Assignee: Jason Altekruse
> Fix For: 1.2.0
>
>
> Vectors have multiple #load methods that are used to populate data from raw
> buffers. It is relatively tough to reason, maintain and unit-test loading and
> exporting of data since there is many redundant code around load methods.
> This issue proposes to have single #load method conforming to VV#load(def,
> buffer) signature eliminating all other #load overrides.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)