You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2019/05/14 15:20:11 UTC

[GitHub] [incubator-gobblin] zxcware commented on a change in pull request #2632: [GOBBLIN-769] Support string record timestamp in TimeBasedAvroWriterPartitioner

zxcware commented on a change in pull request #2632: [GOBBLIN-769] Support string record timestamp in TimeBasedAvroWriterPartitioner
URL: https://github.com/apache/incubator-gobblin/pull/2632#discussion_r283857079
 
 

 ##########
 File path: gobblin-core/src/main/java/org/apache/gobblin/writer/partitioner/TimeBasedAvroWriterPartitioner.java
 ##########
 @@ -73,9 +74,25 @@ public long getRecordTimestamp(GenericRecord record) {
   /**
    *  Check if the partition column value is present and is a Long object. Otherwise, use current system time.
    */
-  private static long getRecordTimestamp(Optional<Object> writerPartitionColumnValue) {
-    return writerPartitionColumnValue.orNull() instanceof Long ? (Long) writerPartitionColumnValue.get()
-        : System.currentTimeMillis();
+  private long getRecordTimestamp(Optional<Object> writerPartitionColumnValue) {
+
+    // Default to current time
+    Long recordTimestamp = timeUnit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
 
 Review comment:
   +1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services