leanken commented on a change in pull request #30705:
URL: https://github.com/apache/spark/pull/30705#discussion_r540636629
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
##########
@@ -2818,33 +2819,29 @@ class HiveDDLSuite
}.getMessage
assert(e.contains("Operation not allowed: CREATE TABLE LIKE ... USING
... STORED AS"))
- // row format works with STORED AS hive format (from hive table)
- spark.sql(
- """
- |CREATE TABLE targetHiveTable1 LIKE sourceHiveTable STORED AS PARQUET
- |ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
- |WITH SERDEPROPERTIES ('test' = 'test')
+ // row format incompatible with parquet format (from hive table)
Review comment:
removed
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -472,14 +472,21 @@ class SparkSqlAstBuilder extends AstBuilder {
checkDuplicateClauses(ctx.TBLPROPERTIES, "TBLPROPERTIES", ctx)
val provider =
ctx.tableProvider.asScala.headOption.map(_.multipartIdentifier.getText)
val location = visitLocationSpecList(ctx.locationSpec())
- // TODO: Do not skip serde check for CREATE TABLE LIKE.
val serdeInfo = getSerdeInfo(
- ctx.rowFormat.asScala.toSeq, ctx.createFileFormat.asScala.toSeq, ctx,
skipCheck = true)
+ ctx.rowFormat.asScala.toSeq, ctx.createFileFormat.asScala.toSeq, ctx)
if (provider.isDefined && serdeInfo.isDefined) {
operationNotAllowed(s"CREATE TABLE LIKE ... USING ...
${serdeInfo.get.describe}", ctx)
}
- // TODO: remove this restriction as it seems unnecessary.
+ // "CREATE TABLE dst LIKE src ROW FORMAT SERDE 'xxx.xxx.SerdeClass'"
+ // The behavior of above SQL in Hive will just ignore the ROW FORMAT
definition,
+ // and use SerdeInfo from src table instead.
Review comment:
done
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -472,14 +472,21 @@ class SparkSqlAstBuilder extends AstBuilder {
checkDuplicateClauses(ctx.TBLPROPERTIES, "TBLPROPERTIES", ctx)
val provider =
ctx.tableProvider.asScala.headOption.map(_.multipartIdentifier.getText)
val location = visitLocationSpecList(ctx.locationSpec())
- // TODO: Do not skip serde check for CREATE TABLE LIKE.
val serdeInfo = getSerdeInfo(
Review comment:
done
----------------------------------------------------------------
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]