Under CarbonSession class function withProfiler called qe.assertAnalyzed().
this function called spark sql function assertAnalyzed.
But under Dataset class queryExecution.assertAnalyzed() did another function
Why call assertAnalyzed function twice？
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
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