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-37013][SQL][FOLLOWUP] Add legacy flag for the breaking change of forbidding %0$ usage in format_string #36101

Closed
wants to merge 1 commit into from

Conversation

anchovYu
Copy link
Contributor

@anchovYu anchovYu commented Apr 7, 2022

What changes were proposed in this pull request?

Adds a legacy flag spark.sql.legacy.allowZeroIndexInFormatString for the breaking change introduced in #34313 and #34454 (followup).

The flag is disabled by default. But when it is enabled, restore the pre-change behavior that allows the 0 based index in format_string.

Why are the changes needed?

The original commit is a breaking change, and breaking changes should be encouraged to add a flag to turn it off for smooth migration between versions.

Does this PR introduce any user-facing change?

With the default value of the conf, there is no user-facing difference.
If users turn this conf on, they can restore the pre-change behavior.

How was this patch tested?

Through unit tests.

@github-actions github-actions bot added the SQL label Apr 7, 2022
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@anchovYu anchovYu marked this pull request as ready for review April 8, 2022 00:05
@anchovYu
Copy link
Contributor Author

anchovYu commented Apr 8, 2022

@LuciferYang @cloud-fan Would you take a look? Thank you!

@anchovYu anchovYu changed the title [WIP][SPARK-37013][SQL][FOLLOWUP] Add legacy flag for the breaking change of forbidding %0$ usage in format_string [SPARK-37013][SQL][FOLLOWUP] Add legacy flag for the breaking change of forbidding %0$ usage in format_string Apr 8, 2022
@cloud-fan
Copy link
Contributor

thanks, merging to master/3.3!

@cloud-fan cloud-fan closed this in b7af2b3 Apr 8, 2022
cloud-fan pushed a commit that referenced this pull request Apr 8, 2022
…of forbidding %0$ usage in format_string

### What changes were proposed in this pull request?
Adds a legacy flag `spark.sql.legacy.allowZeroIndexInFormatString` for the breaking change introduced in #34313 and #34454 (followup).

The flag is disabled by default. But when it is enabled, restore the pre-change behavior that allows the 0 based index in `format_string`.

### Why are the changes needed?
The original commit is a breaking change, and breaking changes should be encouraged to add a flag to turn it off for smooth migration between versions.

### Does this PR introduce _any_ user-facing change?
With the default value of the conf, there is no user-facing difference.
If users turn this conf on, they can restore the pre-change behavior.

### How was this patch tested?
Through unit tests.

Closes #36101 from anchovYu/flags-format-string-java.

Authored-by: Xinyi Yu <xinyi.yu@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit b7af2b3)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@LuciferYang
Copy link
Contributor

LGTM + 1

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