com.facebook.presto.spi.type.BooleanType Java Examples

The following examples show how to use com.facebook.presto.spi.type.BooleanType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestJsonDecoder.java    From presto-kinesis with Apache License 2.0 6 votes vote down vote up
@Test
public void testNonExistent()
        throws Exception
{
    byte[] json = "{}".getBytes(StandardCharsets.UTF_8);

    JsonKinesisRowDecoder rowDecoder = new JsonKinesisRowDecoder(PROVIDER.get());
    KinesisColumnHandle row1 = new KinesisColumnHandle("", 0, "row1", VarcharType.VARCHAR, "very/deep/varchar", null, null, false, false);
    KinesisColumnHandle row2 = new KinesisColumnHandle("", 1, "row2", BigintType.BIGINT, "no_bigint", null, null, false, false);
    KinesisColumnHandle row3 = new KinesisColumnHandle("", 2, "row3", DoubleType.DOUBLE, "double/is_missing", null, null, false, false);
    KinesisColumnHandle row4 = new KinesisColumnHandle("", 3, "row4", BooleanType.BOOLEAN, "hello", null, null, false, false);

    List<KinesisColumnHandle> columns = ImmutableList.of(row1, row2, row3, row4);
    Set<KinesisFieldValueProvider> providers = new HashSet<>();

    boolean valid = rowDecoder.decodeRow(json, providers, columns, buildMap(columns));
    assertTrue(valid);

    assertEquals(providers.size(), columns.size());

    DecoderTestUtil.checkIsNull(providers, row1);
    DecoderTestUtil.checkIsNull(providers, row2);
    DecoderTestUtil.checkIsNull(providers, row3);
    DecoderTestUtil.checkIsNull(providers, row4);
}
 
Example #2
Source File: TypeHelper.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
public static org.apache.kudu.Type toKuduClientType(Type type) {
    if (type instanceof VarcharType) {
        return org.apache.kudu.Type.STRING;
    } else if (type == TimestampType.TIMESTAMP) {
        return org.apache.kudu.Type.UNIXTIME_MICROS;
    } else if (type == BigintType.BIGINT) {
        return org.apache.kudu.Type.INT64;
    } else if (type == IntegerType.INTEGER) {
        return org.apache.kudu.Type.INT32;
    } else if (type == SmallintType.SMALLINT) {
        return org.apache.kudu.Type.INT16;
    } else if (type == TinyintType.TINYINT) {
        return org.apache.kudu.Type.INT8;
    } else if (type == RealType.REAL) {
        return org.apache.kudu.Type.FLOAT;
    } else if (type == DoubleType.DOUBLE) {
        return org.apache.kudu.Type.DOUBLE;
    } else if (type == BooleanType.BOOLEAN) {
        return org.apache.kudu.Type.BOOL;
    } else if (type instanceof VarbinaryType) {
        return org.apache.kudu.Type.BINARY;
    } else if (type instanceof DecimalType) {
        return org.apache.kudu.Type.DECIMAL;
    } else if (type == DateType.DATE) {
        return org.apache.kudu.Type.STRING;
    } else if (type instanceof CharType) {
        return org.apache.kudu.Type.STRING;
    } else {
        throw new IllegalStateException("Type mapping implemented for Presto type: " + type);
    }
}
 
Example #3
Source File: TypeHelper.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
private static Type fromKuduClientType(org.apache.kudu.Type ktype, ColumnTypeAttributes attributes) {
    switch (ktype) {
        case STRING:
            return VarcharType.VARCHAR;
        case UNIXTIME_MICROS:
            return TimestampType.TIMESTAMP;
        case INT64:
            return BigintType.BIGINT;
        case INT32:
            return IntegerType.INTEGER;
        case INT16:
            return SmallintType.SMALLINT;
        case INT8:
            return TinyintType.TINYINT;
        case FLOAT:
            return RealType.REAL;
        case DOUBLE:
            return DoubleType.DOUBLE;
        case BOOL:
            return BooleanType.BOOLEAN;
        case BINARY:
            return VarbinaryType.VARBINARY;
        case DECIMAL:
            return DecimalType.createDecimalType(attributes.getPrecision(), attributes.getScale());
        default:
            throw new IllegalStateException("Kudu type not implemented for " + ktype);
    }
}
 
