spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yjshen <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-6212][SQL]The EXPLAIN output of CTAS on...
Date Thu, 06 Aug 2015 04:21:36 GMT
Github user yjshen commented on the pull request:

    https://github.com/apache/spark/pull/7986#issuecomment-128231658
  
    The reason for the bug:
    
    Give `EXPLAIN CREATE TABLE t1 SELECT * FROM exist_table` as an example.
    `ExplainCommand(CreateTableAsSelect)` is used internally to run the command:
    ```scala
    val queryExecution = sqlContext.executePlan(logicalPlan/*It is CreateTableAsSelect in
this case*/)
    val outputString = if (extended) queryExecution.toString else queryExecution.simpleString
    ```
    After analysing phase, createTableAsSelect was converted to another RunnableCommand, which
is a leaf operator by default:
    ``` scala
    private[sql] trait RunnableCommand extends LogicalPlan with logical.Command {
      override def children: Seq[LogicalPlan] = Seq.empty
    ```
    Therefore, no further optimisation or planning is feasible in this case.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message