Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/2209#discussion_r17380899
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala
---
@@ -158,11 +159,18 @@ case class Subquery(alias: String, child:
LogicalPlan) extends UnaryNode {
* this allows for optional case insensitive attribute resolution. This
node can be elided after
* analysis.
*/
-case class LowerCaseSchema(child: LogicalPlan) extends UnaryNode {
+case class LowerCaseSchema(child: LogicalPlan) extends UnaryNode with
Logging {
protected def lowerCaseSchema(dataType: DataType): DataType = dataType
match {
case StructType(fields) =>
- StructType(fields.map(f =>
- StructField(f.name.toLowerCase(), lowerCaseSchema(f.dataType),
f.nullable)))
+ val convertedFields = fields.map(f =>
+ StructField(f.name.toLowerCase, lowerCaseSchema(f.dataType),
f.nullable))
+ val deduplicatedFields = convertedFields.groupBy(_.name).map {
--- End diff --
Ahh, this reorders the schema and breaks things. Props to @andyk.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]