[ https://issues.apache.org/jira/browse/FLINK-5187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15742006#comment-15742006 ]
ASF GitHub Bot commented on FLINK-5187: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/2968#discussion_r91949817 --- Diff: flink-core/src/test/java/org/apache/flink/api/common/typeutils/base/RowComparatorTest.java --- @@ -0,0 +1,156 @@ +/* + * 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.ExecutionConfig; +import org.apache.flink.api.common.typeinfo.BasicTypeInfo; +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 org.apache.flink.api.java.tuple.Tuple3; +import org.apache.flink.api.java.typeutils.RowTypeInfo; +import org.apache.flink.api.java.typeutils.TupleTypeInfo; +import org.apache.flink.api.java.typeutils.TypeExtractor; +import org.apache.flink.types.Row; +import org.junit.Before; + +import java.io.Serializable; + +import static org.junit.Assert.assertEquals; + +public class RowComparatorTest extends ComparatorTestBase<Row> { + + private final RowTypeInfo typeInfo = new RowTypeInfo( + BasicTypeInfo.INT_TYPE_INFO, + BasicTypeInfo.DOUBLE_TYPE_INFO, + BasicTypeInfo.STRING_TYPE_INFO, + new TupleTypeInfo<Tuple3<Integer, Boolean, Short>>( + BasicTypeInfo.INT_TYPE_INFO, + BasicTypeInfo.BOOLEAN_TYPE_INFO, + BasicTypeInfo.SHORT_TYPE_INFO + ), + TypeExtractor.createTypeInfo(MyPojo.class)); + + private MyPojo testPojo1 = new MyPojo(); + private MyPojo testPojo2 = new MyPojo(); + private MyPojo testPojo3 = new MyPojo(); + + private final Row[] data = new Row[]{ + createRow(null, null, null, null, null), + createRow(0, null, null, null, null), + createRow(0, 0.0, null, null, null), + createRow(0, 0.0, "a", null, null), + createRow(1, 0.0, "a", null, null), + createRow(1, 1.0, "a", null, null), + createRow(1, 1.0, "b", null, null), + createRow(1, 1.0, "b", new Tuple3<>(1, false, (short) 2), null), + createRow(1, 1.0, "b", new Tuple3<>(2, false, (short) 2), null), + createRow(1, 1.0, "b", new Tuple3<>(2, true, (short) 2), null), + createRow(1, 1.0, "b", new Tuple3<>(2, true, (short) 3), null), + createRow(1, 1.0, "b", new Tuple3<>(2, true, (short) 3), testPojo1), + createRow(1, 1.0, "b", new Tuple3<>(2, true, (short) 3), testPojo2), + createRow(1, 1.0, "b", new Tuple3<>(2, true, (short) 3), testPojo3) + }; + + @Before --- End diff -- Can be `@BeforeClass` > Create analog of Row in core > ---------------------------- > > Key: FLINK-5187 > URL: https://issues.apache.org/jira/browse/FLINK-5187 > Project: Flink > Issue Type: Sub-task > Components: Core, Table API & SQL > Reporter: Anton Solovev > Assignee: Jark Wu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)