Skip to content

Commit

Permalink
added javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
razajafri committed Sep 27, 2023
1 parent 894d38c commit b0a54eb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/com/nvidia/spark/rapids/jni/CastStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ public static ColumnVector toIntegersWithBase(ColumnView cv, int base,
type.getTypeId().getNativeId()));
}

/**
* Converts an integer column to a strings column with either decimal or hexadecimal values
* based on the base provided. The hexadecimal value will be returned with the leading
* zeros dropped
* Example:
* input = [123, -1, 0, 27, 342718233]
* s = fromIntegersWithBase(input, 16)
* s is [ '4D2', 'FFFFFFFF', '0', '1B', '146D7719']
* s = fromIntegersWithBase(input, 10)
* s is ['123', '-1', '0', '27', '342718233']
*
* @param cv The input integer column to be converted.
* @param base base that we want to convert to either 10 or 16
* @return a new String ColumnVector
*/
public static ColumnVector fromIntegersWithBase(ColumnView cv, int base) {
return new ColumnVector(fromIntegersWithBase(cv.getNativeView(), base));
}
Expand Down

0 comments on commit b0a54eb

Please sign in to comment.