Example #4
Source File: TypeHelper.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
public static NullableValue getColumnValue(Type type, PartialRow row, int i) {
    if (row.isNull(i)) {
        return NullableValue.asNull(type);
    } else {
        if (type instanceof VarcharType) {
            return NullableValue.of(type, utf8Slice(row.getString(i)));
        } else if (type == TimestampType.TIMESTAMP) {
            return NullableValue.of(type, row.getLong(i) / 1000);
        } else if (type == BigintType.BIGINT) {
            return NullableValue.of(type, row.getLong(i));
        } else if (type == IntegerType.INTEGER) {
            return NullableValue.of(type, row.getInt(i));
        } else if (type == SmallintType.SMALLINT) {
            return NullableValue.of(type, row.getShort(i));
        } else if (type == TinyintType.TINYINT) {
            return NullableValue.of(type, row.getByte(i));
        } else if (type == DoubleType.DOUBLE) {
            return NullableValue.of(type, row.getDouble(i));
        } else if (type == RealType.REAL) {
            return NullableValue.of(type, (long) floatToRawIntBits(row.getFloat(i)));
        } else if (type == BooleanType.BOOLEAN) {
            return NullableValue.of(type, row.getBoolean(i));
        } else if (type instanceof VarbinaryType) {
            return NullableValue.of(type, wrappedBuffer(row.getBinary(i)));
        } else if (type instanceof DecimalType) {
            return NullableValue.of(type, row.getDecimal(i));
        } else {
            throw new IllegalStateException("Handling of type " + type + " is not implemented");
        }
    }
}
 
Example #5
Source File: TypeHelper.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
public static Object getJavaValue(Type type, Object nativeValue) {
    if (type instanceof VarcharType) {
        return ((Slice) nativeValue).toStringUtf8();
    } else if (type == TimestampType.TIMESTAMP) {
        return ((Long) nativeValue) * 1000;
    } else if (type == BigintType.BIGINT) {
        return nativeValue;
    } else if (type == IntegerType.INTEGER) {
        return ((Long) nativeValue).intValue();
    } else if (type == SmallintType.SMALLINT) {
        return ((Long) nativeValue).shortValue();
    } else if (type == TinyintType.TINYINT) {
        return ((Long) nativeValue).byteValue();
    } else if (type == DoubleType.DOUBLE) {
        return nativeValue;
    } else if (type == RealType.REAL) {
        // conversion can result in precision lost
        return intBitsToFloat(((Long) nativeValue).intValue());
    } else if (type == BooleanType.BOOLEAN) {
        return nativeValue;
    } else if (type instanceof VarbinaryType) {
        return ((Slice) nativeValue).toByteBuffer();
    } else if (type instanceof DecimalType) {
        return nativeValue;
    } else {
        throw new IllegalStateException("Back conversion not implemented for " + type);
    }
}
 
Example #6
Source File: TypeHelper.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
public static Object getObject(Type type, RowResult row, int field) {
    if (row.isNull(field)) {
        return null;
    } else {
        if (type instanceof VarcharType) {
            return row.getString(field);
        } else if (type == TimestampType.TIMESTAMP) {
            return row.getLong(field) / 1000;
        } else if (type == BigintType.BIGINT) {
            return row.getLong(field);
        } else if (type == IntegerType.INTEGER) {
            return row.getInt(field);
        } else if (type == SmallintType.SMALLINT) {
            return row.getShort(field);
        } else if (type == TinyintType.TINYINT) {
            return row.getByte(field);
        } else if (type == DoubleType.DOUBLE) {
            return row.getDouble(field);
        } else if (type == RealType.REAL) {
            return row.getFloat(field);
        } else if (type == BooleanType.BOOLEAN) {
            return row.getBoolean(field);
        } else if (type instanceof VarbinaryType) {
            return Slices.wrappedBuffer(row.getBinary(field));
        } else if (type instanceof DecimalType) {
            return row.getDecimal(field);
        } else {
            throw new IllegalStateException("getObject not implemented for " + type);
        }
    }
}
 
