GitHub user xysun opened a pull request:
https://github.com/apache/spark/pull/20649
[SPARK-23452][SQL] improve missing field error message in `StructType`
## What changes were proposed in this pull request?
The error message ```s"""Field "$name" does not exist."""``` is thrown when
looking up an unknown field in StructType. In the error message, we should also
contain the information about which columns/fields exist in this struct.
## How was this patch tested?
Added new unit tests.
Note: I created a new `StructTypeSuite.scala` as I couldn't find an
existing suite that's suitable to place these tests. I may be missing something
so feel free to propose new locations.
Please review http://spark.apache.org/contributing.html before opening a
pull request.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/xysun/spark SPARK-23462
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/20649.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #20649
----
commit e1a5ccfdfc4ea4355207cd121a372ad605a0fc3d
Author: Xiayun Sun <xiayunsun@...>
Date: 2018-02-21T09:31:11Z
output current fields in missing fields error message
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]