Skip to content

Commit

Permalink
address java comments
Browse files Browse the repository at this point in the history
  • Loading branch information
emkornfield committed Oct 17, 2020
1 parent 7c2a1fe commit 5321767
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ public void write(BigDecimalHolder holder) {
getWriter(MinorType.BIGDECIMAL).write(holder);
}
public void writeBigDecimal(int start, ArrowBuf buffer, ArrowType arrowType) {
public void writeBigDecimal(long start, ArrowBuf buffer, ArrowType arrowType) {
getWriter(MinorType.BIGDECIMAL).writeBigDecimal(start, buffer, arrowType);
}
public void writeBigDecimal(int start, ArrowBuf buffer) {
public void writeBigDecimal(long start, ArrowBuf buffer) {
getWriter(MinorType.BIGDECIMAL).writeBigDecimal(start, buffer);
}
public void writeBigEndianBytesToBigDecimal(byte[] value, ArrowType arrowType) {
Expand Down
2 changes: 1 addition & 1 deletion java/vector/src/main/codegen/templates/UnionVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public StructVector getStruct() {
<#if minor.class?ends_with("Decimal")>
public ${name}Vector get${name}Vector() {
if (${uncappedName}Vector == null) {
throw new IllegalArgumentException("No Decimal ${uncappedName} present. Provide ArrowType argument to create a new vector");
throw new IllegalArgumentException("No ${uncappedName} present. Provide ArrowType argument to create a new vector");
}
return ${uncappedName}Vector;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void get(int index, NullableBigDecimalHolder holder) {
holder.buffer = valueBuffer;
holder.precision = precision;
holder.scale = scale;
holder.start = index * TYPE_WIDTH;
holder.start = ((long) index) * TYPE_WIDTH;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private DecimalUtility() {}
public static BigDecimal getBigDecimalFromArrowBuf(ArrowBuf bytebuf, int index, int scale, int byteWidth) {
byte[] value = new byte[byteWidth];
byte temp;
final long startIndex = (long) index * DECIMAL_BYTE_LENGTH;
final long startIndex = (long) index * byteWidth;

// Decimal stored as little endian, need to swap bytes to make BigDecimal
bytebuf.getBytes(startIndex, value, 0, byteWidth);
Expand Down

0 comments on commit 5321767

Please sign in to comment.