Skip to content

Commit

Permalink
rebase errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dilipbiswal committed Jul 28, 2018
1 parent aa3ce4a commit 67b15ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ object TypeCoercion {
assert(newChildren.length == 2)
Except(newChildren.head, newChildren.last, isAll)

case s @ Intersect(left, right) if s.childrenResolved &&
case s @ Intersect(left, right, isAll) if s.childrenResolved &&
left.output.length == right.output.length && !s.resolved =>
val newChildren: Seq[LogicalPlan] = buildNewChildrenWithWiderTypes(left :: right :: Nil)
assert(newChildren.length == 2)
Intersect(newChildren.head, newChildren.last)
Intersect(newChildren.head, newChildren.last, isAll)

case s: Union if s.childrenResolved &&
s.children.forall(_.output.length == s.children.head.output.length) && !s.resolved =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,32 +249,6 @@ case class ReplicateRows(children: Seq[Expression]) extends Generator with Codeg
}
}

/**
* Replicate the row N times. N is specified as the first argument to the function.
* This is an internal function solely used by optimizer to rewrite EXCEPT ALL AND
* INTERSECT ALL queries.
*/
case class ReplicateRows(children: Seq[Expression]) extends Generator with CodegenFallback {
private lazy val numColumns = children.length - 1 // remove the multiplier value from output.

override def elementSchema: StructType =
StructType(children.tail.zipWithIndex.map {
case (e, index) => StructField(s"col$index", e.dataType)
})

override def eval(input: InternalRow): TraversableOnce[InternalRow] = {
val numRows = children.head.eval(input).asInstanceOf[Long]
val values = children.tail.map(_.eval(input)).toArray
Range.Long(0, numRows, 1).map { _ =>
val fields = new Array[Any](numColumns)
for (col <- 0 until numColumns) {
fields.update(col, values(col))
}
InternalRow(fields: _*)
}
}
}

/**
* Wrapper around another generator to specify outer behavior. This is used to implement functions
* such as explode_outer. This expression gets replaced during analysis.
Expand Down

0 comments on commit 67b15ee

Please sign in to comment.