You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2022/10/15 17:35:15 UTC
[spark] branch master updated: [SPARK-40806][SQL] Typo fix: CREATE TABLE -> REPLACE TABLE
This is an automated email from the ASF dual-hosted git repository.
maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new ee59f4e149d [SPARK-40806][SQL] Typo fix: CREATE TABLE -> REPLACE TABLE
ee59f4e149d is described below
commit ee59f4e149d9f1fc849eef62a6ed914b97ceed46
Author: panbingkun <pb...@gmail.com>
AuthorDate: Sat Oct 15 20:34:56 2022 +0300
[SPARK-40806][SQL] Typo fix: CREATE TABLE -> REPLACE TABLE
### What changes were proposed in this pull request?
The pr aim to typo fix: CREATE TABLE -> REPLACE TABLE in AstBuilder.
### Why are the changes needed?
When i work on [SPARK-40784](https://issues.apache.org/jira/browse/SPARK-40784), i found this issue.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existed UT.
Closes #38269 from panbingkun/SPARK-40806.
Authored-by: panbingkun <pb...@gmail.com>
Signed-off-by: Max Gekk <ma...@gmail.com>
---
.../apache/spark/sql/catalyst/parser/AstBuilder.scala | 2 +-
.../spark/sql/catalyst/parser/DDLParserSuite.scala | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
index 01ba83d3f84..eca7bbe3e29 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
@@ -3776,7 +3776,7 @@ class AstBuilder extends SqlBaseParserBaseVisitor[AnyRef] with SQLConfHelper wit
val provider = Option(ctx.tableProvider).map(_.multipartIdentifier.getText)
if (provider.isDefined && serdeInfo.isDefined) {
- operationNotAllowed(s"CREATE TABLE ... USING ... ${serdeInfo.get.describe}", ctx)
+ operationNotAllowed(s"REPLACE TABLE ... USING ... ${serdeInfo.get.describe}", ctx)
}
val partitioning =
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala
index ba2cc4ff15e..a9376121b68 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala
@@ -501,10 +501,10 @@ class DDLParserSuite extends AnalysisTest {
|USING parquet
|STORED AS parquet
""".stripMargin
+ assertUnsupported(createSql, Seq("CREATE TABLE ... USING ... STORED AS"))
+
val replaceSql = createSql.replaceFirst("CREATE", "REPLACE")
- Seq(createSql, replaceSql).foreach { sql =>
- assertUnsupported(sql, Seq("CREATE TABLE ... USING ... STORED AS"))
- }
+ assertUnsupported(replaceSql, Seq("REPLACE TABLE ... USING ... STORED AS"))
}
test("create/replace table - using with row format serde") {
@@ -513,10 +513,10 @@ class DDLParserSuite extends AnalysisTest {
|USING parquet
|ROW FORMAT SERDE 'customSerde'
""".stripMargin
+ assertUnsupported(createSql, Seq("CREATE TABLE ... USING ... ROW FORMAT SERDE"))
+
val replaceSql = createSql.replaceFirst("CREATE", "REPLACE")
- Seq(createSql, replaceSql).foreach { sql =>
- assertUnsupported(sql, Seq("CREATE TABLE ... USING ... ROW FORMAT SERDE"))
- }
+ assertUnsupported(replaceSql, Seq("REPLACE TABLE ... USING ... ROW FORMAT SERDE"))
}
test("create/replace table - using with row format delimited") {
@@ -525,10 +525,10 @@ class DDLParserSuite extends AnalysisTest {
|USING parquet
|ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
""".stripMargin
+ assertUnsupported(createSql, Seq("CREATE TABLE ... USING ... ROW FORMAT DELIMITED"))
+
val replaceSql = createSql.replaceFirst("CREATE", "REPLACE")
- Seq(createSql, replaceSql).foreach { sql =>
- assertUnsupported(sql, Seq("CREATE TABLE ... USING ... ROW FORMAT DELIMITED"))
- }
+ assertUnsupported(replaceSql, Seq("REPLACE TABLE ... USING ... ROW FORMAT DELIMITED"))
}
test("create/replace table - stored by") {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org