leesf commented on pull request #35274:
URL: https://github.com/apache/spark/pull/35274#issuecomment-1080776186
> @leesf Could you write a test which checks the error class, and entire
error message. Please, look at `QueryCompilationErrorsSuite`.
Hi @MaxGekk I tried to write tests referring to the Suite you mentioned,
since this PR modify the message in `to_csv` function, so I want to construct
the tests that throw `QueryExecutionErrors.inputTypeUnsupportedError(other)`
while resolve `inputSchema` in `csvExpressions`, but I find it is very hard to
do so since `to_csv` function can only accept struct type would not accept
other types as I try to use `to_csv` function in spark sql, but how can I pass
the non struct type to throw
`QueryExecutionErrors.inputTypeUnsupportedError(other)`? below is the scripts.
``` shell
spark.sql("select to_csv(10)").show
org.apache.spark.sql.AnalysisException: cannot resolve 'to_csv(10)' due to
data type mismatch: argument 1 requires struct type, however, '10' is of int
type.; line 1 pos 7;
```
any ideas to write tests for this PR? Thanks.
--
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]