Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

Commit 5857d3b

Browse files
jontradesyyu-iskw
authored andcommitted
Jon/bigquery timestamp support (#27)
* Adding support for BigQuery timestamps without millisecond precision * Setting jar manifest to the Apache Beam job * Adding unit test for timestamp format * Update pom.xml Removing manifest configuration in pom.xml
1 parent 7fddef4 commit 5857d3b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/main/java/com/github/yuiskw/beam/TableRow2EntityFn.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ public static Instant parseTimestamp(String value) {
303303
"yyyy-M-d H:m:s.SSS z",
304304
"yyyy-M-d H:m:s.SS z",
305305
"yyyy-M-d H:m:s.S z",
306+
"yyyy-M-d H:m:s z",
306307
"yyyy-M-d H:m:s.SSS",
307308
"yyyy-M-d H:m:s.SS",
308309
"yyyy-M-d H:m:s.S",

src/test/java/com/github/yuiskw/beam/TableRow2EntityFnTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ public void testIsTimestamp() {
166166
assertNotNull(TableRow2EntityFn.parseTimestamp("2017-9-1 4:1:1.1 UTC"));
167167
assertNotNull(TableRow2EntityFn.parseTimestamp("2017-9-1 4:1:1.12 UTC"));
168168
assertNotNull(TableRow2EntityFn.parseTimestamp("2017-9-1 4:1:1.001 UTC"));
169+
assertNotNull(TableRow2EntityFn.parseTimestamp("2019-03-13 22:00:20 UTC"));
169170

170171
assertNotNull(TableRow2EntityFn.parseTimestamp("2017-09-16 04:14:37.844 PST"));
171172
assertNotNull(TableRow2EntityFn.parseTimestamp("2017-09-16 04:14:37.844 JST"));

0 commit comments

Comments
 (0)