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

ASF GitHub Bot logged work on BEAM-9037:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Jan/20 22:37
            Start Date: 28/Jan/20 22:37
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on pull request #10486: 
[BEAM-9037] Instant and duration as logical type
URL: https://github.com/apache/beam/pull/10486#discussion_r366529282
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/logicaltypes/NanosDuration.java
 ##########
 @@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.schemas.logicaltypes;
+
+import java.time.Duration;
+import org.apache.beam.sdk.values.Row;
+
+/** A duration represented in nanoseconds. */
+public class NanosDuration extends NanosType<Duration> {
+  public static final String IDENTIFIER = "beam:logical_type:nanos_duration";
 
 Review comment:
   I think we should version these, can you add a v1 to this and nanos_instant?
 
----------------------------------------------------------------
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: 378538)
    Time Spent: 1h 40m  (was: 1.5h)

> Instant and duration as logical type 
> -------------------------------------
>
>                 Key: BEAM-9037
>                 URL: https://issues.apache.org/jira/browse/BEAM-9037
>             Project: Beam
>          Issue Type: Task
>          Components: sdk-java-core
>            Reporter: Alex Van Boxel
>            Assignee: Alex Van Boxel
>            Priority: Major
>             Fix For: 2.19.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> The proto schema includes Timestamp and Duration with nano precision. The 
> logical types should be promoted to the core logical types, so they can be 
> handled on various IO's as standard mandatory conversions.
> This means that the logical type should use the proto specific Timestamp and 
> Duration but the java 8 Instant and Duration.
> See discussion in the design document:
> [https://docs.google.com/document/d/1uu9pJktzT_O3DxGd1-Q2op4nRk4HekIZbzi-0oTAips/edit#heading=h.9uhml95iygqr]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to