[SPARK-36552][SQL] Fix different behavior for writing char/varchar to hive and datasource table#33798
[SPARK-36552][SQL] Fix different behavior for writing char/varchar to hive and datasource table#33798yaooqinn wants to merge 2 commits intoapache:masterfrom
Conversation
… hive and datasource table
|
cc @cloud-fan @HyukjinKwon @maropu thanks |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #142670 has finished for PR 33798 at commit
|
|
Test build #142680 has finished for PR 33798 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
retest this please |
|
Test build #142681 has finished for PR 33798 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Merged to master and branch-3.2. |
… hive and datasource table ### What changes were proposed in this pull request? For the hive table, the actual write path and the schema handling are inconsistent when `spark.sql.legacy.charVarcharAsString` is true. This causes problems like SPARK-36552 described. In this PR we respect `spark.sql.legacy.charVarcharAsString` when generates hive table schema from spark data types. ### Why are the changes needed? bugfix ### Does this PR introduce _any_ user-facing change? yes, when `spark.sql.legacy.charVarcharAsString` is true, hive table with char/varchar will respect string behavior. ### How was this patch tested? newly added test Closes #33798 from yaooqinn/SPARK-36552. Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org> (cherry picked from commit f918c12) Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
What changes were proposed in this pull request?
For the hive table, the actual write path and the schema handling are inconsistent when
spark.sql.legacy.charVarcharAsStringis true.This causes problems like SPARK-36552 described.
In this PR we respect
spark.sql.legacy.charVarcharAsStringwhen generates hive table schema from spark data types.Why are the changes needed?
bugfix
Does this PR introduce any user-facing change?
yes, when
spark.sql.legacy.charVarcharAsStringis true, hive table with char/varchar will respect string behavior.How was this patch tested?
newly added test