You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2018/12/24 00:13:56 UTC
[GitHub] srowen commented on a change in pull request #23373:
[SPARK-14023][CORE][SQL] Don't reference 'field' in StructField errors for
clarity in exceptions
srowen commented on a change in pull request #23373: [SPARK-14023][CORE][SQL] Don't reference 'field' in StructField errors for clarity in exceptions
URL: https://github.com/apache/spark/pull/23373#discussion_r243779585
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala
##########
@@ -301,8 +300,8 @@ case class StructType(fields: Array[StructField]) extends DataType with Seq[Stru
def fieldIndex(name: String): Int = {
nameToIndex.getOrElse(name,
throw new IllegalArgumentException(
- s"""Field "$name" does not exist.
- |Available fields: ${fieldNames.mkString(", ")}""".stripMargin))
+ s""""$name" does not exist.
+ |Available: ${fieldNames.mkString("\"", "\", \"", "\"")}""".stripMargin))
Review comment:
Sure, I'll remove quotes around all versions of this exception.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org