Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Or committed May 12, 2016
1 parent bc2a7bd commit 4ffaf59
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -951,12 +951,13 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder {
rowFormatCtx: RowFormatContext,
createFileFormatCtx: CreateFileFormatContext,
parentCtx: ParserRuleContext): Unit = {
if (rowFormatCtx == null || createFileFormatCtx == null) {
return
}
val cff = (0 until createFileFormatCtx.getChildCount)
.map { i => createFileFormatCtx.getChild(i).getText }
.mkString(" ")
(rowFormatCtx, createFileFormatCtx.fileFormat) match {
case (rf, null) => // only row format, no conflict
case (null, ff) => // only file format, no conflict
case (_, ffTable: TableFileFormatContext) =>
if (visitTableFileFormat(ffTable).serde.isDefined) {
throw operationNotAllowed(s"ROW FORMAT is not compatible with $cff", parentCtx)
Expand Down

0 comments on commit 4ffaf59

Please sign in to comment.