[ 
https://issues.apache.org/jira/browse/GOBBLIN-767?focusedWorklogId=240329&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-240329
 ]

ASF GitHub Bot logged work on GOBBLIN-767:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/May/19 17:11
            Start Date: 10/May/19 17:11
    Worklog Time Spent: 10m 
      Work Description: htran1 commented on pull request #2630: [GOBBLIN-767] 
Support different time units in TimeBasedWriterPartitioner
URL: https://github.com/apache/incubator-gobblin/pull/2630#discussion_r282966954
 
 

 ##########
 File path: 
gobblin-core/src/test/java/org/apache/gobblin/writer/partitioner/TimeBasedAvroWriterPartitionerTest.java
 ##########
 @@ -108,23 +114,31 @@ public void testWriter() throws IOException {
     // Write three records, each should be written to a different file
     GenericRecordBuilder genericRecordBuilder = new 
GenericRecordBuilder(this.schema);
 
+    State state = getBasicState();
+    DataWriter<GenericRecord> millisPartitionWriter = getWriter(state);
+
     // This timestamp corresponds to 2015/01/01
     genericRecordBuilder.set("timestamp", 1420099200000l);
-    this.writer.writeEnvelope(new 
RecordEnvelope<>(genericRecordBuilder.build()));
+    millisPartitionWriter.writeEnvelope(new 
RecordEnvelope<>(genericRecordBuilder.build()));
 
     // This timestamp corresponds to 2015/01/02
     genericRecordBuilder.set("timestamp", 1420185600000l);
-    this.writer.writeEnvelope(new 
RecordEnvelope<>(genericRecordBuilder.build()));
-
-    // This timestamp corresponds to 2015/01/03
-    genericRecordBuilder.set("timestamp", 1420272000000l);
-    this.writer.writeEnvelope(new 
RecordEnvelope<>(genericRecordBuilder.build()));
+    millisPartitionWriter.writeEnvelope(new 
RecordEnvelope<>(genericRecordBuilder.build()));
 
+    millisPartitionWriter.close();
+    millisPartitionWriter.commit();
     // Check that the writer reports that 3 records have been written
-    Assert.assertEquals(this.writer.recordsWritten(), 3);
+    Assert.assertEquals(millisPartitionWriter.recordsWritten(), 2);
 
 Review comment:
   Comment and assert do not match.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 240329)
    Time Spent: 20m  (was: 10m)

> Support different time units in TimeBasedWriterPartitioner
> ----------------------------------------------------------
>
>                 Key: GOBBLIN-767
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-767
>             Project: Apache Gobblin
>          Issue Type: Task
>            Reporter: Zhixiong Chen
>            Assignee: Zhixiong Chen
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently, `TimeBasedWriterPartitioner` assumes the timestamp value from a 
> record is in millis. The task is to remove the assumption and support 
> timestamp in different units, by default, in millis.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to