Skip to content
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

[BigQuery] Supporting TIMESTAMP_NTZ #985

Merged
merged 15 commits into from
Oct 24, 2024
Merged

[BigQuery] Supporting TIMESTAMP_NTZ #985

merged 15 commits into from
Oct 24, 2024

Conversation

Tang8330
Copy link
Contributor

@Tang8330 Tang8330 commented Oct 24, 2024

As per title.

This including the encoding algo for DATETIME

@Tang8330 Tang8330 marked this pull request as ready for review October 24, 2024 18:01
@Tang8330 Tang8330 requested a review from a team as a code owner October 24, 2024 18:01
@Tang8330 Tang8330 marked this pull request as draft October 24, 2024 18:03
@Tang8330 Tang8330 marked this pull request as ready for review October 24, 2024 20:29
@Tang8330 Tang8330 requested a review from nathan-artie October 24, 2024 20:29
@Tang8330 Tang8330 changed the title [BQ] Supporting TIMESTAMP_NTZ [BigQuery] Supporting TIMESTAMP_NTZ Oct 24, 2024
return bitFieldDatetimeSeconds
}

// // This is a reimplementation of https://github.com/googleapis/java-bigquerystorage/blob/f79acb5cfdd12253bca1c41551c478400120d2f9/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/CivilTimeEncoder.java#L248
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra //

return bitFieldTimeSeconds
}

// // This is a reimplementation of https://github.com/googleapis/java-bigquerystorage/blob/f79acb5cfdd12253bca1c41551c478400120d2f9/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/CivilTimeEncoder.java#L187
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra //.


// // This is a reimplementation of https://github.com/googleapis/java-bigquerystorage/blob/f79acb5cfdd12253bca1c41551c478400120d2f9/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/CivilTimeEncoder.java#L248
func encodePacked64DatetimeMicros(dateTime time.Time) int64 {
return encodePacked64DatetimeSeconds(dateTime)<<microLength | int64(dateTime.Nanosecond()/1_000)
Copy link
Contributor

@nathan-artie nathan-artie Oct 24, 2024

Choose a reason for hiding this comment

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

Nit: inconsistent with the /1000 above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sg

}

func TestEncodePacked64DatetimeSeconds(t *testing.T) {
_ts := time.Date(2024, 10, 24, 13, 1, 2, 3000000, time.UTC)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Do these need to be prefixed with an underscore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, can change

@Tang8330 Tang8330 merged commit 0ca75c0 into master Oct 24, 2024
3 checks passed
@Tang8330 Tang8330 deleted the support-timestamp-ntz branch October 24, 2024 22:14
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