code: def explain(self, extended=False):
          
          if extended:
              print(self._jdf.queryExecution().toString())
          else:
              print(self._jdf.queryExecution().simpleString())
docs: Prints the (logical and physical) plans to the console for debugging purpose.
  
          :param extended: boolean, default ``False``. If ``False``, prints only the physical plan.
  
          >>> df.explain()
          == Physical Plan ==
          *(1) Scan ExistingRDD[age#0,name#1]
  
          >>> df.explain(True)
          == Parsed Logical Plan ==
          ...
          == Analyzed Logical Plan ==
          ...
          == Optimized Logical Plan ==
          ...
          == Physical Plan ==
          ...