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 acd7a05
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 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,22 @@ public static ColumnVector toIntegersWithBase(ColumnView cv, int base,
type.getTypeId().getNativeId()));
}

/**
* Returns a new strings column converting integer column to the desired base i.e. base 10
* or base 16 (hexadecimal characters). 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 input column to be converted
* @param base base that we want to convert to
* @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 acd7a05

Please sign in to comment.