@@ -20,8 +20,8 @@ package org.apache.spark.sql.catalyst.plans.logical
2020import org .apache .spark .sql .catalyst .errors .TreeNodeException
2121import org .apache .spark .sql .catalyst .expressions ._
2222import org .apache .spark .sql .catalyst .plans .QueryPlan
23+ import org .apache .spark .sql .catalyst .types .StructType
2324import org .apache .spark .sql .catalyst .trees
24- import org .apache .spark .sql .catalyst .types ._
2525
2626abstract class LogicalPlan extends QueryPlan [LogicalPlan ] {
2727 self : Product =>
@@ -54,11 +54,9 @@ abstract class LogicalPlan extends QueryPlan[LogicalPlan] {
5454 /**
5555 * Optionally resolves the given string to a
5656 * [[catalyst.expressions.NamedExpression NamedExpression ]]. The attribute is expressed as
57- * as string in the following form: `[scope].AttributeName.[nested].[fields]...`. Fields
58- * can contain ordinal expressions, such as `field[i][j][k]...`.
57+ * as string in the following form: `[scope].AttributeName.[nested].[fields]...`.
5958 */
6059 def resolve (name : String ): Option [NamedExpression ] = {
61- // TODO: extend SqlParser to handle field expressions
6260 val parts = name.split(" \\ ." )
6361 // Collect all attributes that are output by this nodes children where either the first part
6462 // matches the name or where the first part matches the scope and the second part matches the
@@ -69,20 +67,6 @@ abstract class LogicalPlan extends QueryPlan[LogicalPlan] {
6967 val remainingParts =
7068 if (option.qualifiers.contains(parts.head) && parts.size > 1 ) parts.drop(1 ) else parts
7169 if (option.name == remainingParts.head) (option, remainingParts.tail.toList) :: Nil else Nil
72- // TODO from rebase!
73- /* val remainingParts = if (option.qualifiers contains parts.head) parts.drop(1) else parts
74- val relevantRemaining =
75- if (remainingParts.head.matches("\\w*\\[(\\d+|\\w+)\\]")) { // array field name
76- remainingParts.head.substring(0, remainingParts.head.indexOf("["))
77- } else {
78- remainingParts.head
79- }
80- if (option.name == relevantRemaining) (option, remainingParts.tail.toList) :: Nil else Nil*/
81- // If the first part of the desired name matches a qualifier for this possible match, drop it.
82- /* TODO: from rebase!
83- val remainingParts = if (option.qualifiers contains parts.head) parts.drop(1) else parts
84- if (option.name == remainingParts.head) (option, remainingParts.tail.toList) :: Nil else Nil
85- */
8670 }
8771
8872 options.distinct match {
0 commit comments