Skip to content

Commit 2e655be

Browse files
beinanclaude
andcommitted
refactor: simplify UInt64 conversion in extractRowAddresses
Use UInt8Vector.getObjectNoOverflow().longValue() directly with a comment noting it follows the same pattern as UInt8Accessor.getLong(). Removed unnecessary BigInteger cast. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 81b3e92 commit 2e655be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lance-spark-base_2.12/src/main/java/org/lance/spark/internal/LanceFragmentColumnarBatchScanner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ private long[] extractRowAddresses(
105105
FieldVector lastVector = rootVectors.get(rootVectors.size() - 1);
106106
if (LanceConstant.ROW_ADDRESS.equals(lastVector.getField().getName())
107107
&& lastVector instanceof UInt8Vector) {
108+
// UInt64 → long conversion follows the same pattern as UInt8Accessor.getLong()
108109
UInt8Vector rowAddrVector = (UInt8Vector) lastVector;
109110
long[] rowAddresses = new long[rowCount];
110111
for (int i = 0; i < rowCount; i++) {
111-
rowAddresses[i] =
112-
((java.math.BigInteger) rowAddrVector.getObjectNoOverflow(i)).longValue();
112+
rowAddresses[i] = rowAddrVector.getObjectNoOverflow(i).longValue();
113113
}
114114
return rowAddresses;
115115
}

0 commit comments

Comments
 (0)