use of org.apache.flink.table.types.logical.DoubleType in project flink by apache.
the class RowDataSerializerTest method testRowDataSerializerWithComplexTypes.
private static Object[] testRowDataSerializerWithComplexTypes() {
InternalTypeInfo<RowData> typeInfo = InternalTypeInfo.ofFields(new IntType(), new DoubleType(), VarCharType.STRING_TYPE, new ArrayType(new IntType()), new MapType(new IntType(), new IntType()));
GenericRowData[] data = new GenericRowData[] { createRow(null, null, null, null, null), createRow(0, null, null, null, null), createRow(0, 0.0, null, null, null), createRow(0, 0.0, fromString("a"), null, null), createRow(1, 0.0, fromString("a"), null, null), createRow(1, 1.0, fromString("a"), null, null), createRow(1, 1.0, fromString("b"), null, null), createRow(1, 1.0, fromString("b"), createArray(1), createMap(new int[] { 1 }, new int[] { 1 })), createRow(1, 1.0, fromString("b"), createArray(1, 2), createMap(new int[] { 1, 4 }, new int[] { 1, 2 })), createRow(1, 1.0, fromString("b"), createArray(1, 2, 3), createMap(new int[] { 1, 5 }, new int[] { 1, 3 })), createRow(1, 1.0, fromString("b"), createArray(1, 2, 3, 4), createMap(new int[] { 1, 6 }, new int[] { 1, 4 })), createRow(1, 1.0, fromString("b"), createArray(1, 2, 3, 4, 5), createMap(new int[] { 1, 7 }, new int[] { 1, 5 })), createRow(1, 1.0, fromString("b"), createArray(1, 2, 3, 4, 5, 6), createMap(new int[] { 1, 8 }, new int[] { 1, 6 })) };
RowDataSerializer serializer = typeInfo.toRowSerializer();
return new Object[] { serializer, data };
}
Aggregations