JoshRosen opened a new pull request, #36814:
URL: https://github.com/apache/spark/pull/36814
### What changes were proposed in this pull request?
This PR improves the error message that is thrown when trying to run `SHOW
CREATE TABLE` on a Hive table with an unsupported serde. Currently this results
in an error like
```
org.apache.spark.sql.AnalysisException: Failed to execute SHOW CREATE TABLE
against table rcFileTable, which is created by Hive and uses the following
unsupported serde configuration
SERDE: org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe
INPUTFORMAT: org.apache.hadoop.hive.ql.io.RCFileInputFormat OUTPUTFORMAT:
org.apache.hadoop.hive.ql.io.RCFileOutputFormat
```
This patch improves this error message by adding a suggestion to use `SHOW
CREATE TABLE ... AS SERDE`:
```
org.apache.spark.sql.AnalysisException: Failed to execute SHOW CREATE TABLE
against table rcFileTable, which is created by Hive and uses the following
unsupported serde configuration
SERDE: org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe
INPUTFORMAT: org.apache.hadoop.hive.ql.io.RCFileInputFormat OUTPUTFORMAT:
org.apache.hadoop.hive.ql.io.RCFileOutputFormat
Please use `SHOW CREATE TABLE rcFileTable AS SERDE` to show Hive DDL instead.
```
### Why are the changes needed?
The existing error message is confusing.
### Does this PR introduce _any_ user-facing change?
Yes, it improves a user-facing error message.
### How was this patch tested?
Manually tested with
```
CREATE TABLE rcFileTable(i INT)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe'
STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
SHOW CREATE TABLE rcFileTable
```
to trigger the error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]