Search in sources :

Example 1 with AvroExtensionsModule

use of org.apache.druid.data.input.avro.AvroExtensionsModule in project druid by druid-io.

the class AvroStreamInputFormatTest method before.

@Before
public void before() {
    timestampSpec = new TimestampSpec("nested", "millis", null);
    dimensionsSpec = new DimensionsSpec(DimensionsSpec.getDefaultSchemas(DIMENSIONS));
    flattenSpec = new JSONPathSpec(true, ImmutableList.of(new JSONPathFieldSpec(JSONPathFieldType.PATH, "nested", "someRecord.subLong")));
    for (Module jacksonModule : new AvroExtensionsModule().getJacksonModules()) {
        jsonMapper.registerModule(jacksonModule);
    }
    jsonMapper.setInjectableValues(new InjectableValues.Std().addValue(ObjectMapper.class, new DefaultObjectMapper()));
}
Also used : AvroExtensionsModule(org.apache.druid.data.input.avro.AvroExtensionsModule) TimestampSpec(org.apache.druid.data.input.impl.TimestampSpec) DimensionsSpec(org.apache.druid.data.input.impl.DimensionsSpec) JSONPathSpec(org.apache.druid.java.util.common.parsers.JSONPathSpec) JSONPathFieldSpec(org.apache.druid.java.util.common.parsers.JSONPathFieldSpec) DefaultObjectMapper(org.apache.druid.jackson.DefaultObjectMapper) Module(com.fasterxml.jackson.databind.Module) AvroExtensionsModule(org.apache.druid.data.input.avro.AvroExtensionsModule) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) DefaultObjectMapper(org.apache.druid.jackson.DefaultObjectMapper) Before(org.junit.Before)

Aggregations

Module (com.fasterxml.jackson.databind.Module)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 AvroExtensionsModule (org.apache.druid.data.input.avro.AvroExtensionsModule)1 DimensionsSpec (org.apache.druid.data.input.impl.DimensionsSpec)1 TimestampSpec (org.apache.druid.data.input.impl.TimestampSpec)1 DefaultObjectMapper (org.apache.druid.jackson.DefaultObjectMapper)1 JSONPathFieldSpec (org.apache.druid.java.util.common.parsers.JSONPathFieldSpec)1 JSONPathSpec (org.apache.druid.java.util.common.parsers.JSONPathSpec)1 Before (org.junit.Before)1