StefanXiepj commented on a change in pull request #13068:
URL: https://github.com/apache/spark/pull/13068#discussion_r518054657
##########
File path:
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)
Review comment:
Why don't we support this? What's the problem? Can you give me an
example? thx
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]