Search in sources :

Example 1 with HiveBlockEncodingSerde

use of io.trino.plugin.hive.util.HiveBlockEncodingSerde in project trino by trinodb.

the class TestRecordingHiveMetastore method createJsonCodec.

private JsonCodec<HiveMetastoreRecording.Recording> createJsonCodec() {
    ObjectMapperProvider objectMapperProvider = new ObjectMapperProvider();
    TypeDeserializer typeDeserializer = new TypeDeserializer(new TestingTypeManager());
    objectMapperProvider.setJsonDeserializers(ImmutableMap.of(Block.class, new TestingBlockJsonSerde.Deserializer(new HiveBlockEncodingSerde()), Type.class, typeDeserializer));
    objectMapperProvider.setJsonSerializers(ImmutableMap.of(Block.class, new TestingBlockJsonSerde.Serializer(new HiveBlockEncodingSerde())));
    JsonCodec<HiveMetastoreRecording.Recording> jsonCodec = new JsonCodecFactory(objectMapperProvider).jsonCodec(HiveMetastoreRecording.Recording.class);
    return jsonCodec;
}
Also used : ColumnStatisticType(io.trino.spi.statistics.ColumnStatisticType) Type(io.trino.spi.type.Type) VarcharType.createUnboundedVarcharType(io.trino.spi.type.VarcharType.createUnboundedVarcharType) HiveType(io.trino.plugin.hive.HiveType) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) HiveBlockEncodingSerde(io.trino.plugin.hive.util.HiveBlockEncodingSerde) TypeDeserializer(io.trino.plugin.base.TypeDeserializer) Block(io.trino.spi.block.Block) TypeDeserializer(io.trino.plugin.base.TypeDeserializer) JsonCodecFactory(io.airlift.json.JsonCodecFactory) TestingTypeManager(io.trino.spi.type.TestingTypeManager) ObjectMapperProvider(io.airlift.json.ObjectMapperProvider)

Aggregations

JsonCodecFactory (io.airlift.json.JsonCodecFactory)1 ObjectMapperProvider (io.airlift.json.ObjectMapperProvider)1 TypeDeserializer (io.trino.plugin.base.TypeDeserializer)1 HiveType (io.trino.plugin.hive.HiveType)1 HiveBlockEncodingSerde (io.trino.plugin.hive.util.HiveBlockEncodingSerde)1 Block (io.trino.spi.block.Block)1 ColumnStatisticType (io.trino.spi.statistics.ColumnStatisticType)1 TestingTypeManager (io.trino.spi.type.TestingTypeManager)1 Type (io.trino.spi.type.Type)1 VarcharType.createUnboundedVarcharType (io.trino.spi.type.VarcharType.createUnboundedVarcharType)1 VarcharType.createVarcharType (io.trino.spi.type.VarcharType.createVarcharType)1