Skip to content

Commit

Permalink
Address more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lw-lin committed Nov 5, 2016
1 parent 1ae9935 commit 33b5fd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ class CodegenContext {
val funcCode: String =
s"""
public int $compareFunc(InternalRow a, InternalRow b) {
InternalRow i = null;
$comparisons
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,7 @@ object GenerateOrdering extends CodeGenerator[Seq[SortOrder], Ordering[InternalR
val numberOfComparisonsThreshold = 40

if (ordering.size <= numberOfComparisonsThreshold) {
s"""
| InternalRow ${ctx.INPUT_ROW} = null; // Holds current row being evaluated.
| ${comparisons(ordering)}
""".stripMargin
comparisons(ordering)
} else {
val groupedOrderingItr = ordering.grouped(numberOfComparisonsThreshold)
val funcNamePrefix = ctx.freshName("compare")
Expand Down Expand Up @@ -180,6 +177,7 @@ object GenerateOrdering extends CodeGenerator[Seq[SortOrder], Ordering[InternalR
${ctx.declareAddedFunctions()}

public int compare(InternalRow a, InternalRow b) {
InternalRow ${ctx.INPUT_ROW} = null; // Holds current row being evaluated.
$comparisons
return 0;
}
Expand Down

0 comments on commit 33b5fd8

Please sign in to comment.