Skip to content

feat: Add support for 'isoyear' in date_part function#19821

Merged
alamb merged 2 commits intoapache:mainfrom
cht42:isoyear
Jan 16, 2026
Merged

feat: Add support for 'isoyear' in date_part function#19821
alamb merged 2 commits intoapache:mainfrom
cht42:isoyear

Conversation

@cht42
Copy link
Copy Markdown
Contributor

@cht42 cht42 commented Jan 15, 2026

Which issue does this PR close?

Rationale for this change

isoyear part is available in both PG and Spark EXTRACT functions.

https://www.postgresql.org/docs/current/functions-datetime.html#:~:text=the%20week%20numbering.-,isoyear,-The%20ISO%208601
https://github.com/apache/spark/blob/a03bedb6c1281c5263a42bfd20608d2ee005ab05/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala#L3360

What changes are included in this PR?

Support for part isoyear in date_part function.

Are these changes tested?

yes in SLT

Are there any user-facing changes?

yes

@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation labels Jan 15, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jan 15, 2026
@cht42 cht42 mentioned this pull request Jan 15, 2026
@alamb alamb added this pull request to the merge queue Jan 16, 2026
@alamb
Copy link
Copy Markdown
Contributor

alamb commented Jan 16, 2026

Thanks @cht42 and @Jefffrey

Merged via the queue into apache:main with commit f3f6dec Jan 16, 2026
29 checks passed
de-bgunter pushed a commit to de-bgunter/datafusion that referenced this pull request Mar 24, 2026
## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes apache#123` indicates that this PR will close issue apache#123.
-->

- Closes apache#19820.

## Rationale for this change

`isoyear` part is available in both PG and Spark EXTRACT functions. 


https://www.postgresql.org/docs/current/functions-datetime.html#:~:text=the%20week%20numbering.-,isoyear,-The%20ISO%208601

https://github.com/apache/spark/blob/a03bedb6c1281c5263a42bfd20608d2ee005ab05/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala#L3360

## What changes are included in this PR?

Support for part `isoyear` in date_part function.

## Are these changes tested?
yes in SLT

## Are there any user-facing changes?

yes
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
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 sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for 'isoyear' in date_part function

3 participants