Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/13068#discussion_r63100741
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala ---
@@ -941,6 +944,43 @@ class SparkSqlAstBuilder(conf: SQLConf) extends
AstBuilder {
}
/**
+ * Throw a [[ParseException]] if the user specified incompatible SerDes
through ROW FORMAT
+ * and STORED AS.
+ */
+ private def validateRowFormatFileFormat(
+ 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 (_, ffTable: TableFileFormatContext) =>
+ if (visitTableFileFormat(ffTable).serde.isDefined) {
+ throw operationNotAllowed(s"ROW FORMAT is not compatible with
$cff", parentCtx)
--- End diff --
Maybe we can be explicit that `SERDE` is not allowed for this case? btw,
should we remove `SERDE` part from `INPUTFORMAT inFmt=STRING OUTPUTFORMAT
outFmt=STRING (SERDE serdeCls=STRING)?` in `SqlBase.g4`?
---
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]