Skip to content

Commit

Permalink
Add java tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Feng <[email protected]>
  • Loading branch information
ustcfy committed Jan 14, 2025
1 parent 51a0d87 commit d6d5d4c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/com/nvidia/spark/rapids/jni/CastStringsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,18 @@ void castToDecimalNoStripTest() {
}
}

@Test
void castFromLongToBinaryStringTest() {
try (ColumnVector v0 = ColumnVector.fromBoxedLongs(null, 0L, 1L, 10L, -1L, Long.MAX_VALUE, Long.MIN_VALUE);
ColumnVector result = CastStrings.fromLongToBinary(v0);
ColumnVector expected = ColumnVector.fromStrings(null, "0", "1", "1010",
"1111111111111111111111111111111111111111111111111111111111111111",
"111111111111111111111111111111111111111111111111111111111111111",
"1000000000000000000000000000000000000000000000000000000000000000")) {
AssertUtils.assertColumnsAreEqual(expected, result);
}
}

private void convTestInternal(Table input, Table expected, int fromBase) {
try(
ColumnVector intCol = CastStrings.toIntegersWithBase(input.getColumn(0), fromBase, false,
Expand Down

0 comments on commit d6d5d4c

Please sign in to comment.