You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by maropu <gi...@git.apache.org> on 2017/07/03 03:42:46 UTC

[GitHub] spark pull request #17758: [SPARK-20460][SPARK-21144][SQL] Make it more cons...

Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17758#discussion_r125205813
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala ---
    @@ -123,28 +122,19 @@ case class CreateViewCommand(
       }
     
       override def run(sparkSession: SparkSession): Seq[Row] = {
    -    // If the plan cannot be analyzed, throw an exception and don't proceed.
    -    val qe = sparkSession.sessionState.executePlan(child)
    -    qe.assertAnalyzed()
    -    val analyzedPlan = qe.analyzed
    -
         if (userSpecifiedColumns.nonEmpty &&
    -        userSpecifiedColumns.length != analyzedPlan.output.length) {
    +        userSpecifiedColumns.length != child.output.length) {
           throw new AnalysisException(s"The number of columns produced by the SELECT clause " +
    -        s"(num: `${analyzedPlan.output.length}`) does not match the number of column names " +
    +        s"(num: `${child.output.length}`) does not match the number of column names " +
             s"specified by CREATE VIEW (num: `${userSpecifiedColumns.length}`).")
         }
     
    -    // When creating a permanent view, not allowed to reference temporary objects.
    -    // This should be called after `qe.assertAnalyzed()` (i.e., `child` can be resolved)
    -    verifyTemporaryObjectsNotExists(sparkSession)
    --- End diff --
    
    I moved `verifyTemporaryObjectsNotExists` to `rules` because `qe.assertAnalyzed()` is called in `rules` and a resolved plan is passed here.


---
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