How to generate code
df.queryExecution.debug.codegen
sqlContext.sql("explain codegen select * from table")