spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liancheng <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-14038][SQL] enable native view by defau...
Date Mon, 21 Mar 2016 14:55:35 GMT
Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11860#discussion_r56835294
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateViewAsSelect.scala
---
    @@ -73,15 +68,18 @@ private[hive] case class CreateViewAsSelect(
       }
     
       private def prepareTable(sqlContext: SQLContext): CatalogTable = {
    -    val expandedText = if (sqlContext.conf.canonicalView) {
    -      try rebuildViewQueryString(sqlContext) catch {
    -        case NonFatal(e) => wrapViewTextWithSelect
    -      }
    +    val logicalPlan = if (tableDesc.schema.isEmpty) {
    +      child
         } else {
    -      wrapViewTextWithSelect
    +      val projectList = childSchema.zip(tableDesc.schema).map {
    +        case (attr, col) => Alias(attr, col.name)()
    +      }
    +      sqlContext.executePlan(Project(projectList, child)).analyzed
         }
     
    -    val viewSchema = {
    +    val viewText = new SQLBuilder(logicalPlan, sqlContext).toSQL
    --- End diff --
    
    How about catching exceptions thrown from `toSQL` and suggest the user to turn off native
view and retry?


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