Skip to content

Commit 405c0c7

Browse files
thirtisevenclaude
andcommitted
Add Java-side charset validation before JNI call
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c52a778 commit 405c0c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/nvidia/spark/rapids/jni/CharsetDecode.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public class CharsetDecode {
3434
* @return UTF-8 string column
3535
*/
3636
public static ColumnVector decode(ColumnView cv, int charset) {
37+
if (charset != GBK) {
38+
throw new IllegalArgumentException("Unsupported charset: " + charset);
39+
}
3740
return new ColumnVector(decodeNative(cv.getNativeView(), charset));
3841
}
3942

0 commit comments

Comments
 (0)