Repository: spark
Updated Branches:
refs/heads/master 8ef493760 -> aac13fb48
[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.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/aac13fb4
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/aac13fb4
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/aac13fb4
Branch: refs/heads/master
Commit: aac13fb48c8aa7d6816ea46c2e40154913477717
Parents: 8ef4937
Author: Kousuke Saruta <[email protected]>
Authored: Sun Mar 27 23:50:23 2016 -0700
Committer: Reynold Xin <[email protected]>
Committed: Sun Mar 27 23:50:23 2016 -0700
----------------------------------------------------------------------
.../spark/sql/catalyst/expressions/codegen/CodeGenerator.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/aac13fb4/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
----------------------------------------------------------------------
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
index b511b4b..cd490dd 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
@@ -661,7 +661,7 @@ object CodeGenerator extends Logging {
logDebug({
// Only add extra debugging info to byte code when we are going to print
the source code.
evaluator.setDebuggingInformation(true, true, false)
- formatted
+ s"\n$formatted"
})
try {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]