Commit d5bcdd4
[SPARK-51269][SQL] Simplify AvroCompressionCodec by removing defaultCompressionLevel
### What changes were proposed in this pull request?
This PR proposes to let SQLConf manage the default value for avro compression level.
### Why are the changes needed?
Currently, the default value of `spark.sql.avro.deflate.level` is -1. But it managed with the enum `AvroCompressionCodec`.
The document of the config item `spark.sql.avro.deflate.level` contains the description `The default value is -1 which corresponds to 6 level in the current implementation.` So the users get the knowledge that it has the default value -1.
If some developer use the config item in mistake, there is no guarantee for the default value. And then causes some unpredictable behavior and make users confused.
I think we should keep the default value within `SQLConf` in safety.
Some other config item has the same confusion, `spark.sql.avro.xz.level` and `spark.sql.avro.zstandard.level`.
### Does this PR introduce _any_ user-facing change?
'No'.
New feature.
### How was this patch tested?
GA.
### Was this patch authored or co-authored using generative AI tooling?
'No'.
Closes #50021 from beliefer/SPARK-51269.
Lead-authored-by: beliefer <beliefer@163.com>
Co-authored-by: Kent Yao <yao@apache.org>
Signed-off-by: beliefer <beliefer@163.com>
(cherry picked from commit ef4cd39)
Signed-off-by: beliefer <beliefer@163.com>1 parent c1d0aed commit d5bcdd4
File tree
3 files changed
+27
-32
lines changed- sql
- catalyst/src/main/scala/org/apache/spark/sql/internal
- core/src/main
- java/org/apache/spark/sql/avro
- scala/org/apache/spark/sql/avro
3 files changed
+27
-32
lines changedLines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
4210 | 4210 | | |
4211 | 4211 | | |
4212 | 4212 | | |
4213 | | - | |
4214 | | - | |
| 4213 | + | |
| 4214 | + | |
4215 | 4215 | | |
4216 | 4216 | | |
4217 | 4217 | | |
| |||
4220 | 4220 | | |
4221 | 4221 | | |
4222 | 4222 | | |
4223 | | - | |
| 4223 | + | |
4224 | 4224 | | |
4225 | 4225 | | |
4226 | | - | |
4227 | | - | |
| 4226 | + | |
4228 | 4227 | | |
4229 | 4228 | | |
4230 | | - | |
| 4229 | + | |
4231 | 4230 | | |
4232 | 4231 | | |
4233 | 4232 | | |
| |||
Lines changed: 8 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
| |||
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | | - | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
0 commit comments