-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Serialize timezone in timestamp scalar values #2120
Conversation
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.
LGTM
let timezone = if v.timezone.is_empty() { | ||
None | ||
} else { | ||
Some(v.timezone.clone()) | ||
}; |
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.
Maybe it could be written like this:
let timezone = if v.timezone.is_empty() { | |
None | |
} else { | |
Some(v.timezone.clone()) | |
}; | |
let timezone = v.timezone.map(|v| Some(v.clone()))? |
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.
Maybe it could be written like this:
In this case v.timezone
is a String
. Rather than introduce a wrapper type to make an optional string field, this is just interpreting an empty string as None
.
Value::IntervalYearmonthValue(v) => Self::IntervalYearMonth(Some(*v)), | ||
Value::IntervalDaytimeValue(v) => Self::IntervalDayTime(Some(*v)), | ||
Value::TimestampValue(v) => { |
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.
the replication is unfortunate but I see it is not something that got introduced with this PR
Which issue does this PR close?
Closes #2116
Rationale for this change
Optional timezone was not being serialized in the standard protobuf serialization of
ScalarValue
What changes are included in this PR?
Add timezone to the protobuf definitions and handle serialization/deserialization
Are there any user-facing changes?
No
No