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

    https://github.com/apache/spark/pull/10723#discussion_r51018980
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkQl.scala ---
    @@ -42,6 +45,95 @@ private[sql] class SparkQl(conf: ParserConf = 
SimpleParserConf()) extends Cataly
               getClauses(Seq("TOK_QUERY", "FORMATTED", "EXTENDED"), 
explainArgs)
             ExplainCommand(nodeToPlan(query), extended = extended.isDefined)
     
    +      case Token("TOK_REFRESHTABLE", nameParts :: Nil) =>
    +        val tableIdent = extractTableIdent(nameParts)
    +        RefreshTable(tableIdent)
    +
    +      case Token("TOK_CREATETABLEUSING", createTableArgs) =>
    +        val Seq(
    +          temp,
    +          allowExisting,
    +          Some(tabName),
    +          tableCols,
    +          Some(Token("TOK_TABLEPROVIDER", providerNameParts)),
    +          tableOpts,
    +          tableAs) = getClauses(Seq(
    +          "TEMPORARY",
    +          "TOK_IFNOTEXISTS",
    +          "TOK_TABNAME", "TOK_TABCOLLIST",
    +          "TOK_TABLEPROVIDER",
    +          "TOK_TABLEOPTIONS",
    +          "TOK_QUERY"), createTableArgs)
    +
    +        val tableIdent: TableIdentifier = tabName match {
    +          case Token("TOK_TABNAME", Token(dbName, Nil) :: Token(tableName, 
Nil) :: Nil) =>
    +            new TableIdentifier(cleanIdentifier(tableName), 
Some(cleanIdentifier(dbName)))
    +          case Token("TOK_TABNAME", Token(tableName, Nil) :: Nil) =>
    +            TableIdentifier(cleanIdentifier(tableName))
    +        }
    +
    +        val columns = tableCols.map {
    +          case Token("TOK_TABCOLLIST", fields) => 
StructType(fields.map(nodeToStructField))
    +        }
    +
    +        val provider = providerNameParts.map {
    +          case Token(name, Nil) => name
    +        }.mkString(".")
    +
    +        val options = tableOpts.map { opts =>
    +          opts match {
    +            case Token("TOK_TABLEOPTIONS", options) =>
    +              options.map {
    +                case Token("TOK_TABLEOPTION", keysAndValue) =>
    --- End diff --
    
    Nevermind. The name can have multiple parts. We could try to solve this in 
the lexer (make it one name again).


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to