Skip to content

Commit

Permalink
Fix tests by binding attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Jul 7, 2015
1 parent 0a79d39 commit f27be09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ case class UnsafeExternalSort(
assert(codegenEnabled, "UnsafeExternalSort requires code generation to be enabled")
def doSort(iterator: Iterator[InternalRow]): Iterator[InternalRow] = {
val ordering = newOrdering(sortOrder, child.output)
val prefixComparator = SortPrefixUtils.getPrefixComparator(sortOrder.head)
val boundSortExpression = BindReferences.bindReference(sortOrder.head, child.output)
val prefixComparator = SortPrefixUtils.getPrefixComparator(boundSortExpression)
val prefixComputer = {
val prefixComputer = SortPrefixUtils.getPrefixComputer(sortOrder.head)
val prefixComputer = SortPrefixUtils.getPrefixComputer(boundSortExpression)
new UnsafeExternalRowSorter.PrefixComputer {
override def computePrefix(row: InternalRow): Long = prefixComputer(row)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import org.apache.spark.sql.catalyst.dsl.expressions._
import org.apache.spark.sql.test.TestSQLContext
import org.apache.spark.sql.types._


class UnsafeExternalSortSuite extends SparkPlanTest with BeforeAndAfterAll {

override def beforeAll(): Unit = {
Expand Down

0 comments on commit f27be09

Please sign in to comment.