Skip to content
Prev Previous commit
Next Next commit
Review feedback
  • Loading branch information
bersprockets committed Jan 2, 2019
commit b977d3e70ba59f537168a778533a6d1ff9a07a34
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ package object expressions {
*/
def toBoundExprs[A <: Expression](
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to minimize the chance that future changes suffer from the same issue. In order to do that we should provide API in a logical place, it does not make a whole lot of sense to me that I need to look in package.scala to find a more performant version of BindReferences.bindReference(..) for a seq. Can we move this function to BindReference and name it bindReferences?

exprs: Seq[A],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indent

inputSchema: Seq[Attribute]): Seq[A] = {
lazy val inputSchemaAttrSeq: AttributeSeq = inputSchema
exprs.map(BindReferences.bindReference(_, inputSchemaAttrSeq))
inputSchema: AttributeSeq): Seq[A] = {
exprs.map(BindReferences.bindReference(_, inputSchema))
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@ case class SortMergeJoinExec(
input: Seq[Attribute]): Seq[ExprCode] = {
ctx.INPUT_ROW = row
ctx.currentVars = null
val inputAttributeSeq: AttributeSeq = input
keys.map(BindReferences.bindReference(_, inputAttributeSeq).genCode(ctx))
toBoundExprs(keys, input).map(_.genCode(ctx))
}

private def copyKeys(ctx: CodegenContext, vars: Seq[ExprCode]): Seq[ExprCode] = {
Expand Down