[FEA][JNI] Throw specific exception from `Table.readJSON` instead of `AssertionError`
- 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
Assessment
This issue has not been assessed yet.