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

    https://github.com/apache/spark/pull/14071#discussion_r69796816
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala ---
    @@ -1050,19 +1032,38 @@ class SparkSqlAstBuilder(conf: SQLConf) extends 
AstBuilder {
       }
     
       /**
    -   * Create a [[CatalogStorageFormat]] for creating tables.
    +   * Parse the `createFileFormat` and put the storage information into the 
passed in map.
        *
    -   * Format: STORED AS ...
    +   * Example format:
    +   * {{{
    +   *   STORED AS INPUTFORMAT formatName1 OUTPUTFORMAT formatName2
    +   * }}}
    +   *
    +   * OR
    +   *
    +   * {{{
    +   *   STORED AS fileFormatName
    +   * }}}
        */
    -  override def visitCreateFileFormat(
    -      ctx: CreateFileFormatContext): CatalogStorageFormat = 
withOrigin(ctx) {
    +  private def getFileFormat(
    +      ctx: CreateFileFormatContext,
    +      storageProps: mutable.HashMap[String, String]): Unit = {
         (ctx.fileFormat, ctx.storageHandler) match {
           // Expected format: INPUTFORMAT input_format OUTPUTFORMAT 
output_format
           case (c: TableFileFormatContext, null) =>
    -        visitTableFileFormat(c)
    +        Option(string(c.inFmt)).foreach(inFmt => storageProps += 
"inputFormat" -> inFmt)
    --- End diff --
    
    `storageProps += "inputFormat" -> string(c.inFmt)`? `string(c.inFmt)` 
throws an NPE if it is null; so option is redundant...


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