[
https://issues.apache.org/jira/browse/BEAM-6017?focusedWorklogId=166701&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-166701
]
ASF GitHub Bot logged work on BEAM-6017:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Nov/18 23:53
Start Date: 15/Nov/18 23:53
Worklog Time Spent: 10m
Work Description: kennknowles commented on a change in pull request
#6991: [BEAM-6017] [WIP] Support nanosecond precision for DateTime field in Row
URL: https://github.com/apache/beam/pull/6991#discussion_r234036927
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/coders/JavaInstantCoder.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.coders;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UTFDataFormatException;
+import java.time.Instant;
+import org.apache.beam.sdk.values.TypeDescriptor;
+
+/**
+ * A {@link Coder} for Java time {@link Instant} that encodes it as a big
endian {@link Long}
+ * shifted such that lexicographic ordering of the bytes corresponds to
chronological order, and
+ * also encodes a {@link Integer} for the nanoseconds-of-second adjustment.
+ */
+public class JavaInstantCoder extends AtomicCoder<Instant> {
Review comment:
Please test with `CoderProperties`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 166701)
Time Spent: 2h (was: 1h 50m)
> Support nanosecond precision for DATETIME in Schema
> ---------------------------------------------------
>
> Key: BEAM-6017
> URL: https://issues.apache.org/jira/browse/BEAM-6017
> Project: Beam
> Issue Type: New Feature
> Components: sdk-java-core
> Reporter: Rui Wang
> Assignee: Rui Wang
> Priority: Major
> Time Spent: 2h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)