From c37fc72cb3a9b9384d660f71f32321e2aa2f9bb5 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Thu, 24 Oct 2024 13:07:12 -0700 Subject: [PATCH] Clean up. --- clients/bigquery/storagewrite.go | 33 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/clients/bigquery/storagewrite.go b/clients/bigquery/storagewrite.go index 2c295113a..cfad4246c 100644 --- a/clients/bigquery/storagewrite.go +++ b/clients/bigquery/storagewrite.go @@ -93,47 +93,44 @@ func columnsToMessageDescriptor(cols []columns.Column) (*protoreflect.MessageDes } const ( - NANO_SHIFT = 0 - MICRO_SHIFT = 0 - SECOND_SHIFT = 0 - MINUTE_SHIFT = 6 - HOUR_SHIFT = 12 - DAY_SHIFT = 17 - MONTH_SHIFT = 22 - YEAR_SHIFT = 26 - NANO_LENGTH = 30 - MICRO_LENGTH = 20 + microLength = 20 + secondShift = 0 + minuteShift = 6 + hourShift = 12 + dayShift = 17 + monthShift = 22 + yearShift = 26 ) // 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#L143 // See https://cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1.CivilTimeEncoder // And https://cloud.google.com/pubsub/docs/bigquery#date_time_int func encodePacked64TimeMicros(value time.Time) int64 { - return int64(encodePacked32TimeSeconds(value))<