You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by litao <li...@126.com> on 2019/02/13 12:18:10 UTC

【Questions about code】

question:
Under CarbonSession class function withProfiler called qe.assertAnalyzed().
this function called spark sql function assertAnalyzed.
But under Dataset class queryExecution.assertAnalyzed() did another function
call。
Why call assertAnalyzed function twice?



--
Sent from: http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/

Re: 【Questions about code】

Posted by akashrn5 <ak...@gmail.com>.
Hi litao,

sparkSql function calls withprofiler function method
and whenever the queryExecution object and SQLStart is made, this will call
the generateDF function, which creates the new DataSet object.

So once the queryExecution object is made from logical plan, we call
assertAnalyzed() which executes analyzed(refer dataset class in spark, it is
a lazy variable, it will get called when assertAnalyzed is called) by
accessing it and throwing the result away. Since analyzed is a lazy value in
Scala, it will then get initialized for the first time and stays so forever.

basically assertAnalyzed analyzes the rules present in Analyzer and mark the
plan as Analyzed. Since it is lazy, only once evaluation happens and result
is stored. 

So As i said, it will create new dataset once QE object is got, again
assertAnalyzed is called, but evaluation does not happens.


I hope you i have given complete explaination. Please reply if you have
doubt



--
Sent from: http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/