Skip to content

Commit

Permalink
change the rule of resolved for Generate
Browse files Browse the repository at this point in the history
  • Loading branch information
chenghao-intel committed Apr 17, 2015
1 parent 04ae500 commit 002c361
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ class Analyzer(
generatorOutput: Seq[Attribute]): Seq[Attribute] = {
val elementTypes = generator.elementTypes

if (generatorOutput.size == elementTypes.size) {
if (generatorOutput.length == elementTypes.length) {
generatorOutput.zip(elementTypes).map {
case (a, (t, nullable)) if !a.resolved =>
AttributeReference(a.name, t, nullable)()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ case class Alias(child: Expression, name: String)(
extends NamedExpression with trees.UnaryNode[Expression] {

override type EvaluatedType = Any
// Alias(Generator, xx) need to be transformed into Generate(generator, ...)
override lazy val resolved = childrenResolved && !child.isInstanceOf[Generator]
override lazy val resolved = childrenResolved

override def eval(input: Row): Any = child.eval(input)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ case class Generate(
override lazy val resolved: Boolean = {
generator.resolved &&
childrenResolved &&
generator.elementTypes.length == generatorOutput.length &&
!generatorOutput.exists(!_.resolved)
}

Expand Down

0 comments on commit 002c361

Please sign in to comment.