cloud-fan commented on code in PR #38151:
URL: https://github.com/apache/spark/pull/38151#discussion_r992322820
##########
sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala:
##########
@@ -830,14 +828,12 @@ class FileSourceCharVarcharTestSuite extends
CharVarcharTestSuite with SharedSpa
}
test("alter table set location w/ fit length values") {
- Seq("char", "varchar").foreach { typ =>
- withTempPath { dir =>
- withTable("t") {
- sql("SELECT '12' as col").write.format(format).save(dir.toString)
- sql(s"CREATE TABLE t (col $typ(2)) using $format")
- sql(s"ALTER TABLE t SET LOCATION '$dir'")
- checkAnswer(spark.table("t"), Row("12"))
- }
+ withTempPath { dir =>
+ withTable("t") {
+ sql("SELECT '12' as col1, '12' as
col2").write.format(format).save(dir.toString)
+ sql(s"CREATE TABLE t (col1 char(3), col2 varchar(3)) using $format")
+ sql(s"ALTER TABLE t SET LOCATION '$dir'")
+ checkAnswer(spark.table("t"), Row("12 ", "12"))
Review Comment:
@yaooqinn I think this test covers the behavior change you mentioned? And
I'd treat it as a bug fix, as the previous result didn't follow CHAR type
semantic.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]