Skip to content
Snippets Groups Projects
Commit 1a9b3415 authored by Kousuke Saruta's avatar Kousuke Saruta Committed by Reynold Xin
Browse files

[SPARK-15132][MINOR][SQL] Debug log for generated code should be printed with proper indentation

## What changes were proposed in this pull request?

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

## How was this patch tested?

Manually checked.

Author: Kousuke Saruta <sarutak@oss.nttdata.co.jp>

Closes #12908 from sarutak/SPARK-15132.
parent 42837419
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,7 @@ object GenerateOrdering extends CodeGenerator[Seq[SortOrder], Ordering[InternalR ...@@ -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] CodeGenerator.compile(code).generate(ctx.references.toArray).asInstanceOf[BaseOrdering]
} }
......
...@@ -224,7 +224,7 @@ object GenerateColumnAccessor extends CodeGenerator[Seq[DataType], ColumnarItera ...@@ -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] CodeGenerator.compile(code).generate(Array.empty).asInstanceOf[ColumnarIterator]
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment