GitHub user ericl opened a pull request:
https://github.com/apache/spark/pull/12025
[SPARK-14227] [SQL] Add method for printing out generated code for debugging
## What changes were proposed in this pull request?
This adds `debugCodegen` to the debug package for query execution.
## How was this patch tested?
Unit and manual testing. Output example:
```
scala>
sqlContext.range(100).groupBy("id").count().orderBy("id").debugCodegen().toString
Found 3 WholeStageCodegen subtrees.
== Subtree 1 / 3 ==
WholeStageCodegen
: +- TungstenAggregate(key=[id#42L],
functions=[(count(1),mode=Final,isDistinct=false)], output=[id#42L,count#46L])
: +- INPUT
+- Exchange hashpartitioning(id#42L, 200), None
+- WholeStageCodegen
: +- TungstenAggregate(key=[id#42L],
functions=[(count(1),mode=Partial,isDistinct=false)], output=[id#42L,count#51L])
: +- Range 0, 1, 1, 100, [id#42L]
Generated code:
/* 001 */ public Object generate(Object[] references) {
/* 002 */ return new GeneratedIterator(references);
/* 003 */ }
/* 004 */
```
@rxin
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ericl/spark spark-14227
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12025.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12025
----
commit da873835dc430bbc119180f2b29b6e0959456b61
Author: Eric Liang <[email protected]>
Date: 2016-03-29T02:58:39Z
Mon Mar 28 19:58:39 PDT 2016
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]