Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/20649#discussion_r170256000
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala ---
@@ -271,7 +271,9 @@ case class StructType(fields: Array[StructField])
extends DataType with Seq[Stru
*/
def apply(name: String): StructField = {
nameToField.getOrElse(name,
- throw new IllegalArgumentException(s"""Field "$name" does not
exist."""))
+ throw new IllegalArgumentException(
+ s"""Field "$name" does not exist.
+ |Available fields:
${fieldNamesSet.mkString(",")}""".stripMargin))
--- End diff --
nit: can we add a space after the comma? I think it can help readability
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]