From 9d4a1a525aa9dbe55623b0b1238ce680fe4df0b5 Mon Sep 17 00:00:00 2001 From: Wenchen Fan Date: Tue, 9 Apr 2024 23:38:17 +0800 Subject: [PATCH] [Spark] do not hardcode the default conf value of READ_SIDE_CHAR_PADDING (#2861) #### Which Delta project/connector is this regarding? - [x] Spark - [ ] Standalone - [ ] Flink - [ ] Kernel - [ ] Other (fill in here) ## Description In `WriteIntoDelta.scala`, there is a small mistake that we hardcode the default value of `SQLConf.READ_SIDE_CHAR_PADDING` to be `false`, instead of respecting the config definition. ## How was this patch tested? existing test. ## Does this PR introduce _any_ user-facing changes? no --- .../org/apache/spark/sql/delta/commands/WriteIntoDelta.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spark/src/main/scala/org/apache/spark/sql/delta/commands/WriteIntoDelta.scala b/spark/src/main/scala/org/apache/spark/sql/delta/commands/WriteIntoDelta.scala index c6251298309..9c2505aeed9 100644 --- a/spark/src/main/scala/org/apache/spark/sql/delta/commands/WriteIntoDelta.scala +++ b/spark/src/main/scala/org/apache/spark/sql/delta/commands/WriteIntoDelta.scala @@ -143,7 +143,7 @@ case class WriteIntoDelta( clusterBySpecOpt } val rearrangeOnly = options.rearrangeOnly - val charPadding = sparkSession.conf.get(SQLConf.READ_SIDE_CHAR_PADDING.key, "false") == "true" + val charPadding = sparkSession.conf.get(SQLConf.READ_SIDE_CHAR_PADDING) val charAsVarchar = sparkSession.conf.get(SQLConf.CHAR_AS_VARCHAR) val dataSchema = if (!charAsVarchar && charPadding) { data.schema