spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-10337][SQL] fix hive views on non-hive-...
Date Tue, 06 Oct 2015 17:29:21 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8990#discussion_r41295186
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala ---
    @@ -563,6 +580,77 @@ https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C
             }
           }
     
    +     case view @ Token("TOK_CREATEVIEW", children)
    +        if children.collect { case t @ Token("TOK_QUERY", _) => t }.nonEmpty =>
    +
    +      val Seq(
    +        Some(viewNameParts),
    +        Some(query),
    +        maybeComment,
    +        allowExisting,
    +        maybeProperties,
    +        maybeColumns,
    +        maybePartCols
    +      ) = getClauses(
    +        Seq(
    +          "TOK_TABNAME",
    +          "TOK_QUERY",
    +          "TOK_TABLECOMMENT",
    +          "TOK_IFNOTEXISTS",
    +          "TOK_TABLEPROPERTIES",
    +          "TOK_TABCOLNAME",
    +          "TOK_VIEWPARTCOLS"),
    +        children)
    +
    +      // If the view is partitioned, we let hive handle it.
    +      if (maybePartCols.isDefined) {
    +        NativePlaceholder
    +      } else {
    +        val (db, viewName) = extractDbNameTableName(viewNameParts)
    +
    +        val originalText = context.getTokenRewriteStream
    +          .toString(query.getTokenStartIndex, query.getTokenStopIndex)
    +
    +        val schema = maybeColumns.map { cols =>
    +          BaseSemanticAnalyzer.getColumns(cols, true).asScala.map { field =>
    +            HiveColumn(field.getName, field.getType, field.getComment)
    --- End diff --
    
    Hive only support specify column name and comment, see https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateView


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