Skip to content

fix: validate time_format at SET time - #27986

Open
Yubinghan1 wants to merge 1 commit into
apache:mainfrom
Yubinghan1:fix/validate-time-format
Open

Yubinghan1 wants to merge 1 commit into
apache:mainfrom
Yubinghan1:fix/validate-time-format

Conversation

@Yubinghan1

Copy link
Copy Markdown

Which issue does this PR close?

Part of #17498. This covers datafusion.format.time_format.

Rationale for this change

SET datafusion.format.time_format = '%Y' succeeds today, even though a time of day has no year. The error only shows up when the CLI tries to print a result.

What changes are included in this PR?

Reuse the display-format check from #26045 in the config setter for time_format. The validator runs before writing to the existing Option<String> field.

What is the testing strategy for this PR?

set_variable.slt covers an incomplete directive (%) and a year directive (%Y). It also checks that SHOW still returns the previous format.

Are there any user-facing changes?

An invalid SET now returns a configuration error immediately and leaves the previous format in effect.

@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) common Related to common crate labels Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant