[
https://issues.apache.org/jira/browse/FLINK-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14219291#comment-14219291
]
ASF GitHub Bot commented on FLINK-1252:
---------------------------------------
Github user uce commented on a diff in the pull request:
https://github.com/apache/incubator-flink/pull/215#discussion_r20640206
--- Diff:
flink-core/src/test/java/org/apache/flink/api/common/typeutils/base/DateComparatorTest.java
---
@@ -0,0 +1,60 @@
+/*
+ * 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.flink.api.common.typeutils.base;
+
+import org.apache.flink.api.common.typeutils.ComparatorTestBase;
+import org.apache.flink.api.common.typeutils.TypeComparator;
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+
+import java.util.Date;
+import java.util.Random;
+
+public class DateComparatorTest extends ComparatorTestBase<Date> {
+
+ @Override
+ protected TypeComparator<Date> createComparator(boolean ascending) {
+ return new DateComparator(ascending);
+ }
+
+ @Override
+ protected TypeSerializer<Date> createSerializer() {
+ return new DateSerializer();
+ }
+
+ @Override
+ protected Date[] getSortedTestData() {
+ Random rnd = new Random(874597969123412338L);
+ long rndLong = rnd.nextLong();
+ if (rndLong < 0) {
--- End diff --
These checks appear a little random before you see that you want the rnd
value in the range 3 to Long.MAX_VALUE-1 for the sorted data.
> Add a serializer for Date
> -------------------------
>
> Key: FLINK-1252
> URL: https://issues.apache.org/jira/browse/FLINK-1252
> Project: Flink
> Issue Type: Improvement
> Reporter: Robert Metzger
> Assignee: Robert Metzger
>
> Since FLINK-610 is still an unresolved issue, I've started working on adding
> support for Date fields in POJOs in Flink.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)