TheNeuralBit commented on a change in pull request #11272:
URL: https://github.com/apache/beam/pull/11272#discussion_r418764453



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/logicaltypes/Date.java
##########
@@ -0,0 +1,62 @@
+/*
+ * 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.LocalDate;
+import org.apache.beam.sdk.schemas.Schema;
+
+/**
+ * A date without a time-zone.
+ *
+ * <p>It cannot represent an instant on the time-line without additional 
information such as an
+ * offset or time-zone.
+ */
+public class Date implements Schema.LogicalType<LocalDate, Long> {

Review comment:
       That is unfortunate... but what in-memory type should we use instead? 
joda.time.LocalDate uses a millisecond long, do we want to add another joda 
dependency?
   
   We could access the base type (wire format type) directly in SQL with 
[Row#getBaseValue](https://github.com/apache/beam/blob/7b890654e6bbfcab79a2f5677f1badd54bd444aa/sdks/java/core/src/main/java/org/apache/beam/sdk/values/Row.java#L424),
 but unfortunately Rows store logical types as the input type (in memory format 
type), so that wouldn't actually avoid a conversion.




----------------------------------------------------------------
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


Reply via email to