Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-51269][SQL] SQLConf should manage the default value for avro compression level #50021

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beliefer
Copy link
Contributor

@beliefer beliefer commented Feb 20, 2025

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'.

@github-actions github-actions bot added the SQL label Feb 20, 2025
@beliefer
Copy link
Contributor Author

beliefer commented Feb 20, 2025

ping @yaooqinn cc @dongjoon-hyun @LuciferYang

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

Could you elaborate on this a little more, @beliefer ?

If developers use the config item in any other code path, there is no guarantee for the default value.

@yaooqinn
Copy link
Member

Sorry, I don't quite understand what are we going to change.

@beliefer
Copy link
Contributor Author

Could you elaborate on this a little more, @beliefer ?

Updated.

@beliefer
Copy link
Contributor Author

Sorry, I don't quite understand what are we going to change.

Please take a look again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants