Search in sources :

Example 21 with BinaryArrayWriter

use of org.apache.flink.table.data.writer.BinaryArrayWriter in project flink by apache.

the class ArrayDataSerializerTest method createArray.

static BinaryArrayData createArray(String... vs) {
    BinaryArrayData array = new BinaryArrayData();
    BinaryArrayWriter writer = new BinaryArrayWriter(array, vs.length, 8);
    for (int i = 0; i < vs.length; i++) {
        writer.writeString(i, StringData.fromString(vs[i]));
    }
    writer.complete();
    return array;
}
Also used : BinaryArrayWriter(org.apache.flink.table.data.writer.BinaryArrayWriter) BinaryArrayData(org.apache.flink.table.data.binary.BinaryArrayData)

Aggregations

BinaryArrayWriter (org.apache.flink.table.data.writer.BinaryArrayWriter)21 BinaryArrayData (org.apache.flink.table.data.binary.BinaryArrayData)19 Test (org.junit.Test)11 BinaryRowData (org.apache.flink.table.data.binary.BinaryRowData)6 BinaryRowWriter (org.apache.flink.table.data.writer.BinaryRowWriter)5 BinaryMapData (org.apache.flink.table.data.binary.BinaryMapData)4 ArrayDataSerializer (org.apache.flink.table.runtime.typeutils.ArrayDataSerializer)3 MapDataSerializer (org.apache.flink.table.runtime.typeutils.MapDataSerializer)3 BigDecimal (java.math.BigDecimal)1 HashMap (java.util.HashMap)1 MemorySegment (org.apache.flink.core.memory.MemorySegment)1 ArrayData (org.apache.flink.table.data.ArrayData)1 GenericMapData (org.apache.flink.table.data.GenericMapData)1 MapData (org.apache.flink.table.data.MapData)1 StringData.fromString (org.apache.flink.table.data.StringData.fromString)1 RawValueDataSerializer (org.apache.flink.table.runtime.typeutils.RawValueDataSerializer)1 RowDataSerializer (org.apache.flink.table.runtime.typeutils.RowDataSerializer)1 IntType (org.apache.flink.table.types.logical.IntType)1 Before (org.junit.Before)1