Skip to content

Fix DateTimeKind collisions in dictionary encoding and mark INT96 DateTimeKind as Unspecified - #695

Closed
Kuinox wants to merge 2 commits into
aloneguid:masterfrom
Kuinox:datetime_kind_origin
Closed

Fix DateTimeKind collisions in dictionary encoding and mark INT96 DateTimeKind as Unspecified#695
Kuinox wants to merge 2 commits into
aloneguid:masterfrom
Kuinox:datetime_kind_origin

Conversation

@Kuinox

@Kuinox Kuinox commented Dec 27, 2025

Copy link
Copy Markdown
Contributor

While I'm trying to fix the DateTime handling, I'm uncovering other bugs.

The one fixed in this PR, is when there are mixed DateTimeKind in a RowGroup.
The DateTime are merged by tick count without taking into account the DateTimeKind.
When the DateTimeKind is local, it represent a local date and while having the same TickCount, it represent another moment of time than an utc DateTime with the same TickCount.

The root cause of the issue, is that .NET DateTime are equal if they have the same TickCount, but different kind.

This PR also change the DateTimeKind we put on decoded DateTime from INT96. They are now Unspecified, instead of UTC. This makes more sense since there is no "IsAdjustedToUTC" flag for thoses.

@Kuinox Kuinox changed the title Fix DateTimeKind collisions in dictionary encoding and mark INT96 timestamps as Unspecified Fix DateTimeKind collisions in dictionary encoding and mark INT96 DateTimeKind as Unspecified Dec 27, 2025
@Kuinox
Kuinox marked this pull request as draft December 28, 2025 18:39
@Kuinox
Kuinox marked this pull request as ready for review December 28, 2025 18:50
@aloneguid aloneguid self-assigned this Jan 9, 2026
@aloneguid
aloneguid self-requested a review April 28, 2026 21:25
# Conflicts:
#	src/Parquet.Test/Types/EndToEndTypeTest.cs
#	src/Parquet/Encodings/ParquetDictionaryEncoder.cs
@aloneguid

Copy link
Copy Markdown
Owner

Hi @Kuinox I've manually merged changes to master as PR was too old to safely merge. Closing this now. Thanks for all the work.

@aloneguid aloneguid closed this May 15, 2026
@aloneguid aloneguid added this to the 6.0.4 milestone May 15, 2026
@Kuinox

Kuinox commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

No problem, thanks !

@Kuinox
Kuinox deleted the datetime_kind_origin branch May 15, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants