-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: DateTimeOffset #546
base: master
Are you sure you want to change the base?
feat: DateTimeOffset #546
Conversation
try { | ||
int longsRead = Decode(source, longs.AsSpan(0, data.Length)); | ||
if(tse.LogicalType?.TIMESTAMP is not null) { | ||
if(!tse.LogicalType.TIMESTAMP.IsAdjustedToUTC) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably deserved a dedicated error and a link to the docs if this change is accepted
1d3e666
to
d1c16cc
Compare
d1c16cc
to
3f4f8a6
Compare
/// </summary> | ||
/// <param name="other"></param> | ||
/// <returns></returns> | ||
protected virtual bool BaseClrTypeCompatible(DataField other) => this.BaseClrType == other.BaseClrType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a hack to fix the serialization append issue I encountered.
Fundamentally the parquet thrift schema on its own does not enough information to differentiate date time offset vs date time with the class.
Will have to rethink my approach. Possibly merge DateTimeOffsetDataField into DateTimeDataField somehow
This is my follow up to #521
Rationale:
I have many models that currently use DateTimeOffset to map entities and I would like to serialize these without creating mapping models.
I am aware that DateTimeOffset was previously removed due to confusion but I have added additional checks to try and mitigate this.
The Logical Timestamp helps with this as we can refuse to decode a Timestamp to DateTimeOffset when it is not in UTC. As this invites errors and can cause confusion. (DateTime avoids this by allowing you to stipulate the kind as
Local
).