Re: [SQL] Understanding RewriteCorrelatedScalarSubquery optimization (and TreeNode.transform)

2018-05-28 Thread Jacek Laskowski
Thanks Herman! You've helped me a lot (and am going to use your fine explanation in my gitbook quoting when needed! :)) p.s. I also found this today that helped me too --> https://databricks-prod-cloudfront.cloud.databricks.com/public/4027ec902e239c93eaaa8714f173bcfc/2728434780191932/1483312212640

[SQL] Understanding RewriteCorrelatedScalarSubquery optimization (and TreeNode.transform)

2018-05-27 Thread Jacek Laskowski
Hi, I'm trying to understand RewriteCorrelatedScalarSubquery optimization and how extractCorrelatedScalarSubqueries [1] works. I don't understand how "The expression is rewritten and returned." is done. How is the expression rewritten? Since it's private it's not even possible to write tests and