Example #7
Source File: TypeHelper.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
public static boolean getBoolean(Type type, RowResult row, int field) {
    if (type == BooleanType.BOOLEAN) {
        return row.getBoolean(field);
    } else {
        throw new IllegalStateException("getBoolean not implemented for " + type);
    }
}
 
Example #8
Source File: TestJsonDecoder.java    From presto-kinesis with Apache License 2.0 5 votes vote down vote up
@Test
public void testSimple()
        throws Exception
{
    byte[] json = ByteStreams.toByteArray(TestJsonDecoder.class.getResourceAsStream("/decoder/json/message.json"));

    JsonKinesisRowDecoder rowDecoder = new JsonKinesisRowDecoder(PROVIDER.get());
    KinesisColumnHandle row1 = new KinesisColumnHandle("", 0, "row1", VarcharType.VARCHAR, "source", null, null, false, false);
    KinesisColumnHandle row2 = new KinesisColumnHandle("", 1, "row2", VarcharType.VARCHAR, "user/screen_name", null, null, false, false);
    KinesisColumnHandle row3 = new KinesisColumnHandle("", 2, "row3", BigintType.BIGINT, "id", null, null, false, false);
    KinesisColumnHandle row4 = new KinesisColumnHandle("", 3, "row4", BigintType.BIGINT, "user/statuses_count", null, null, false, false);
    KinesisColumnHandle row5 = new KinesisColumnHandle("", 4, "row5", BooleanType.BOOLEAN, "user/geo_enabled", null, null, false, false);

    List<KinesisColumnHandle> columns = ImmutableList.of(row1, row2, row3, row4, row5);
    Set<KinesisFieldValueProvider> providers = new HashSet<>();

    boolean valid = rowDecoder.decodeRow(json, providers, columns, buildMap(columns));
    assertTrue(valid);

    assertEquals(providers.size(), columns.size());

    DecoderTestUtil.checkValue(providers, row1, "<a href=\"http://twitterfeed.com\" rel=\"nofollow\">twitterfeed</a>");
    DecoderTestUtil.checkValue(providers, row2, "EKentuckyNews");
    DecoderTestUtil.checkValue(providers, row3, 493857959588286460L);
    DecoderTestUtil.checkValue(providers, row4, 7630);
    DecoderTestUtil.checkValue(providers, row5, true);
}
 
Example #9
Source File: Elasticsearch2Client.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
private static XContentBuilder buildFieldType(XContentBuilder fieldBuilder, Type type)
        throws IOException
{
    final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis";
    //Type mapping
    // see:https://www.elastic.co/guide/en/elasticsearch/reference/6.3/mapping-types.html
    if (type.equals(BooleanType.BOOLEAN)) {
        return fieldBuilder.field("type", "boolean");
    }
    if (type.equals(BigintType.BIGINT)) {
        return fieldBuilder.field("type", "long");
    }
    if (type.equals(IntegerType.INTEGER)) {
        return fieldBuilder.field("type", "integer");
    }
    if (type.equals(SmallintType.SMALLINT)) {
        return fieldBuilder.field("type", "short");
    }
    if (type.equals(TinyintType.TINYINT)) {
        return fieldBuilder.field("type", "byte");
    }
    if (type.equals(DoubleType.DOUBLE)) {
        return fieldBuilder.field("type", "double");
    }
    if (type.equals(DateType.DATE)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimeType.TIME)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimestampType.TIMESTAMP)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE)) {
        //TODO: TIMESTAMP_WITH_TIME_ZONE
        return fieldBuilder.field("type", "date")
                .field("format", "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis");
    }
    if (type instanceof DecimalType) {
        return fieldBuilder.field("type", "double");
    }
    if (isVarcharType(type)) {
        //es 2.4.x
        // .field("index", "not_analyzed")
        return fieldBuilder.field("type", "string");
    }
    if (type.equals(VarbinaryType.VARBINARY)) {
        return fieldBuilder.field("type", "binary");
    }
    if (isArrayType(type)) {
        Type elementType = type.getTypeParameters().get(0);
        if (isArrayType(elementType) || isMapType(elementType) || isRowType(elementType)) {
            throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
        }
        return buildFieldType(fieldBuilder, elementType);
    }
    if (isMapType(type)) {
        throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
    }
    if (isRowType(type)) {
        throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
    }

    throw new PrestoException(NOT_SUPPORTED, "unsupported type: " + type);
}
 
