Skip to content

Commit

Permalink
Java review comments:
Browse files Browse the repository at this point in the history
1. Removed extra whitespaces, unnecessary comments.
2. Fixed copyright date.
3. Reused `big()` helper function.
4. Updated `Scalar.equals()` to include DECIMAL128.

Signed-off-by: MithunR <[email protected]>
  • Loading branch information
mythrocks committed Sep 13, 2022
1 parent efa5b1a commit 283e76b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion java/src/main/java/ai/rapids/cudf/Scalar.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2019-2021, NVIDIA CORPORATION.
* Copyright (c) 2019-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -754,6 +754,8 @@ public boolean equals(Object o) {
case TIMESTAMP_NANOSECONDS:
case DECIMAL64:
return getLong() == other.getLong();
case DECIMAL128:
return getBigDecimal().equals(other.getBigDecimal());
case STRING:
return Arrays.equals(getUTF8(), other.getUTF8());
case LIST:
Expand Down
6 changes: 1 addition & 5 deletions java/src/test/java/ai/rapids/cudf/TableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4006,8 +4006,6 @@ void testWindowingCount() {
}
}



@Test
void testWindowingMin() {
try (Table unsorted = new Table.TestBuilder()
Expand Down Expand Up @@ -4964,8 +4962,6 @@ void testWindowingOnMultipleDifferentColumns() {
}
}

// Test Decimal OBY column with Range queries.

@Test
void testWindowingWithoutGroupByColumns() {
try (Table unsorted = new Table.TestBuilder().column( 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6) // OBY Key
Expand Down Expand Up @@ -5806,7 +5802,7 @@ private static Scalar getDecimalScalarRangeBounds(int scale, int unscaledValue,
{
case 2: return Scalar.fromDecimal(scale, unscaledValue);
case 3: return Scalar.fromDecimal(scale, Long.valueOf(unscaledValue));
case 4: return Scalar.fromDecimal(scale, new BigInteger("" + unscaledValue));
case 4: return Scalar.fromDecimal(scale, big(unscaledValue));
default:
throw new IllegalStateException("Unexpected order by column index: "
+ orderby_col_idx);
Expand Down

0 comments on commit 283e76b

Please sign in to comment.