Re: Tree for SQL Query

2016-08-24 Thread Reynold Xin
scala> sql("select rand() + 1").queryExecution.analyzed(0).expressions.head.treeString res11: String = "(rand(3296762545665822882) + cast(1 as double)) AS (rand(3296762545665822882) + CAST(1 AS DOUBLE))#29 +- (rand(3296762545665822882) + cast(1 as double)) :- rand(3296762545665822882) +- cast

Re: Tree for SQL Query

2016-08-24 Thread Maciej Bryński
@rxin It's not I'm looking for. Explain prints output like this. == Physical Plan == *Project [id#1576L AS id#1582L] +- *Range (0, 1000, splits=400) I'd like to have whole tree with expressions. So when I have "select x + y" there should by Add expresion etc. M. 2016-08-24 22:39 GMT+02:00 Reyno

Re: Tree for SQL Query

2016-08-24 Thread Reynold Xin
It's basically the output of the explain command. On Wed, Aug 24, 2016 at 12:31 PM, Maciej Bryński wrote: > Hi, > I read this article: > https://databricks.com/blog/2015/04/13/deep-dive-into- > spark-sqls-catalyst-optimizer.html > > And I have a question. Is it possible to get / print Tree for