Example #10
Source File: Elasticsearch6Client.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
private static XContentBuilder buildFieldType(XContentBuilder fieldBuilder, Type type)
        throws IOException
{
    final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis";
    //Type mapping
    // see:https://www.elastic.co/guide/en/elasticsearch/reference/6.3/mapping-types.html
    if (type.equals(BooleanType.BOOLEAN)) {
        return fieldBuilder.field("type", "boolean");
    }
    if (type.equals(BigintType.BIGINT)) {
        return fieldBuilder.field("type", "long");
    }
    if (type.equals(IntegerType.INTEGER)) {
        return fieldBuilder.field("type", "integer");
    }
    if (type.equals(SmallintType.SMALLINT)) {
        return fieldBuilder.field("type", "short");
    }
    if (type.equals(TinyintType.TINYINT)) {
        return fieldBuilder.field("type", "byte");
    }
    if (type.equals(DoubleType.DOUBLE)) {
        return fieldBuilder.field("type", "double");
    }
    if (type.equals(DateType.DATE)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimeType.TIME)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimestampType.TIMESTAMP)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE)) {
        //TODO: TIMESTAMP_WITH_TIME_ZONE
        return fieldBuilder.field("type", "date")
                .field("format", "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis");
    }
    if (type instanceof DecimalType) {
        return fieldBuilder.field("type", "double");
    }
    if (isVarcharType(type)) {
        //TODO: text or keyword ?
        return fieldBuilder.field("type", "text");
    }
    if (type.equals(VarbinaryType.VARBINARY)) {
        return fieldBuilder.field("type", "binary");
    }
    if (isArrayType(type)) {
        Type elementType = type.getTypeParameters().get(0);
        if (isArrayType(elementType) || isMapType(elementType) || isRowType(elementType)) {
            throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
        }
        return buildFieldType(fieldBuilder, elementType);
    }
    if (isMapType(type)) {
        throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
    }
    if (isRowType(type)) {
        throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
    }

    throw new PrestoException(NOT_SUPPORTED, "unsupported type: " + type);
}
 
Example #11
Source File: Elasticsearch5Client.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
private static XContentBuilder buildFieldType(XContentBuilder fieldBuilder, Type type)
        throws IOException
{
    final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis";
    //Type mapping
    // see:https://www.elastic.co/guide/en/elasticsearch/reference/6.3/mapping-types.html
    if (type.equals(BooleanType.BOOLEAN)) {
        return fieldBuilder.field("type", "boolean");
    }
    if (type.equals(BigintType.BIGINT)) {
        return fieldBuilder.field("type", "long");
    }
    if (type.equals(IntegerType.INTEGER)) {
        return fieldBuilder.field("type", "integer");
    }
    if (type.equals(SmallintType.SMALLINT)) {
        return fieldBuilder.field("type", "short");
    }
    if (type.equals(TinyintType.TINYINT)) {
        return fieldBuilder.field("type", "byte");
    }
    if (type.equals(DoubleType.DOUBLE)) {
        return fieldBuilder.field("type", "double");
    }
    if (type.equals(DateType.DATE)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimeType.TIME)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimestampType.TIMESTAMP)) {
        return fieldBuilder.field("type", "date")
                .field("format", dateTimeFormat);
    }
    if (type.equals(TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE)) {
        //TODO: TIMESTAMP_WITH_TIME_ZONE
        return fieldBuilder.field("type", "date")
                .field("format", "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis");
    }
    if (type instanceof DecimalType) {
        return fieldBuilder.field("type", "double");
    }
    if (isVarcharType(type)) {
        //TODO: text or keyword ?
        return fieldBuilder.field("type", "text");
    }
    if (type.equals(VarbinaryType.VARBINARY)) {
        return fieldBuilder.field("type", "binary");
    }
    if (isArrayType(type)) {
        Type elementType = type.getTypeParameters().get(0);
        if (isArrayType(elementType) || isMapType(elementType) || isRowType(elementType)) {
            throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
        }
        return buildFieldType(fieldBuilder, elementType);
    }
    if (isMapType(type)) {
        throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
    }
    if (isRowType(type)) {
        throw new PrestoException(NOT_SUPPORTED, "sorry unsupported type: " + type);
    }

    throw new PrestoException(NOT_SUPPORTED, "unsupported type: " + type);
}
 
