Skip to content

Commit

Permalink
Updating logical date millis logic (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
benwatson528 authored May 5, 2021
1 parent e3ee750 commit 61489fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public String getLogicalTypeName() {
}

public String fromLong(Long millisFromEpoch, Schema schema, LogicalType type) {
return Instant.ofEpochSecond(millisFromEpoch).toString();
return Instant.ofEpochMilli(millisFromEpoch).toString();
}

public Long toLong(String timestamp, Schema schema, LogicalType type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testDateLogicalType() throws IOException {
assertThat(records).hasSize(5);
String firstRecord = records.get(0);
assertThat(firstRecord)
.contains("{\"received_at\": \"2020-08-27T19:41:44Z\", \"name___string\": \"Tressa\"");
.contains("{\"received_at\": \"1970-01-19T12:02:37.304Z\", \"name___string\": \"Tressa\"");
}

private List<String> readRecords(String fileName, int numRecords) throws IOException {
Expand Down

0 comments on commit 61489fc

Please sign in to comment.