Skip to content

Commit

Permalink
Fix pair
Browse files Browse the repository at this point in the history
  • Loading branch information
liurenjie1024 committed Oct 24, 2024
1 parent 13d03cb commit e174326
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/main/java/com/nvidia/spark/rapids/jni/Pair.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.nvidia.spark.rapids.jni;

public class Pair<K, V> {
private final K left;
private final V right;

public Pair(K left, V right) {
this.left = left;
this.right = right;
}

public K getLeft() {
return left;
}

public V getRight() {
return right;
}

public static <K, V> Pair<K, V> of(K left, V right) {
return new Pair<>(left, right);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import ai.rapids.cudf.DType;
import ai.rapids.cudf.DeviceMemoryBuffer;

import static com.nvidia.spark.rapids.jni.kudo.KudoSerializer.safeLongToInt;


public class ColumnViewInfo {
private final DType dtype;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.nvidia.spark.rapids.jni.kudo;

import ai.rapids.cudf.*;
import com.nvidia.spark.rapids.jni.Pair;
import com.nvidia.spark.rapids.jni.schema.Visitors;

import java.io.*;
Expand Down Expand Up @@ -102,7 +103,7 @@ public SerializedTable readOneTableBuffer(InputStream in) {
}

public Pair<HostMergeResult, MergeMetrics> mergeToHost(List<SerializedTable> serializedTables,
Schema schema) {
Schema schema) {
MergeMetrics.Builder metricsBuilder = MergeMetrics.builder();

MergedInfoCalc mergedInfoCalc = withTime(() -> MergedInfoCalc.calc(schema, serializedTables),
Expand Down

0 comments on commit e174326

Please sign in to comment.