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

    https://github.com/apache/spark/pull/8990#discussion_r41300835
  
    --- 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 --
    
    Although it is not idea, let's use null for now. Let's add comments to here 
to explain that we will fix the type after the analysis phase. Also, let's add 
comments to HiveTable to explain that the type string is nullable.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to