Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sperlingxx committed Mar 15, 2022
1 parent fcef618 commit d083d4e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions java/src/main/java/ai/rapids/cudf/GroupByAggregation.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public static GroupByAggregation collectList(NullPolicy nullPolicy) {
}

/**
* Collect the values into a set. All null values will be excluded, and all nan values are regarded as
* Collect the values into a set. All null values will be excluded, and all NaN values are regarded as
* unique instances.
*/
public static GroupByAggregation collectSet() {
Expand All @@ -270,7 +270,7 @@ public static GroupByAggregation mergeLists() {
}

/**
* Merge the partial sets produced by multiple CollectSetAggregations. Each null/nan value will be regarded as
* Merge the partial sets produced by multiple CollectSetAggregations. Each null/NaN value will be regarded as
* a unique instance.
*/
public static GroupByAggregation mergeSets() {
Expand Down
4 changes: 2 additions & 2 deletions java/src/main/java/ai/rapids/cudf/ReductionAggregation.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static ReductionAggregation collectList(NullPolicy nullPolicy) {
}

/**
* Collect the values into a set. All null values will be excluded, and all nan values are regarded as
* Collect the values into a set. All null values will be excluded, and all NaN values are regarded as
* unique instances.
*/
public static ReductionAggregation collectSet() {
Expand Down Expand Up @@ -255,7 +255,7 @@ public static ReductionAggregation mergeLists() {
}

/**
* Merge the partial sets produced by multiple CollectSetAggregations. Each null/nan value will be regarded as
* Merge the partial sets produced by multiple CollectSetAggregations. Each null/NaN value will be regarded as
* a unique instance.
*/
public static ReductionAggregation mergeSets() {
Expand Down
62 changes: 31 additions & 31 deletions java/src/test/java/ai/rapids/cudf/ReductionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,13 @@ private static Stream<Arguments> createTimestampDaysParams() {
);
}

private static Stream<Arguments> createTimestampResolutionParams(HostColumnVector.BasicType tpe) {
private static Stream<Arguments> createTimestampResolutionParams(HostColumnVector.BasicType type) {
Long[] vals = new Long[]{-1L, 7L, 123L, null, 50L, 60L, 100L};
return Stream.of(
Arguments.of(ReductionAggregation.max(), new Long[0], tpe, null),
Arguments.of(ReductionAggregation.max(), new Long[]{null, null, null}, tpe, null),
Arguments.of(ReductionAggregation.min(), vals, tpe, -1L),
Arguments.of(ReductionAggregation.max(), vals, tpe, 123L)
Arguments.of(ReductionAggregation.max(), new Long[0], type, null),
Arguments.of(ReductionAggregation.max(), new Long[]{null, null, null}, type, null),
Arguments.of(ReductionAggregation.min(), vals, type, -1L),
Arguments.of(ReductionAggregation.max(), vals, type, 123L)
);
}

Expand Down Expand Up @@ -429,8 +429,8 @@ private static void assertEqualsDelta(ReductionAggregation op, Scalar expected,
@ParameterizedTest
@MethodSource("createBooleanParams")
void testBoolean(ReductionAggregation op, Boolean[] values,
HostColumnVector.DataType tpe, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.fromBoxedBooleans(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEqualsDelta(op, expected, result, delta);
Expand All @@ -440,8 +440,8 @@ void testBoolean(ReductionAggregation op, Boolean[] values,
@ParameterizedTest
@MethodSource("createByteParams")
void testByte(ReductionAggregation op, Byte[] values,
HostColumnVector.DataType tpe, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.fromBoxedBytes(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEqualsDelta(op, expected, result, delta);
Expand All @@ -451,8 +451,8 @@ void testByte(ReductionAggregation op, Byte[] values,
@ParameterizedTest
@MethodSource("createShortParams")
void testShort(ReductionAggregation op, Short[] values,
HostColumnVector.DataType tpe, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.fromBoxedShorts(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEqualsDelta(op, expected, result, delta);
Expand All @@ -462,8 +462,8 @@ void testShort(ReductionAggregation op, Short[] values,
@ParameterizedTest
@MethodSource("createIntParams")
void testInt(ReductionAggregation op, Integer[] values,
HostColumnVector.DataType tpe, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.fromBoxedInts(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEqualsDelta(op, expected, result, delta);
Expand All @@ -473,8 +473,8 @@ void testInt(ReductionAggregation op, Integer[] values,
@ParameterizedTest
@MethodSource("createLongParams")
void testLong(ReductionAggregation op, Long[] values,
HostColumnVector.DataType tpe, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.fromBoxedLongs(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEqualsDelta(op, expected, result, delta);
Expand All @@ -484,8 +484,8 @@ void testLong(ReductionAggregation op, Long[] values,
@ParameterizedTest
@MethodSource("createFloatParams")
void testFloat(ReductionAggregation op, Float[] values,
HostColumnVector.DataType tpe, Object expectedObject, Float delta) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject, Float delta) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.fromBoxedFloats(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEqualsDelta(op, expected, result, delta);
Expand All @@ -495,8 +495,8 @@ void testFloat(ReductionAggregation op, Float[] values,
@ParameterizedTest
@MethodSource("createDoubleParams")
void testDouble(ReductionAggregation op, Double[] values,
HostColumnVector.DataType tpe, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject, Double delta) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.fromBoxedDoubles(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEqualsDelta(op, expected, result, delta);
Expand All @@ -506,8 +506,8 @@ void testDouble(ReductionAggregation op, Double[] values,
@ParameterizedTest
@MethodSource("createTimestampDaysParams")
void testTimestampDays(ReductionAggregation op, Integer[] values,
HostColumnVector.DataType tpe, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.timestampDaysFromBoxedInts(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEquals(expected, result);
Expand All @@ -517,8 +517,8 @@ void testTimestampDays(ReductionAggregation op, Integer[] values,
@ParameterizedTest
@MethodSource("createTimestampSecondsParams")
void testTimestampSeconds(ReductionAggregation op, Long[] values,
HostColumnVector.DataType tpe, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.timestampSecondsFromBoxedLongs(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEquals(expected, result);
Expand All @@ -528,8 +528,8 @@ void testTimestampSeconds(ReductionAggregation op, Long[] values,
@ParameterizedTest
@MethodSource("createTimestampMilliSecondsParams")
void testTimestampMilliseconds(ReductionAggregation op, Long[] values,
HostColumnVector.DataType tpe, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.timestampMilliSecondsFromBoxedLongs(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEquals(expected, result);
Expand All @@ -539,8 +539,8 @@ void testTimestampMilliseconds(ReductionAggregation op, Long[] values,
@ParameterizedTest
@MethodSource("createTimestampMicroSecondsParams")
void testTimestampMicroseconds(ReductionAggregation op, Long[] values,
HostColumnVector.DataType tpe, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.timestampMicroSecondsFromBoxedLongs(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEquals(expected, result);
Expand All @@ -550,8 +550,8 @@ void testTimestampMicroseconds(ReductionAggregation op, Long[] values,
@ParameterizedTest
@MethodSource("createTimestampNanoSecondsParams")
void testTimestampNanoseconds(ReductionAggregation op, Long[] values,
HostColumnVector.DataType tpe, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
HostColumnVector.DataType type, Object expectedObject) {
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.timestampNanoSecondsFromBoxedLongs(values);
Scalar result = v.reduce(op, expected.getType())) {
assertEquals(expected, result);
Expand All @@ -561,10 +561,10 @@ void testTimestampNanoseconds(ReductionAggregation op, Long[] values,
@ParameterizedTest
@MethodSource("createFloatArrayParams")
void testFloatArray(ReductionAggregation op, List<Float>[] values,
HostColumnVector.DataType tpe, Object expectedObject, Float delta) {
HostColumnVector.DataType type, Object expectedObject, Float delta) {
HostColumnVector.DataType listType = new HostColumnVector.ListType(
true, new HostColumnVector.BasicType(true, DType.FLOAT32));
try (Scalar expected = buildExpectedScalar(op, tpe, expectedObject);
try (Scalar expected = buildExpectedScalar(op, type, expectedObject);
ColumnVector v = ColumnVector.fromLists(listType, values);
Scalar result = v.reduce(op, expected.getType())) {
assertEqualsDelta(op, expected, result, delta);
Expand Down

0 comments on commit d083d4e

Please sign in to comment.