Skip to content

Commit aac13fb

Browse files
sarutakrxin
authored andcommitted
[SPARK-14185][SQL][MINOR] Make indentation of debug log for generated code proper
## What changes were proposed in this pull request? The indentation of debug log output by `CodeGenerator` is weird. The first line of the generated code should be put on the next line of the first line of the log message. ``` 16/03/28 11:10:24 DEBUG CodeGenerator: /* 001 */ /* 002 */ public java.lang.Object generate(Object[] references) { /* 003 */ return new SpecificSafeProjection(references); ... ``` After this patch is applied, we get debug log like as follows. ``` 16/03/28 10:45:50 DEBUG CodeGenerator: /* 001 */ /* 002 */ public java.lang.Object generate(Object[] references) { /* 003 */ return new SpecificSafeProjection(references); ... ``` ## How was this patch tested? Ran some jobs and checked debug logs. Author: Kousuke Saruta <[email protected]> Closes #11990 from sarutak/fix-debuglog-indentation.
1 parent 8ef4937 commit aac13fb

File tree

1 file changed

+1
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen

1 file changed

+1
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ object CodeGenerator extends Logging {
661661
logDebug({
662662
// Only add extra debugging info to byte code when we are going to print the source code.
663663
evaluator.setDebuggingInformation(true, true, false)
664-
formatted
664+
s"\n$formatted"
665665
})
666666

667667
try {

0 commit comments

Comments
 (0)