1. [SPARK-23462][SQL] improve missing field error message in `StructType` (commit: a8e357ada8a52b9ec239f41de7ac0c0225c76050) (details)
Commit a8e357ada8a52b9ec239f41de7ac0c0225c76050 by hyukjinkwon
[SPARK-23462][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 before opening a
pull request.
Author: Xiayun Sun <>
Closes #20649 from xysun/SPARK-23462.
(cherry picked from commit b304e07e0671faf96530f9d8f49c55a83b07fa15)
Signed-off-by: hyukjinkwon <>
(commit: a8e357ada8a52b9ec239f41de7ac0c0225c76050)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala (diff)
The file was addedsql/catalyst/src/test/scala/org/apache/spark/sql/types/StructTypeSuite.scala