Skip to content

Commit

Permalink
[SPARK-41155][SQL] Add error message to SchemaColumnConvertNotSupport…
Browse files Browse the repository at this point in the history
…edException

### What changes were proposed in this pull request?

This patch adds error message to `SchemaColumnConvertNotSupportedException`.

### Why are the changes needed?

Just found the fact that `SchemaColumnConvertNotSupportedException` doesn't have any error message is annoying for debugging.

In stack trace, we only see `SchemaColumnConvertNotSupportedException` but don't know what column is wrong.

After this change, we should be able to see it, e.g.,

```
org.apache.spark.sql.execution.datasources.SchemaColumnConvertNotSupportedException: column: [_1], physicalType: INT32, logicalType: bigint
```

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing tests.

Closes apache#38669 from viirya/add_error_message.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
  • Loading branch information
viirya authored and beliefer committed Dec 18, 2022
1 parent 4c3f2f6 commit a6d4319
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public SchemaColumnConvertNotSupportedException(
String column,
String physicalType,
String logicalType) {
super();
super("column: " + column + ", physicalType: " + physicalType +
", logicalType: " + logicalType);
this.column = column;
this.physicalType = physicalType;
this.logicalType = logicalType;
Expand Down

0 comments on commit a6d4319

Please sign in to comment.