Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/18266#discussion_r138473560 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala --- @@ -80,7 +80,7 @@ object JDBCRDD extends Logging { * @return A Catalyst schema corresponding to columns in the given order. */ private def pruneSchema(schema: StructType, columns: Array[String]): StructType = { - val fieldMap = Map(schema.fields.map(x => x.metadata.getString("name") -> x): _*) + val fieldMap = Map(schema.fields.map(x => x.name -> x): _*) --- End diff -- I see. Could we just get rid of the line where we put `name` in the metadata? https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala#L304
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org