Skip to content

fix date_part('isodow')#22116

Merged
comphead merged 1 commit into
apache:mainfrom
sdf-jkl:temporal-isodow-fix
May 12, 2026
Merged

fix date_part('isodow')#22116
comphead merged 1 commit into
apache:mainfrom
sdf-jkl:temporal-isodow-fix

Conversation

@sdf-jkl
Copy link
Copy Markdown
Contributor

@sdf-jkl sdf-jkl commented May 12, 2026

Which issue does this PR close?

Rationale for this change

Bug in date_part - isodow argument logic

What changes are included in this PR?

  • fix the logic
  • fix the docs

Are these changes tested?

  • Yes, unit tests

Are there any user-facing changes?

  • Yes, this PR fixes the logic bug. Docs are updated.

@github-actions github-actions Bot added documentation Improvements or additions to documentation sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation spark labels May 12, 2026
Copy link
Copy Markdown
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

Double checked this behavior https://en.wikipedia.org/wiki/ISO_8601#Week_dates:

[D] is the weekday number, from 1 through 7, beginning with Monday and ending with Sunday.

@comphead comphead added this pull request to the merge queue May 12, 2026
Merged via the queue into apache:main with commit f6a1995 May 12, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation functions Changes to functions implementation spark sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

date_part('isodow') / EXTRACT(isodow) returns 0..=6 instead of PostgreSQL's 1..=7

3 participants