Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20649#discussion_r173071330
  
    --- 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 --
    
    shall we use `fieldNames` to keep the field order?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to