NVIDIA / NVIDIA/cudf

[FEA][JNI] Throw specific exception from `Table.readJSON` instead of `AssertionError`

Open
#14,331 0 comments 0 reactions 0 assignees View on GitHub
0 - Backlog cuIO feature request libcudf Spark
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
Per the discussion at https://github.com/NVIDIA/spark-rapids/pull/9304#discussion_r1372291170, the Spark plugin currently has to parse the error message from an `AssertionError`, which is an anti-pattern. This happens when the plugin calls `Table.readJSON` where the input is not JSON format.

This exception is thrown in the constructor for `Table`:

```java
public Table(long[] cudfColumns) {
assert cudfColumns != null && cudfColumns.length > 0 : "CudfColumns can't be null or empty";
```

**Describe the solution you'd like**
We should throw a specific exception instead.

**Describe alternatives you've considered**
None

**Additional context**
None

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.