Skip to content

Commit

Permalink
expand offset test
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed Nov 25, 2024
1 parent 525d5e1 commit 260c835
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@ public void testTimestamp() throws Exception {
.addFields(TableFieldSchema.newBuilder(TEST_TIMESTAMP).setName("test_int").build())
.addFields(TableFieldSchema.newBuilder(TEST_TIMESTAMP).setName("test_float").build())
.addFields(TableFieldSchema.newBuilder(TEST_TIMESTAMP).setName("test_offset").build())
.addFields(
TableFieldSchema.newBuilder(TEST_TIMESTAMP).setName("test_zero_offset").build())
.addFields(TableFieldSchema.newBuilder(TEST_TIMESTAMP).setName("test_timezone").build())
.addFields(TableFieldSchema.newBuilder(TEST_TIMESTAMP).setName("test_saformat").build())
.build();
Expand All @@ -809,6 +811,7 @@ public void testTimestamp() throws Exception {
.setTestInt(153480695L)
.setTestFloat(153468069500L)
.setTestOffset(1649135171000000L)
.setTestZeroOffset(1648493279010000L)
.setTestTimezone(1649174771000000L)
.setTestSaformat(1534680660000000L)
.build();
Expand All @@ -819,6 +822,7 @@ public void testTimestamp() throws Exception {
json.put("test_int", 153480695);
json.put("test_float", "1.534680695e11");
json.put("test_offset", "2022-04-05T09:06:11+04:00");
json.put("test_zero_offset", "2022-03-28T18:47:59.01+00:00");
json.put("test_timezone", "2022-04-05 09:06:11 PST");
json.put("test_saformat", "2018/08/19 12:11");
DynamicMessage protoMsg =
Expand Down Expand Up @@ -855,6 +859,10 @@ public void testTimestampRepeated() throws Exception {
TableFieldSchema.newBuilder(TEST_TIMESTAMP_REPEATED)
.setName("test_offset_repeated")
.build())
.addFields(
TableFieldSchema.newBuilder(TEST_TIMESTAMP_REPEATED)
.setName("test_zero_offset_repeated")
.build())
.addFields(
TableFieldSchema.newBuilder(TEST_TIMESTAMP_REPEATED)
.setName("test_timezone_repeated")
Expand All @@ -872,6 +880,7 @@ public void testTimestampRepeated() throws Exception {
.addTestIntRepeated(153480695L)
.addTestFloatRepeated(153468069500L)
.addTestOffsetRepeated(1649135171000000L)
.addTestZeroOffsetRepeated(1648493279010000L)
.addTestTimezoneRepeated(1649174771000000L)
.addTestSaformatRepeated(1534680660000000L)
.build();
Expand All @@ -882,6 +891,8 @@ public void testTimestampRepeated() throws Exception {
json.put("test_int_repeated", new JSONArray(new Integer[] {153480695}));
json.put("test_float_repeated", new JSONArray(new String[] {"1.534680695e11"}));
json.put("test_offset_repeated", new JSONArray(new String[] {"2022-04-05T09:06:11+04:00"}));
json.put(
"test_zero_offset_repeated", new JSONArray(new String[] {"2022-03-28T18:47:59.01+00:00"}));
json.put("test_timezone_repeated", new JSONArray(new String[] {"2022-04-05 09:06:11 PST"}));
json.put("test_saformat_repeated", new JSONArray(new String[] {"2018/08/19 12:11"}));
DynamicMessage protoMsg =
Expand Down
10 changes: 6 additions & 4 deletions google-cloud-bigquerystorage/src/test/proto/jsonTest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ message TestTimestamp {
optional int64 test_int = 4;
optional int64 test_float = 5;
optional int64 test_offset = 6;
optional int64 test_timezone = 7;
optional int64 test_saformat = 8;
optional int64 test_zero_offset = 7;
optional int64 test_timezone = 8;
optional int64 test_saformat = 9;
}

message TestRepeatedTimestamp {
Expand All @@ -163,8 +164,9 @@ message TestRepeatedTimestamp {
repeated int64 test_int_repeated = 4;
repeated int64 test_float_repeated = 5;
repeated int64 test_offset_repeated = 6;
repeated int64 test_timezone_repeated = 7;
repeated int64 test_saformat_repeated = 8;
repeated int64 test_zero_offset_repeated = 7;
repeated int64 test_timezone_repeated = 8;
repeated int64 test_saformat_repeated = 9;
}

message TestDate {
Expand Down

0 comments on commit 260c835

Please sign in to comment.