Example #12
Source File: ParaflowMetaDataReader.java    From paraflow with Apache License 2.0 4 votes vote down vote up
private Type getType(String typeName)
{
    log.debug("Get type " + typeName);
    typeName = typeName.toLowerCase();
    // check if type is varchar(xx)
    Pattern vcpattern = Pattern.compile("varchar\\(\\s*(\\d+)\\s*\\)");
    Matcher vcmatcher = vcpattern.matcher(typeName);
    if (vcmatcher.find()) {
        String vlen = vcmatcher.group(1);
        if (!vlen.isEmpty()) {
            return VarcharType.createVarcharType(Integer.parseInt(vlen));
        }
        return UnknownType.UNKNOWN;
    }
    // check if type is char(xx)
    Pattern cpattern = Pattern.compile("char\\(\\s*(\\d+)\\s*\\)");
    Matcher cmatcher = cpattern.matcher(typeName);
    if (cmatcher.find()) {
        String clen = cmatcher.group(1);
        if (!clen.isEmpty()) {
            return CharType.createCharType(Integer.parseInt(clen));
        }
        return UnknownType.UNKNOWN;
    }
    // check if type is decimal(precision, scale)
    Pattern dpattern = Pattern.compile("decimal\\((\\d+)\\s*,?\\s*(\\d*)\\)");
    Matcher dmatcher = dpattern.matcher(typeName);
    if (dmatcher.find()) {
        String dprecision = dmatcher.group(1);
        String dscale = dmatcher.group(2);
        if (dprecision.isEmpty()) {
            return UnknownType.UNKNOWN;
        }
        if (dscale.isEmpty()) {
            return DecimalType.createDecimalType(Integer.parseInt(dprecision));
        }
        return DecimalType.createDecimalType(Integer.parseInt(dprecision), Integer.parseInt(dscale));
    }
    switch (typeName) {
        case "boolean":
            return BooleanType.BOOLEAN;
        case "tinyint":
            return TinyintType.TINYINT;
        case "smallint":
            return SmallintType.SMALLINT;
        case "integer":
            return IntegerType.INTEGER;
        case "bigint":
            return BigintType.BIGINT;
        case "real":
            return RealType.REAL;
        case "double":
            return DoubleType.DOUBLE;
        case "date":
            return DateType.DATE;
        case "time":
            return TimeType.TIME;
        case "timestamp":
            return TimestampType.TIMESTAMP;
        default:
            return UnknownType.UNKNOWN;
    }
}
 
