Skip to content

Conversation

pan3793
Copy link
Member

@pan3793 pan3793 commented Oct 2, 2025

What changes were proposed in this pull request?

Migrate error condition _LEGACY_ERROR_TEMP_3050 to existing CANNOT_MODIFY_STATIC_CONFIG.

Why are the changes needed?

More consistent error message.

Does this PR introduce any user-facing change?

More consistent error message.

How was this patch tested?

Pass GHA.

Was this patch authored or co-authored using generative AI tooling?

No.

@pan3793
Copy link
Member Author

pan3793 commented Oct 4, 2025

cc @MaxGekk

@pan3793
Copy link
Member Author

pan3793 commented Oct 11, 2025

cc @LuciferYang

throw new AnalysisException(
errorClass = "_LEGACY_ERROR_TEMP_3050",
messageParameters = Map("k" -> k))
throw CompilationErrors.cannotModifyValueOfStaticConfigError(k)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it necessary to direct users to refer to <docroot>/sql-migration-guide.html#ddl-statements here?

Copy link
Member Author

@pan3793 pan3793 Oct 13, 2025

Choose a reason for hiding this comment

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

@LuciferYang I think it might be because of

- Spark 2.4 and below: the `SET` command works without any warnings even if the specified key is for `SparkConf` entries and it has no effect because the command does not update `SparkConf`, but the behavior might confuse users. In 3.0, the command fails if a `SparkConf` key is used. You can disable such a check by setting `spark.sql.legacy.setCommandRejectsSparkCoreConfs` to `false`.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I see your point, here spark.sql.legacy.setCommandRejectsSparkCoreConfs does not take effect, so the docs do not help

def cannotModifyValueOfStaticConfigError(key: String): Throwable = {
new AnalysisException(
errorClass = "CANNOT_MODIFY_STATIC_CONFIG",
messageParameters = Map("key" -> toSQLConf(key)))
Copy link
Member Author

@pan3793 pan3793 Oct 13, 2025

Choose a reason for hiding this comment

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

@LuciferYang I updated the code to remove the doc link since <docroot>/sql-migration-guide.html#ddl-statements does not provide useful info for this error

Copy link
Contributor

@LuciferYang LuciferYang left a comment

Choose a reason for hiding this comment

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

+1, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants