Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ case class ShowCreateTableExec(
s"'${escapeSingleQuotedString(key)}' = '${escapeSingleQuotedString(value)}'"
}

builder ++= "TBLPROPERTIES"
builder ++= "TBLPROPERTIES "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change related to Fix the behavior different with v1 command that about the TBLPROPERTIES?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Rright. Thank you for your review.

builder ++= concatByMultiLines(props)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,16 +843,6 @@ class FileSourceCharVarcharTestSuite extends CharVarcharTestSuite with SharedSpa
}
}

// TODO(SPARK-33898): Move these tests to super after SHOW CREATE TABLE for v2 implemented
test("SPARK-33892: SHOW CREATE TABLE w/ char/varchar") {
withTable("t") {
sql(s"CREATE TABLE t(v VARCHAR(3), c CHAR(5)) USING $format")
val rest = sql("SHOW CREATE TABLE t").head().getString(0)
assert(rest.contains("VARCHAR(3)"))
assert(rest.contains("CHAR(5)"))
}
}

test("SPARK-34114: should not trim right for read-side length check and char padding") {
Seq("char", "varchar").foreach { typ =>
withTempPath { dir =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ class DataSourceV2SQLSuite
"PARTITIONED BY (a)",
"COMMENT 'This is a comment'",
"LOCATION 'file:/tmp'",
"TBLPROPERTIES(",
"TBLPROPERTIES (",
"'prop1' = '1',",
"'prop2' = '2',",
"'prop3' = '3',",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ trait CharVarcharDDLTestBase extends QueryTest with SQLTestUtils {
Row("char(5)"))
}
}

test("SPARK-33892: SHOW CREATE TABLE w/ char/varchar") {
withTable("t") {
sql(s"CREATE TABLE t(v VARCHAR(3), c CHAR(5)) USING $format")
val rest = sql("SHOW CREATE TABLE t").head().getString(0)
assert(rest.contains("VARCHAR(3)"))
assert(rest.contains("CHAR(5)"))
}
}
}

class FileSourceCharVarcharDDLTestSuite extends CharVarcharDDLTestBase with SharedSparkSession {
Expand Down