Example #13
Source File: TestRawDecoder.java    From presto-kinesis with Apache License 2.0 4 votes vote down vote up
@Test
public void testBooleanStuff()
{
    ByteBuffer buf = ByteBuffer.allocate(100);
    buf.put((byte) 127); // offset 0
    buf.putLong(0); // offset 1
    buf.put((byte) 126); // offset 9
    buf.putLong(1); // offset 10

    buf.put((byte) 125); // offset 18
    buf.putInt(0); // offset 19
    buf.put((byte) 124); // offset 23
    buf.putInt(1); // offset 24

    buf.put((byte) 123); // offset 28
    buf.putShort((short) 0); // offset 29
    buf.put((byte) 122); // offset 31
    buf.putShort((short) 1); // offset 32

    buf.put((byte) 121); // offset 34
    buf.put((byte) 0); // offset 35
    buf.put((byte) 120); // offset 36
    buf.put((byte) 1); // offset 37

    byte[] row = new byte[buf.position()];
    System.arraycopy(buf.array(), 0, row, 0, buf.position());

    RawKinesisRowDecoder rowDecoder = new RawKinesisRowDecoder();
    KinesisColumnHandle row01 = new KinesisColumnHandle("", 0, "row01", BigintType.BIGINT, "0", "BYTE", null, false, false);
    KinesisColumnHandle row02 = new KinesisColumnHandle("", 1, "row02", BooleanType.BOOLEAN, "1", "LONG", null, false, false);
    KinesisColumnHandle row03 = new KinesisColumnHandle("", 2, "row03", BigintType.BIGINT, "9", "BYTE", null, false, false);
    KinesisColumnHandle row04 = new KinesisColumnHandle("", 3, "row04", BooleanType.BOOLEAN, "10", "LONG", null, false, false);

    KinesisColumnHandle row11 = new KinesisColumnHandle("", 4, "row11", BigintType.BIGINT, "18", "BYTE", null, false, false);
    KinesisColumnHandle row12 = new KinesisColumnHandle("", 5, "row12", BooleanType.BOOLEAN, "19", "INT", null, false, false);
    KinesisColumnHandle row13 = new KinesisColumnHandle("", 6, "row13", BigintType.BIGINT, "23", "BYTE", null, false, false);
    KinesisColumnHandle row14 = new KinesisColumnHandle("", 7, "row14", BooleanType.BOOLEAN, "24", "INT", null, false, false);

    KinesisColumnHandle row21 = new KinesisColumnHandle("", 8, "row21", BigintType.BIGINT, "28", "BYTE", null, false, false);
    KinesisColumnHandle row22 = new KinesisColumnHandle("", 9, "row22", BooleanType.BOOLEAN, "29", "SHORT", null, false, false);
    KinesisColumnHandle row23 = new KinesisColumnHandle("", 10, "row23", BigintType.BIGINT, "31", "BYTE", null, false, false);
    KinesisColumnHandle row24 = new KinesisColumnHandle("", 11, "row24", BooleanType.BOOLEAN, "32", "SHORT", null, false, false);

    KinesisColumnHandle row31 = new KinesisColumnHandle("", 12, "row31", BigintType.BIGINT, "34", "BYTE", null, false, false);
    KinesisColumnHandle row32 = new KinesisColumnHandle("", 13, "row32", BooleanType.BOOLEAN, "35", "BYTE", null, false, false);
    KinesisColumnHandle row33 = new KinesisColumnHandle("", 14, "row33", BigintType.BIGINT, "36", "BYTE", null, false, false);
    KinesisColumnHandle row34 = new KinesisColumnHandle("", 15, "row34", BooleanType.BOOLEAN, "37", "BYTE", null, false, false);

    List<KinesisColumnHandle> columns = ImmutableList.of(row01,
            row02,
            row03,
            row04,
            row11,
            row12,
            row13,
            row14,
            row21,
            row22,
            row23,
            row24,
            row31,
            row32,
            row33,
            row34);

    Set<KinesisFieldValueProvider> providers = new HashSet<>();

    boolean valid = rowDecoder.decodeRow(row, providers, columns, buildMap(columns));
    assertTrue(valid);

    assertEquals(providers.size(), columns.size());

    DecoderTestUtil.checkValue(providers, row01, 127);
    DecoderTestUtil.checkValue(providers, row02, false);
    DecoderTestUtil.checkValue(providers, row03, 126);
    DecoderTestUtil.checkValue(providers, row04, true);

    DecoderTestUtil.checkValue(providers, row11, 125);
    DecoderTestUtil.checkValue(providers, row12, false);
    DecoderTestUtil.checkValue(providers, row13, 124);
    DecoderTestUtil.checkValue(providers, row14, true);

    DecoderTestUtil.checkValue(providers, row21, 123);
    DecoderTestUtil.checkValue(providers, row22, false);
    DecoderTestUtil.checkValue(providers, row23, 122);
    DecoderTestUtil.checkValue(providers, row24, true);

    DecoderTestUtil.checkValue(providers, row31, 121);
    DecoderTestUtil.checkValue(providers, row32, false);
    DecoderTestUtil.checkValue(providers, row33, 120);
    DecoderTestUtil.checkValue(providers, row34, true);
}