Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Nghia Truong <[email protected]>
  • Loading branch information
ttnghia committed Dec 11, 2024
1 parent db279ea commit d7b01a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 10 additions & 13 deletions src/main/java/com/nvidia/spark/rapids/jni/BloomFilter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-2024, 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 All @@ -16,9 +16,6 @@

package com.nvidia.spark.rapids.jni;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ai.rapids.cudf.BaseDeviceMemoryBuffer;
import ai.rapids.cudf.ColumnVector;
import ai.rapids.cudf.CudfException;
Expand Down Expand Up @@ -59,19 +56,19 @@ public static void put(Scalar bloomFilter, ColumnVector cv){

/**
* Merge one or more bloom filters into a new bloom filter.
* @param bloomFilters A ColumnVector containing a bloom filter per row.
* @param bloomFilters A ColumnVector containing a bloom filter per row.
* @return A new bloom filter containing the merged inputs.
*/
public static Scalar merge(ColumnVector bloomFilters){
return new Scalar(DType.LIST, merge(bloomFilters.getNativeView()));
}

/**
* Probe a bloom filter with a column of longs. Returns a column of booleans. For
* Probe a bloom filter with a column of longs. Returns a column of booleans. For
* each row in the output; a value of true indicates that the corresponding input value
* -may- be in the set of values used to build the bloom filter; a value of false indicates
* that the corresponding input value is conclusively not in the set of values used to build
* the bloom filter.
* the bloom filter.
* @param bloomFilter The bloom filter to be probed.
* @param cv The column containing the values to check.
* @return A boolean column indicating the results of the probe.
Expand All @@ -81,23 +78,23 @@ public static ColumnVector probe(Scalar bloomFilter, ColumnVector cv){
}

/**
* Probe a bloom filter with a column of longs. Returns a column of booleans. For
* Probe a bloom filter with a column of longs. Returns a column of booleans. For
* each row in the output; a value of true indicates that the corresponding input value
* -may- be in the set of values used to build the bloom filter; a value of false indicates
* that the corresponding input value is conclusively not in the set of values used to build
* the bloom filter.
* @param bloomFilter The bloom filter to be probed. This buffer is expected to be the
* the bloom filter.
* @param bloomFilter The bloom filter to be probed. This buffer is expected to be the
* fully packed Spark bloom filter, including header.
* @param cv The column containing the values to check.
* @return A boolean column indicating the results of the probe.
*/
public static ColumnVector probe(BaseDeviceMemoryBuffer bloomFilter, ColumnVector cv){
return new ColumnVector(probebuffer(bloomFilter.getAddress(), bloomFilter.getLength(), cv.getNativeView()));
}

private static native long creategpu(int numHashes, long bloomFilterBits) throws CudfException;
private static native int put(long bloomFilter, long cv) throws CudfException;
private static native long merge(long bloomFilters) throws CudfException;
private static native long probe(long bloomFilter, long cv) throws CudfException;
private static native long probebuffer(long bloomFilter, long bloomFilterSize, long cv) throws CudfException;
private static native long probe(long bloomFilter, long cv) throws CudfException;
private static native long probebuffer(long bloomFilter, long bloomFilterSize, long cv) throws CudfException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class RegexRewriteUtils {
* a literal string followed by a range of characters in the range of start to end, with at least
* len characters.
*
* @param strings Column of strings to check for literal.
* @param input Column of strings to check for literal.
* @param literal UTF-8 encoded string to check in strings column.
* @param len Minimum number of characters to check after the literal.
* @param start Minimum UTF-8 codepoint value to check for in the range.
Expand Down

0 comments on commit d7b01a7

Please sign in to comment.