Skip to content

Commit

Permalink
Fix override of KeyHint#transformExpressions{Up,Down}
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurdave committed Oct 13, 2015
1 parent 7c7357b commit 5071759
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,16 @@ case class KeyHint(newKeys: Seq[Key], child: LogicalPlan) extends UnaryNode {
/** Overridden here to apply `rule` to the keys as well as the child plan. */
override def transformExpressionsDown(
rule: PartialFunction[Expression, Expression]): this.type = {
KeyHint(newKeys.map(_.transformAttribute(rule.andThen(_.asInstanceOf[Attribute]))), child)
.asInstanceOf[this.type]
KeyHint(
newKeys.map(_.transformAttribute(rule.andThen(_.asInstanceOf[Attribute]))),
child.transformExpressionsDown(rule)).asInstanceOf[this.type]
}

/** Overridden here to apply `rule` to the keys as well as the child plan. */
override def transformExpressionsUp(
rule: PartialFunction[Expression, Expression]): this.type = {
KeyHint(newKeys.map(_.transformAttribute(rule.andThen(_.asInstanceOf[Attribute]))), child)
.asInstanceOf[this.type]
KeyHint(
newKeys.map(_.transformAttribute(rule.andThen(_.asInstanceOf[Attribute]))),
child.transformExpressionsUp(rule)).asInstanceOf[this.type]
}
}

0 comments on commit 5071759

Please sign in to comment.