Skip to content

Commit

Permalink
[SQL][minor] make it more clear that we only need to re-throw GetFiel…
Browse files Browse the repository at this point in the history
…d exception for UnresolvedAttribute

For `GetField` outside `UnresolvedAttribute`, we will throw exception in `Analyzer`.

Author: Wenchen Fan <[email protected]>

Closes apache#5588 from cloud-fan/tmp and squashes the following commits:

7ac74d2 [Wenchen Fan] small refactor
  • Loading branch information
cloud-fan authored and nemccarthy committed Jun 19, 2015
1 parent 4e2eb7a commit 7d6103f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ trait CheckAnalysis {
operator transformExpressionsUp {
case a: Attribute if !a.resolved =>
if (operator.childrenResolved) {
val nameParts = a match {
case UnresolvedAttribute(nameParts) => nameParts
case _ => Seq(a.name)
a match {
case UnresolvedAttribute(nameParts) =>
// Throw errors for specific problems with get field.
operator.resolveChildren(nameParts, resolver, throwErrors = true)
}
// Throw errors for specific problems with get field.
operator.resolveChildren(nameParts, resolver, throwErrors = true)
}

val from = operator.inputSet.map(_.name).mkString(", ")
Expand Down

0 comments on commit 7d6103f

Please sign in to comment.