Skip to content

Commit

Permalink
[SPARK-15132][MINOR][SQL] Debug log for generated code should be prin…
Browse files Browse the repository at this point in the history
…ted with proper indentation

## What changes were proposed in this pull request?

Similar to apache#11990, GenerateOrdering and GenerateColumnAccessor should print debug log for generated code with proper indentation.

## How was this patch tested?

Manually checked.

Author: Kousuke Saruta <[email protected]>

Closes apache#12908 from sarutak/SPARK-15132.
  • Loading branch information
sarutak authored and rxin committed May 5, 2016
1 parent 4283741 commit 1a9b341
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object GenerateOrdering extends CodeGenerator[Seq[SortOrder], Ordering[InternalR
}
}"""

logDebug(s"Generated Ordering: ${CodeFormatter.format(code)}")
logDebug(s"Generated Ordering by ${ordering.mkString(",")}:\n${CodeFormatter.format(code)}")

CodeGenerator.compile(code).generate(ctx.references.toArray).asInstanceOf[BaseOrdering]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ object GenerateColumnAccessor extends CodeGenerator[Seq[DataType], ColumnarItera
}
}"""

logDebug(s"Generated ColumnarIterator: ${CodeFormatter.format(code)}")
logDebug(s"Generated ColumnarIterator:\n${CodeFormatter.format(code)}")

CodeGenerator.compile(code).generate(Array.empty).asInstanceOf[ColumnarIterator]
}
Expand Down

0 comments on commit 1a9b341

Please sign in to comment.