Add druid.indexing.formats.stringMultiValueHandlingMode system config (#16822)

This patch introduces an optional cluster configuration, druid.indexing.formats.stringMultiValueHandlingMode, allowing operators to override the default mode SORTED_SET for string dimensions. The possible values for the config are SORTED_SET, SORTED_ARRAY, or ARRAY (SORTED_SET is the default). Case insensitive values are allowed.
While this cluster property allows users to manage the multi-value handling mode for string dimension types, it's recommended to migrate to using real array types instead of MVDs.
 
This fixes a long-standing issue where compaction will honor the configured cluster wide property instead of rewriting it as the default SORTED_ARRAY always, even if the data was originally ingested with ARRAY or SORTED_SET.
This commit is contained in:
Abhishek Radhakrishnan 2024-08-03 10:23:44 -07:00 committed by GitHub
parent 9dc2569f22
commit 31b43753fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
44 changed files with 232 additions and 117 deletions

View File

@ -23,7 +23,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.jackson.AggregatorsModule; import org.apache.druid.jackson.AggregatorsModule;
import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.Pair;
@ -68,7 +68,7 @@ public class GroupByDeserializationBenchmark
static { static {
NullHandling.initializeForTests(); NullHandling.initializeForTests();
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
AggregatorsModule.registerComplexMetricsAndSerde(); AggregatorsModule.registerComplexMetricsAndSerde();
} }
@ -93,7 +93,7 @@ public class GroupByDeserializationBenchmark
public void setup() throws JsonProcessingException public void setup() throws JsonProcessingException
{ {
final ObjectMapper undecoratedMapper = TestHelper.makeJsonMapper(); final ObjectMapper undecoratedMapper = TestHelper.makeJsonMapper();
undecoratedMapper.registerModules(NestedDataModule.getJacksonModulesList()); undecoratedMapper.registerModules(BuiltInTypesModule.getJacksonModulesList());
undecoratedMapper.registerModule(new AggregatorsModule()); undecoratedMapper.registerModule(new AggregatorsModule());
final Pair<GroupByQuery, String> sqlQueryAndResultRow = sqlQueryAndResultRow( final Pair<GroupByQuery, String> sqlQueryAndResultRow = sqlQueryAndResultRow(
numDimensions, numDimensions,

View File

@ -37,7 +37,7 @@ import org.apache.druid.frame.processor.FrameProcessorExecutor;
import org.apache.druid.frame.read.FrameReader; import org.apache.druid.frame.read.FrameReader;
import org.apache.druid.frame.testutil.FrameSequenceBuilder; import org.apache.druid.frame.testutil.FrameSequenceBuilder;
import org.apache.druid.frame.write.FrameWriters; import org.apache.druid.frame.write.FrameWriters;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.IAE;
import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.NonnullPair; import org.apache.druid.java.util.common.NonnullPair;
@ -85,7 +85,7 @@ public class FrameChannelMergerBenchmark
{ {
static { static {
NullHandling.initializeForTests(); NullHandling.initializeForTests();
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
private static final String KEY = "key"; private static final String KEY = "key";

View File

@ -24,7 +24,7 @@ import com.google.common.collect.ImmutableSet;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.data.input.impl.DimensionSchema;
import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.guava.Sequence;
@ -89,7 +89,7 @@ public class SqlGroupByBenchmark
static { static {
NullHandling.initializeForTests(); NullHandling.initializeForTests();
ExpressionProcessing.initializeForTests(); ExpressionProcessing.initializeForTests();
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
private static final Logger log = new Logger(SqlGroupByBenchmark.class); private static final Logger log = new Logger(SqlGroupByBenchmark.class);
@ -331,7 +331,7 @@ public class SqlGroupByBenchmark
// Hacky and pollutes global namespace, but it is fine since benchmarks are run in isolation. Wasn't able // Hacky and pollutes global namespace, but it is fine since benchmarks are run in isolation. Wasn't able
// to work up a cleaner way of doing it by modifying the injector. // to work up a cleaner way of doing it by modifying the injector.
CalciteTests.getJsonMapper().registerModules(NestedDataModule.getJacksonModulesList()); CalciteTests.getJsonMapper().registerModules(BuiltInTypesModule.getJacksonModulesList());
final DruidSchemaCatalog rootSchema = final DruidSchemaCatalog rootSchema =
CalciteTests.createMockRootSchema(conglomerate, walker, plannerConfig, AuthTestUtils.TEST_AUTHORIZER_MAPPER); CalciteTests.createMockRootSchema(conglomerate, walker, plannerConfig, AuthTestUtils.TEST_AUTHORIZER_MAPPER);

View File

@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableSet;
import org.apache.druid.data.input.impl.JsonInputFormat; import org.apache.druid.data.input.impl.JsonInputFormat;
import org.apache.druid.data.input.impl.LocalInputSource; import org.apache.druid.data.input.impl.LocalInputSource;
import org.apache.druid.data.input.impl.systemfield.SystemFields; import org.apache.druid.data.input.impl.systemfield.SystemFields;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.msq.indexing.MSQSpec; import org.apache.druid.msq.indexing.MSQSpec;
import org.apache.druid.msq.indexing.MSQTuningConfig; import org.apache.druid.msq.indexing.MSQTuningConfig;
@ -64,7 +64,7 @@ import java.util.Map;
public class MSQComplexGroupByTest extends MSQTestBase public class MSQComplexGroupByTest extends MSQTestBase
{ {
static { static {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
private String dataFileNameJsonString; private String dataFileNameJsonString;
@ -109,7 +109,7 @@ public class MSQComplexGroupByTest extends MSQTestBase
dataFileSignature dataFileSignature
); );
objectMapper.registerModules(NestedDataModule.getJacksonModulesList()); objectMapper.registerModules(BuiltInTypesModule.getJacksonModulesList());
} }
@MethodSource("data") @MethodSource("data")

View File

@ -48,6 +48,7 @@ import org.apache.druid.discovery.NodeRole;
import org.apache.druid.frame.channel.FrameChannelSequence; import org.apache.druid.frame.channel.FrameChannelSequence;
import org.apache.druid.frame.processor.Bouncer; import org.apache.druid.frame.processor.Bouncer;
import org.apache.druid.frame.testutil.FrameTestUtil; import org.apache.druid.frame.testutil.FrameTestUtil;
import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.guice.DruidInjectorBuilder; import org.apache.druid.guice.DruidInjectorBuilder;
import org.apache.druid.guice.DruidSecondaryModule; import org.apache.druid.guice.DruidSecondaryModule;
import org.apache.druid.guice.ExpressionModule; import org.apache.druid.guice.ExpressionModule;
@ -55,7 +56,6 @@ import org.apache.druid.guice.GuiceInjectors;
import org.apache.druid.guice.IndexingServiceTuningConfigModule; import org.apache.druid.guice.IndexingServiceTuningConfigModule;
import org.apache.druid.guice.JoinableFactoryModule; import org.apache.druid.guice.JoinableFactoryModule;
import org.apache.druid.guice.JsonConfigProvider; import org.apache.druid.guice.JsonConfigProvider;
import org.apache.druid.guice.NestedDataModule;
import org.apache.druid.guice.SegmentWranglerModule; import org.apache.druid.guice.SegmentWranglerModule;
import org.apache.druid.guice.StartupInjectorBuilder; import org.apache.druid.guice.StartupInjectorBuilder;
import org.apache.druid.guice.annotations.EscalatedGlobal; import org.apache.druid.guice.annotations.EscalatedGlobal;
@ -357,8 +357,8 @@ public class MSQTestBase extends BaseCalciteQueryTest
{ {
// We want this module to bring InputSourceModule along for the ride. // We want this module to bring InputSourceModule along for the ride.
binder.install(new InputSourceModule()); binder.install(new InputSourceModule());
binder.install(new NestedDataModule()); binder.install(new BuiltInTypesModule());
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
SqlBindings.addOperatorConversion(binder, ExternalOperatorConversion.class); SqlBindings.addOperatorConversion(binder, ExternalOperatorConversion.class);
SqlBindings.addOperatorConversion(binder, HttpOperatorConversion.class); SqlBindings.addOperatorConversion(binder, HttpOperatorConversion.class);
SqlBindings.addOperatorConversion(binder, InlineOperatorConversion.class); SqlBindings.addOperatorConversion(binder, InlineOperatorConversion.class);
@ -521,7 +521,7 @@ public class MSQTestBase extends BaseCalciteQueryTest
objectMapper = setupObjectMapper(injector); objectMapper = setupObjectMapper(injector);
objectMapper.registerModules(new StorageConnectorModule().getJacksonModules()); objectMapper.registerModules(new StorageConnectorModule().getJacksonModules());
objectMapper.registerModules(sqlModule.getJacksonModules()); objectMapper.registerModules(sqlModule.getJacksonModules());
objectMapper.registerModules(NestedDataModule.getJacksonModulesList()); objectMapper.registerModules(BuiltInTypesModule.getJacksonModulesList());
doReturn(mock(Request.class)).when(brokerClient).makeRequest(any(), anyString()); doReturn(mock(Request.class)).when(brokerClient).makeRequest(any(), anyString());

View File

@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.guice.annotations.PublicApi; import org.apache.druid.guice.annotations.PublicApi;
import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.emitter.EmittingLogger; import org.apache.druid.java.util.emitter.EmittingLogger;
@ -110,10 +111,9 @@ public abstract class DimensionSchema
return name == null ? ofDefault() : valueOf(StringUtils.toUpperCase(name)); return name == null ? ofDefault() : valueOf(StringUtils.toUpperCase(name));
} }
// this can be system configuration
public static MultiValueHandling ofDefault() public static MultiValueHandling ofDefault()
{ {
return SORTED_ARRAY; return BuiltInTypesModule.getStringMultiValueHandlingMode();
} }
} }

View File

@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import com.google.inject.Binder; import com.google.inject.Binder;
import com.google.inject.Provides; import com.google.inject.Provides;
import org.apache.druid.data.input.impl.DimensionSchema;
import org.apache.druid.initialization.DruidModule; import org.apache.druid.initialization.DruidModule;
import org.apache.druid.segment.DefaultColumnFormatConfig; import org.apache.druid.segment.DefaultColumnFormatConfig;
import org.apache.druid.segment.DimensionHandler; import org.apache.druid.segment.DimensionHandler;
@ -38,11 +39,19 @@ import org.apache.druid.segment.nested.StructuredDataJsonSerializer;
import org.apache.druid.segment.serde.ComplexMetrics; import org.apache.druid.segment.serde.ComplexMetrics;
import org.apache.druid.segment.virtual.NestedFieldVirtualColumn; import org.apache.druid.segment.virtual.NestedFieldVirtualColumn;
import javax.annotation.Nullable;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class NestedDataModule implements DruidModule public class BuiltInTypesModule implements DruidModule
{ {
/**
* Initialized with a default value so tests can just get it via {@link #getStringMultiValueHandlingMode} without any
* explicit initialization. In production, this default may be overridden if a value is configured via
* {@link #initDimensionHandlerAndMvHandlingMode(DefaultColumnFormatConfig)}.
*/
private static DimensionSchema.MultiValueHandling STRING_MV_MODE = DimensionSchema.MultiValueHandling.SORTED_ARRAY;
@Override @Override
public List<? extends Module> getJacksonModules() public List<? extends Module> getJacksonModules()
{ {
@ -53,14 +62,15 @@ public class NestedDataModule implements DruidModule
public void configure(Binder binder) public void configure(Binder binder)
{ {
registerSerde(); registerSerde();
// binding our side effect class to the lifecycle causes registerHandler to be called on service start, allowing // binding our side effect classes to the lifecycle causes the initDimensionHandlerAndMvHandlingMode to be
// use of the config to get the system default format version // called on service start, allowing use of the config to get the system default format version and string multi
LifecycleModule.register(binder, SideEffectHandlerRegisterer.class); // value handling mode.
LifecycleModule.register(binder, SideEffectRegisterer.class);
} }
@Provides @Provides
@LazySingleton @LazySingleton
public SideEffectHandlerRegisterer registerHandler(DefaultColumnFormatConfig formatsConfig) public SideEffectRegisterer initDimensionHandlerAndMvHandlingMode(DefaultColumnFormatConfig formatsConfig)
{ {
if (formatsConfig.getNestedColumnFormatVersion() != null && formatsConfig.getNestedColumnFormatVersion() == 4) { if (formatsConfig.getNestedColumnFormatVersion() != null && formatsConfig.getNestedColumnFormatVersion() == 4) {
DimensionHandlerUtils.registerDimensionHandlerProvider( DimensionHandlerUtils.registerDimensionHandlerProvider(
@ -73,7 +83,25 @@ public class NestedDataModule implements DruidModule
new NestedCommonFormatHandlerProvider() new NestedCommonFormatHandlerProvider()
); );
} }
return new SideEffectHandlerRegisterer();
setStringMultiValueHandlingModeIfConfigured(formatsConfig.getStringMultiValueHandlingMode());
return new SideEffectRegisterer();
}
private static void setStringMultiValueHandlingModeIfConfigured(@Nullable String stringMultiValueHandlingMode)
{
if (stringMultiValueHandlingMode != null) {
STRING_MV_MODE = DimensionSchema.MultiValueHandling.fromString(stringMultiValueHandlingMode);
}
}
/**
* @return the configured string multi value handling mode from the system config if set; otherwise, returns
* the default.
*/
public static DimensionSchema.MultiValueHandling getStringMultiValueHandlingMode()
{
return STRING_MV_MODE;
} }
public static List<SimpleModule> getJacksonModulesList() public static List<SimpleModule> getJacksonModulesList()
@ -126,13 +154,15 @@ public class NestedDataModule implements DruidModule
return new NestedDataColumnHandlerV4(dimensionName); return new NestedDataColumnHandlerV4(dimensionName);
} }
} }
/** /**
* this is used as a vehicle to register the correct version of the system default nested column handler by side * this is used as a vehicle to register the correct version of the system default nested column handler and multi
* effect with the help of binding to {@link org.apache.druid.java.util.common.lifecycle.Lifecycle} so that * value handling mode by side effect with the help of binding to
* {@link #registerHandler(DefaultColumnFormatConfig)} can be called with the injected * {@link org.apache.druid.java.util.common.lifecycle.Lifecycle} so that
* {@link #initDimensionHandlerAndMvHandlingMode(DefaultColumnFormatConfig)} can be called with the injected
* {@link DefaultColumnFormatConfig}. * {@link DefaultColumnFormatConfig}.
*/ */
public static class SideEffectHandlerRegisterer public static class SideEffectRegisterer
{ {
// nothing to see here // nothing to see here
} }

View File

@ -21,9 +21,11 @@ package org.apache.druid.segment;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.druid.data.input.impl.DimensionSchema;
import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidException;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.Objects; import java.util.Objects;
public class DefaultColumnFormatConfig public class DefaultColumnFormatConfig
@ -39,16 +41,44 @@ public class DefaultColumnFormatConfig
} }
} }
private static void validateMultiValueHandlingMode(@Nullable String stringMultiValueHandlingMode)
{
if (stringMultiValueHandlingMode != null) {
try {
DimensionSchema.MultiValueHandling.fromString(stringMultiValueHandlingMode);
}
catch (IllegalArgumentException e) {
throw DruidException.forPersona(DruidException.Persona.OPERATOR)
.ofCategory(DruidException.Category.INVALID_INPUT)
.build(
"Invalid value[%s] specified for 'druid.indexing.formats.stringMultiValueHandlingMode'."
+ " Supported values are [%s].",
stringMultiValueHandlingMode,
Arrays.toString(DimensionSchema.MultiValueHandling.values())
);
}
}
}
@Nullable
@JsonProperty("nestedColumnFormatVersion") @JsonProperty("nestedColumnFormatVersion")
private final Integer nestedColumnFormatVersion; private final Integer nestedColumnFormatVersion;
@Nullable
@JsonProperty("stringMultiValueHandlingMode")
private final String stringMultiValueHandlingMode;
@JsonCreator @JsonCreator
public DefaultColumnFormatConfig( public DefaultColumnFormatConfig(
@JsonProperty("nestedColumnFormatVersion") @Nullable Integer nestedColumnFormatVersion @JsonProperty("nestedColumnFormatVersion") @Nullable Integer nestedColumnFormatVersion,
@JsonProperty("stringMultiValueHandlingMode") @Nullable String stringMultiValueHandlingMode
) )
{ {
validateNestedFormatVersion(nestedColumnFormatVersion);
validateMultiValueHandlingMode(stringMultiValueHandlingMode);
this.nestedColumnFormatVersion = nestedColumnFormatVersion; this.nestedColumnFormatVersion = nestedColumnFormatVersion;
validateNestedFormatVersion(this.nestedColumnFormatVersion); this.stringMultiValueHandlingMode = stringMultiValueHandlingMode;
} }
@Nullable @Nullable
@ -58,6 +88,13 @@ public class DefaultColumnFormatConfig
return nestedColumnFormatVersion; return nestedColumnFormatVersion;
} }
@Nullable
@JsonProperty("stringMultiValueHandlingMode")
public String getStringMultiValueHandlingMode()
{
return stringMultiValueHandlingMode;
}
@Override @Override
public boolean equals(Object o) public boolean equals(Object o)
{ {
@ -68,13 +105,14 @@ public class DefaultColumnFormatConfig
return false; return false;
} }
DefaultColumnFormatConfig that = (DefaultColumnFormatConfig) o; DefaultColumnFormatConfig that = (DefaultColumnFormatConfig) o;
return Objects.equals(nestedColumnFormatVersion, that.nestedColumnFormatVersion); return Objects.equals(nestedColumnFormatVersion, that.nestedColumnFormatVersion)
&& Objects.equals(stringMultiValueHandlingMode, that.stringMultiValueHandlingMode);
} }
@Override @Override
public int hashCode() public int hashCode()
{ {
return Objects.hash(nestedColumnFormatVersion); return Objects.hash(nestedColumnFormatVersion, stringMultiValueHandlingMode);
} }
@Override @Override
@ -82,6 +120,7 @@ public class DefaultColumnFormatConfig
{ {
return "DefaultColumnFormatConfig{" + return "DefaultColumnFormatConfig{" +
"nestedColumnFormatVersion=" + nestedColumnFormatVersion + "nestedColumnFormatVersion=" + nestedColumnFormatVersion +
", stringMultiValueHandlingMode=" + stringMultiValueHandlingMode +
'}'; '}';
} }
} }

View File

@ -66,7 +66,7 @@ public class StringDimensionIndexer extends DictionaryEncodedColumnIndexer<int[]
private volatile boolean hasMultipleValues = false; private volatile boolean hasMultipleValues = false;
public StringDimensionIndexer( public StringDimensionIndexer(
MultiValueHandling multiValueHandling, @Nullable MultiValueHandling multiValueHandling,
boolean hasBitmapIndexes, boolean hasBitmapIndexes,
boolean hasSpatialIndexes, boolean hasSpatialIndexes,
boolean useMaxMemoryEstimates boolean useMaxMemoryEstimates

View File

@ -25,7 +25,7 @@ import com.fasterxml.jackson.dataformat.smile.SmileFactory;
import com.fasterxml.jackson.dataformat.smile.SmileGenerator; import com.fasterxml.jackson.dataformat.smile.SmileGenerator;
import it.unimi.dsi.fastutil.Hash; import it.unimi.dsi.fastutil.Hash;
import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.data.input.impl.DimensionSchema;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.jackson.DefaultObjectMapper;
import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.guava.Comparators; import org.apache.druid.java.util.common.guava.Comparators;
@ -62,7 +62,7 @@ public class NestedDataComplexTypeSerde extends ComplexMetricSerde
smileFactory.delegateToTextual(true); smileFactory.delegateToTextual(true);
final ObjectMapper mapper = new DefaultObjectMapper(smileFactory, null); final ObjectMapper mapper = new DefaultObjectMapper(smileFactory, null);
mapper.getFactory().setCodec(mapper); mapper.getFactory().setCodec(mapper);
mapper.registerModules(NestedDataModule.getJacksonModulesList()); mapper.registerModules(BuiltInTypesModule.getJacksonModulesList());
OBJECT_MAPPER = mapper; OBJECT_MAPPER = mapper;
} }

View File

@ -37,7 +37,7 @@ import org.apache.druid.frame.read.FrameReader;
import org.apache.druid.frame.segment.FrameSegment; import org.apache.druid.frame.segment.FrameSegment;
import org.apache.druid.frame.segment.FrameStorageAdapter; import org.apache.druid.frame.segment.FrameStorageAdapter;
import org.apache.druid.frame.testutil.FrameTestUtil; import org.apache.druid.frame.testutil.FrameTestUtil;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.RE; import org.apache.druid.java.util.common.RE;
@ -92,7 +92,7 @@ public class FrameWriterTest extends InitializedNullHandlingTest
static { static {
ComplexMetrics.registerSerde(HyperUniquesSerde.TYPE_NAME, new HyperUniquesSerde()); ComplexMetrics.registerSerde(HyperUniquesSerde.TYPE_NAME, new HyperUniquesSerde());
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
private static final int DEFAULT_ALLOCATOR_CAPACITY = 1_000_000; private static final int DEFAULT_ALLOCATOR_CAPACITY = 1_000_000;

View File

@ -21,6 +21,7 @@ package org.apache.druid.guice;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.inject.Injector; import com.google.inject.Injector;
import org.apache.druid.data.input.impl.DimensionSchema;
import org.apache.druid.segment.DefaultColumnFormatConfig; import org.apache.druid.segment.DefaultColumnFormatConfig;
import org.apache.druid.segment.DimensionHandlerProvider; import org.apache.druid.segment.DimensionHandlerProvider;
import org.apache.druid.segment.DimensionHandlerUtils; import org.apache.druid.segment.DimensionHandlerUtils;
@ -35,7 +36,7 @@ import org.junit.Test;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.Properties; import java.util.Properties;
public class NestedDataModuleTest public class BuiltInTypesModuleTest
{ {
@Nullable @Nullable
private static DimensionHandlerProvider DEFAULT_HANDLER_PROVIDER; private static DimensionHandlerProvider DEFAULT_HANDLER_PROVIDER;
@ -69,12 +70,17 @@ public class NestedDataModuleTest
Injector gadget = makeInjector(props); Injector gadget = makeInjector(props);
// side effects // side effects
gadget.getInstance(NestedDataModule.SideEffectHandlerRegisterer.class); gadget.getInstance(BuiltInTypesModule.SideEffectRegisterer.class);
DimensionHandlerProvider provider = DimensionHandlerUtils.DIMENSION_HANDLER_PROVIDERS.get( DimensionHandlerProvider provider = DimensionHandlerUtils.DIMENSION_HANDLER_PROVIDERS.get(
NestedDataComplexTypeSerde.TYPE_NAME NestedDataComplexTypeSerde.TYPE_NAME
); );
Assert.assertTrue(provider.get("test") instanceof NestedCommonFormatColumnHandler); Assert.assertTrue(provider.get("test") instanceof NestedCommonFormatColumnHandler);
Assert.assertEquals(
DimensionSchema.MultiValueHandling.SORTED_ARRAY,
BuiltInTypesModule.getStringMultiValueHandlingMode()
);
} }
@Test @Test
@ -82,16 +88,54 @@ public class NestedDataModuleTest
{ {
DimensionHandlerUtils.DIMENSION_HANDLER_PROVIDERS.remove(NestedDataComplexTypeSerde.TYPE_NAME); DimensionHandlerUtils.DIMENSION_HANDLER_PROVIDERS.remove(NestedDataComplexTypeSerde.TYPE_NAME);
Properties props = new Properties(); Properties props = new Properties();
props.put("druid.indexing.formats.nestedColumnFormatVersion", "4"); props.setProperty("druid.indexing.formats.nestedColumnFormatVersion", "4");
props.setProperty("druid.indexing.formats.stringMultiValueHandlingMode", "sorted_array");
Injector gadget = makeInjector(props); Injector gadget = makeInjector(props);
// side effects // side effects
gadget.getInstance(NestedDataModule.SideEffectHandlerRegisterer.class); gadget.getInstance(BuiltInTypesModule.SideEffectRegisterer.class);
DimensionHandlerProvider provider = DimensionHandlerUtils.DIMENSION_HANDLER_PROVIDERS.get( DimensionHandlerProvider provider = DimensionHandlerUtils.DIMENSION_HANDLER_PROVIDERS.get(
NestedDataComplexTypeSerde.TYPE_NAME NestedDataComplexTypeSerde.TYPE_NAME
); );
Assert.assertTrue(provider.get("test") instanceof NestedDataColumnHandlerV4); Assert.assertTrue(provider.get("test") instanceof NestedDataColumnHandlerV4);
Assert.assertEquals(
DimensionSchema.MultiValueHandling.SORTED_ARRAY,
BuiltInTypesModule.getStringMultiValueHandlingMode()
);
}
@Test
public void testOverrideMultiValueHandlingModeCaseInsensitive()
{
final Properties props = new Properties();
props.setProperty("druid.indexing.formats.stringMultiValueHandlingMode", "ARRAY");
final Injector gadget = makeInjector(props);
gadget.getInstance(BuiltInTypesModule.SideEffectRegisterer.class);
Assert.assertEquals(
DimensionSchema.MultiValueHandling.ARRAY,
BuiltInTypesModule.getStringMultiValueHandlingMode()
);
}
@Test
public void testInvalidMultiValueHandlingMode()
{
final Properties props = new Properties();
props.setProperty("druid.indexing.formats.stringMultiValueHandlingMode", "boo");
final Injector gadget = makeInjector(props);
final Exception exception = Assert.assertThrows(
Exception.class,
() -> gadget.getInstance(BuiltInTypesModule.SideEffectRegisterer.class)
);
Assert.assertTrue(exception.getMessage().contains(
"Invalid value[boo] specified for 'druid.indexing.formats.stringMultiValueHandlingMode'."
+ " Supported values are [[SORTED_ARRAY, SORTED_SET, ARRAY]]."
));
} }
private Injector makeInjector(Properties props) private Injector makeInjector(Properties props)
@ -104,7 +148,7 @@ public class NestedDataModuleTest
binder -> { binder -> {
JsonConfigProvider.bind(binder, "druid.indexing.formats", DefaultColumnFormatConfig.class); JsonConfigProvider.bind(binder, "druid.indexing.formats", DefaultColumnFormatConfig.class);
}, },
new NestedDataModule() new BuiltInTypesModule()
) )
); );

View File

@ -24,7 +24,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidException;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.IAE;
import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.StringUtils;
@ -66,7 +66,7 @@ public class FunctionTest extends InitializedNullHandlingTest
TypeStrategiesTest.NULLABLE_TEST_PAIR_TYPE.getComplexTypeName(), TypeStrategiesTest.NULLABLE_TEST_PAIR_TYPE.getComplexTypeName(),
new TypeStrategiesTest.NullableLongPairTypeStrategy() new TypeStrategiesTest.NullableLongPairTypeStrategy()
); );
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Before @Before

View File

@ -31,7 +31,7 @@ import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.impl.JsonInputFormat; import org.apache.druid.data.input.impl.JsonInputFormat;
import org.apache.druid.data.input.impl.LocalInputSource; import org.apache.druid.data.input.impl.LocalInputSource;
import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.granularity.Granularity; import org.apache.druid.java.util.common.granularity.Granularity;
@ -166,7 +166,7 @@ public class NestedDataTestUtils
static { static {
JSON_MAPPER = TestHelper.makeJsonMapper(); JSON_MAPPER = TestHelper.makeJsonMapper();
JSON_MAPPER.registerModules(NestedDataModule.getJacksonModulesList()); JSON_MAPPER.registerModules(BuiltInTypesModule.getJacksonModulesList());
} }
public static List<Segment> createSimpleSegmentsTsv( public static List<Segment> createSimpleSegmentsTsv(

View File

@ -22,7 +22,7 @@ package org.apache.druid.query.groupby;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
@ -82,10 +82,10 @@ public class NestedDataGroupByQueryTest extends InitializedNullHandlingTest
String vectorize String vectorize
) )
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
this.vectorize = QueryContexts.Vectorize.fromString(vectorize); this.vectorize = QueryContexts.Vectorize.fromString(vectorize);
this.helper = AggregationTestHelper.createGroupByQueryAggregationTestHelper( this.helper = AggregationTestHelper.createGroupByQueryAggregationTestHelper(
NestedDataModule.getJacksonModulesList(), BuiltInTypesModule.getJacksonModulesList(),
config, config,
tempFolder tempFolder
); );

View File

@ -22,7 +22,7 @@ package org.apache.druid.query.groupby;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
@ -74,10 +74,10 @@ public class NestedGroupByArrayQueryTest
String vectorize String vectorize
) )
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
this.vectorize = QueryContexts.Vectorize.fromString(vectorize); this.vectorize = QueryContexts.Vectorize.fromString(vectorize);
this.helper = AggregationTestHelper.createGroupByQueryAggregationTestHelper( this.helper = AggregationTestHelper.createGroupByQueryAggregationTestHelper(
NestedDataModule.getJacksonModulesList(), BuiltInTypesModule.getJacksonModulesList(),
config, config,
tempFolder tempFolder
); );

View File

@ -21,7 +21,7 @@ package org.apache.druid.query.groupby.epinephelinae.column;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.query.IterableRowsCursorHelper; import org.apache.druid.query.IterableRowsCursorHelper;
import org.apache.druid.query.groupby.ResultRow; import org.apache.druid.query.groupby.ResultRow;
import org.apache.druid.query.groupby.epinephelinae.GroupByColumnSelectorStrategyFactory; import org.apache.druid.query.groupby.epinephelinae.GroupByColumnSelectorStrategyFactory;
@ -44,7 +44,7 @@ import java.util.List;
public class NestedColumnGroupByColumnSelectorStrategyTest extends InitializedNullHandlingTest public class NestedColumnGroupByColumnSelectorStrategyTest extends InitializedNullHandlingTest
{ {
static { static {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
private static final GroupByColumnSelectorStrategyFactory STRATEGY_FACTORY = new GroupByColumnSelectorStrategyFactory(); private static final GroupByColumnSelectorStrategyFactory STRATEGY_FACTORY = new GroupByColumnSelectorStrategyFactory();

View File

@ -24,7 +24,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.guava.Sequence;
@ -78,8 +78,8 @@ public class NestedDataScanQueryTest extends InitializedNullHandlingTest
public NestedDataScanQueryTest() public NestedDataScanQueryTest()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
List<? extends Module> mods = NestedDataModule.getJacksonModulesList(); List<? extends Module> mods = BuiltInTypesModule.getJacksonModulesList();
this.helper = AggregationTestHelper.createScanQueryAggregationTestHelper(mods, tempFolder); this.helper = AggregationTestHelper.createScanQueryAggregationTestHelper(mods, tempFolder);
this.closer = Closer.create(); this.closer = Closer.create();
} }

View File

@ -22,7 +22,7 @@ package org.apache.druid.query.timeseries;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
@ -98,7 +98,7 @@ public class NestedDataTimeseriesQueryTest extends InitializedNullHandlingTest
) )
{ {
this.helper = AggregationTestHelper.createTimeseriesQueryAggregationTestHelper( this.helper = AggregationTestHelper.createTimeseriesQueryAggregationTestHelper(
NestedDataModule.getJacksonModulesList(), BuiltInTypesModule.getJacksonModulesList(),
tempFolder tempFolder
); );
this.segmentsGenerator = segmentsGenerator; this.segmentsGenerator = segmentsGenerator;

View File

@ -21,7 +21,7 @@ package org.apache.druid.query.topn;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
@ -72,9 +72,9 @@ public class NestedDataTopNQueryTest extends InitializedNullHandlingTest
BiFunction<TemporaryFolder, Closer, List<Segment>> segmentGenerator BiFunction<TemporaryFolder, Closer, List<Segment>> segmentGenerator
) )
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
this.helper = AggregationTestHelper.createTopNQueryAggregationTestHelper( this.helper = AggregationTestHelper.createTopNQueryAggregationTestHelper(
NestedDataModule.getJacksonModulesList(), BuiltInTypesModule.getJacksonModulesList(),
tempFolder tempFolder
); );
this.segmentsGenerator = segmentGenerator; this.segmentsGenerator = segmentGenerator;

View File

@ -25,7 +25,7 @@ import org.apache.druid.common.config.NullHandling;
import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.MapBasedInputRow;
import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.guava.Sequence;
@ -62,7 +62,7 @@ public class AutoTypeColumnIndexerTest extends InitializedNullHandlingTest
@BeforeClass @BeforeClass
public static void setup() public static void setup()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Test @Test

View File

@ -22,6 +22,7 @@ package org.apache.druid.segment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifier;
import org.apache.druid.data.input.impl.DimensionSchema;
import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.jackson.DefaultObjectMapper;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
@ -33,21 +34,23 @@ public class DefaultColumnFormatsConfigTest
@Test @Test
public void testDefaultsSerde() throws JsonProcessingException public void testDefaultsSerde() throws JsonProcessingException
{ {
DefaultColumnFormatConfig defaultColumnFormatConfig = new DefaultColumnFormatConfig(null); DefaultColumnFormatConfig defaultColumnFormatConfig = new DefaultColumnFormatConfig(null, null);
String there = MAPPER.writeValueAsString(defaultColumnFormatConfig); String there = MAPPER.writeValueAsString(defaultColumnFormatConfig);
DefaultColumnFormatConfig andBack = MAPPER.readValue(there, DefaultColumnFormatConfig.class); DefaultColumnFormatConfig andBack = MAPPER.readValue(there, DefaultColumnFormatConfig.class);
Assert.assertEquals(defaultColumnFormatConfig, andBack); Assert.assertEquals(defaultColumnFormatConfig, andBack);
Assert.assertNull(andBack.getNestedColumnFormatVersion()); Assert.assertNull(andBack.getNestedColumnFormatVersion());
Assert.assertNull(andBack.getStringMultiValueHandlingMode());
} }
@Test @Test
public void testDefaultsSerdeOverride() throws JsonProcessingException public void testDefaultsSerdeOverride() throws JsonProcessingException
{ {
DefaultColumnFormatConfig defaultColumnFormatConfig = new DefaultColumnFormatConfig(4); DefaultColumnFormatConfig defaultColumnFormatConfig = new DefaultColumnFormatConfig(4, "ARRAY");
String there = MAPPER.writeValueAsString(defaultColumnFormatConfig); String there = MAPPER.writeValueAsString(defaultColumnFormatConfig);
DefaultColumnFormatConfig andBack = MAPPER.readValue(there, DefaultColumnFormatConfig.class); DefaultColumnFormatConfig andBack = MAPPER.readValue(there, DefaultColumnFormatConfig.class);
Assert.assertEquals(defaultColumnFormatConfig, andBack); Assert.assertEquals(defaultColumnFormatConfig, andBack);
Assert.assertEquals(4, (int) andBack.getNestedColumnFormatVersion()); Assert.assertEquals(4, (int) andBack.getNestedColumnFormatVersion());
Assert.assertEquals(DimensionSchema.MultiValueHandling.ARRAY.toString(), andBack.getStringMultiValueHandlingMode());
} }
@Test @Test

View File

@ -25,7 +25,7 @@ import org.apache.druid.common.config.NullHandling;
import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.MapBasedInputRow;
import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.guava.Sequence;
@ -61,7 +61,7 @@ public class NestedDataColumnIndexerV4Test extends InitializedNullHandlingTest
@BeforeClass @BeforeClass
public static void setup() public static void setup()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Test @Test

View File

@ -29,8 +29,8 @@ import org.junit.Test;
public class NestedDataColumnSchemaTest public class NestedDataColumnSchemaTest
{ {
private static final DefaultColumnFormatConfig DEFAULT_CONFIG = new DefaultColumnFormatConfig(null); private static final DefaultColumnFormatConfig DEFAULT_CONFIG = new DefaultColumnFormatConfig(null, null);
private static final DefaultColumnFormatConfig DEFAULT_CONFIG_V4 = new DefaultColumnFormatConfig(4); private static final DefaultColumnFormatConfig DEFAULT_CONFIG_V4 = new DefaultColumnFormatConfig(4, null);
private static final ObjectMapper MAPPER; private static final ObjectMapper MAPPER;
private static final ObjectMapper MAPPER_V4; private static final ObjectMapper MAPPER_V4;

View File

@ -33,7 +33,7 @@ import org.apache.druid.common.config.NullHandling;
import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.MapBasedInputRow;
import org.apache.druid.data.input.Row; import org.apache.druid.data.input.Row;
import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
@ -104,7 +104,7 @@ public class IncrementalIndexTest extends InitializedNullHandlingTest
public IncrementalIndexTest(String indexType, String mode, boolean isPreserveExistingMetrics) throws JsonProcessingException public IncrementalIndexTest(String indexType, String mode, boolean isPreserveExistingMetrics) throws JsonProcessingException
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
this.isPreserveExistingMetrics = isPreserveExistingMetrics; this.isPreserveExistingMetrics = isPreserveExistingMetrics;
indexCreator = closer.closeLater(new IncrementalIndexCreator(indexType, (builder, args) -> builder indexCreator = closer.closeLater(new IncrementalIndexCreator(indexType, (builder, args) -> builder
.setSimpleTestingIndexSchema("rollup".equals(mode), isPreserveExistingMetrics, (AggregatorFactory[]) args[0]) .setSimpleTestingIndexSchema("rollup".equals(mode), isPreserveExistingMetrics, (AggregatorFactory[]) args[0])

View File

@ -27,7 +27,7 @@ import com.google.common.collect.ImmutableMap;
import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifier;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidException;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.jackson.DefaultObjectMapper;
import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.Pair;
import org.apache.druid.query.filter.ArrayContainsElementFilter; import org.apache.druid.query.filter.ArrayContainsElementFilter;
@ -1071,7 +1071,7 @@ public class ArrayContainsElementFilterTests
Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f2.getCacheKey())); Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f2.getCacheKey()));
Assert.assertArrayEquals(f1.getCacheKey(), f3.getCacheKey()); Assert.assertArrayEquals(f1.getCacheKey(), f3.getCacheKey());
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
f1 = new ArrayContainsElementFilter( f1 = new ArrayContainsElementFilter(
"x", "x",
ColumnType.NESTED_DATA, ColumnType.NESTED_DATA,

View File

@ -41,7 +41,7 @@ import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.frame.FrameType; import org.apache.druid.frame.FrameType;
import org.apache.druid.frame.segment.FrameSegment; import org.apache.druid.frame.segment.FrameSegment;
import org.apache.druid.frame.segment.FrameStorageAdapter; import org.apache.druid.frame.segment.FrameStorageAdapter;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
@ -445,7 +445,7 @@ public abstract class BaseFilterTest extends InitializedNullHandlingTest
@Before @Before
public void setUp() throws Exception public void setUp() throws Exception
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
String className = getClass().getName(); String className = getClass().getName();
Map<String, Pair<StorageAdapter, Closeable>> adaptersForClass = adapterCache.get().get(className); Map<String, Pair<StorageAdapter, Closeable>> adaptersForClass = adapterCache.get().get(className);
if (adaptersForClass == null) { if (adaptersForClass == null) {

View File

@ -30,7 +30,7 @@ import com.google.common.collect.TreeRangeSet;
import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifier;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidException;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.jackson.DefaultObjectMapper;
import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.Pair;
import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExprEval;
@ -1760,7 +1760,7 @@ public class EqualityFilterTests
Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f2.getCacheKey())); Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f2.getCacheKey()));
Assert.assertArrayEquals(f1.getCacheKey(), f3.getCacheKey()); Assert.assertArrayEquals(f1.getCacheKey(), f3.getCacheKey());
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
f1 = new EqualityFilter("x", ColumnType.NESTED_DATA, ImmutableMap.of("x", ImmutableList.of(1, 2, 3)), null); f1 = new EqualityFilter("x", ColumnType.NESTED_DATA, ImmutableMap.of("x", ImmutableList.of(1, 2, 3)), null);
f1_2 = new EqualityFilter("x", ColumnType.NESTED_DATA, ImmutableMap.of("x", ImmutableList.of(1, 2, 3)), null); f1_2 = new EqualityFilter("x", ColumnType.NESTED_DATA, ImmutableMap.of("x", ImmutableList.of(1, 2, 3)), null);
f2 = new EqualityFilter("x", ColumnType.NESTED_DATA, ImmutableMap.of("x", ImmutableList.of(1, 2, 3, 4)), null); f2 = new EqualityFilter("x", ColumnType.NESTED_DATA, ImmutableMap.of("x", ImmutableList.of(1, 2, 3, 4)), null);

View File

@ -26,7 +26,7 @@ import org.apache.druid.data.input.InputRowSchema;
import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.impl.MapInputRowParser; import org.apache.druid.data.input.impl.MapInputRowParser;
import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.FileUtils;
import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.StringUtils;
@ -140,7 +140,7 @@ public class SegmentGenerator implements Closeable
{ {
// In case we need to generate hyperUniques or json // In case we need to generate hyperUniques or json
ComplexMetrics.registerSerde(HyperUniquesSerde.TYPE_NAME, new HyperUniquesSerde()); ComplexMetrics.registerSerde(HyperUniquesSerde.TYPE_NAME, new HyperUniquesSerde());
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
final String dataHash = Hashing.sha256() final String dataHash = Hashing.sha256()
.newHasher() .newHasher()

View File

@ -22,7 +22,7 @@ package org.apache.druid.segment.incremental;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.MapBasedInputRow;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.query.aggregation.Aggregator;
import org.apache.druid.query.aggregation.LongMaxAggregator; import org.apache.druid.query.aggregation.LongMaxAggregator;
@ -50,7 +50,7 @@ public class IncrementalIndexIngestionTest extends InitializedNullHandlingTest
public IncrementalIndexIngestionTest(String indexType) throws JsonProcessingException public IncrementalIndexIngestionTest(String indexType) throws JsonProcessingException
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
indexCreator = closer.closeLater(new IncrementalIndexCreator(indexType, (builder, args) -> builder indexCreator = closer.closeLater(new IncrementalIndexCreator(indexType, (builder, args) -> builder
.setIndexSchema((IncrementalIndexSchema) args[0]) .setIndexSchema((IncrementalIndexSchema) args[0])
.setMaxRowCount(MAX_ROWS) .setMaxRowCount(MAX_ROWS)

View File

@ -27,7 +27,7 @@ import org.apache.druid.data.input.impl.DimensionSchema;
import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.impl.StringDimensionSchema; import org.apache.druid.data.input.impl.StringDimensionSchema;
import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.AggregatorFactory;
import org.apache.druid.segment.CloserRule; import org.apache.druid.segment.CloserRule;
@ -56,7 +56,7 @@ public class IncrementalIndexMultiValueSpecTest extends InitializedNullHandlingT
public IncrementalIndexMultiValueSpecTest(String indexType) throws JsonProcessingException public IncrementalIndexMultiValueSpecTest(String indexType) throws JsonProcessingException
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
indexCreator = closer.closeLater(new IncrementalIndexCreator(indexType, (builder, args) -> builder indexCreator = closer.closeLater(new IncrementalIndexCreator(indexType, (builder, args) -> builder
.setIndexSchema((IncrementalIndexSchema) args[0]) .setIndexSchema((IncrementalIndexSchema) args[0])
.setMaxRowCount(10_000) .setMaxRowCount(10_000)

View File

@ -27,7 +27,7 @@ import org.apache.druid.collections.CloseableStupidPool;
import org.apache.druid.collections.ResourceHolder; import org.apache.druid.collections.ResourceHolder;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.MapBasedInputRow;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
@ -97,7 +97,7 @@ public class IncrementalIndexStorageAdapterTest extends InitializedNullHandlingT
public IncrementalIndexStorageAdapterTest(String indexType) throws JsonProcessingException public IncrementalIndexStorageAdapterTest(String indexType) throws JsonProcessingException
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
indexCreator = closer.closeLater(new IncrementalIndexCreator(indexType, (builder, args) -> builder indexCreator = closer.closeLater(new IncrementalIndexCreator(indexType, (builder, args) -> builder
.setSimpleTestingIndexSchema(new CountAggregatorFactory("cnt")) .setSimpleTestingIndexSchema(new CountAggregatorFactory("cnt"))
.setMaxRowCount(1_000) .setMaxRowCount(1_000)

View File

@ -29,7 +29,7 @@ import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.ImmutableBitmap;
import org.apache.druid.collections.bitmap.WrappedRoaringBitmap; import org.apache.druid.collections.bitmap.WrappedRoaringBitmap;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.concurrent.Execs;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher;
@ -149,7 +149,7 @@ public class NestedDataColumnSupplierTest extends InitializedNullHandlingTest
@BeforeClass @BeforeClass
public static void staticSetup() public static void staticSetup()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Before @Before

View File

@ -28,7 +28,7 @@ import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.collections.bitmap.RoaringBitmapFactory; import org.apache.druid.collections.bitmap.RoaringBitmapFactory;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.concurrent.Execs;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher;
@ -141,7 +141,7 @@ public class NestedDataColumnSupplierV4Test extends InitializedNullHandlingTest
@BeforeClass @BeforeClass
public static void staticSetup() public static void staticSetup()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Before @Before

View File

@ -22,7 +22,7 @@ package org.apache.druid.segment.nested;
import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.Module;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidException;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.guava.Sequence;
@ -81,8 +81,8 @@ public class NestedFieldColumnSelectorsTest extends InitializedNullHandlingTest
public NestedFieldColumnSelectorsTest() public NestedFieldColumnSelectorsTest()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
List<? extends Module> mods = NestedDataModule.getJacksonModulesList(); List<? extends Module> mods = BuiltInTypesModule.getJacksonModulesList();
this.helper = AggregationTestHelper.createScanQueryAggregationTestHelper( this.helper = AggregationTestHelper.createScanQueryAggregationTestHelper(
mods, mods,
tempFolder tempFolder

View File

@ -26,7 +26,7 @@ import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.concurrent.Execs;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher;
@ -105,7 +105,7 @@ public class ScalarDoubleColumnSupplierTest extends InitializedNullHandlingTest
@BeforeClass @BeforeClass
public static void staticSetup() public static void staticSetup()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Before @Before

View File

@ -26,7 +26,7 @@ import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.concurrent.Execs;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher;
@ -105,7 +105,7 @@ public class ScalarLongColumnSupplierTest extends InitializedNullHandlingTest
@BeforeClass @BeforeClass
public static void staticSetup() public static void staticSetup()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Before @Before

View File

@ -26,7 +26,7 @@ import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.concurrent.Execs;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher;
@ -105,7 +105,7 @@ public class ScalarStringColumnSupplierTest extends InitializedNullHandlingTest
@BeforeClass @BeforeClass
public static void staticSetup() public static void staticSetup()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Before @Before

View File

@ -24,7 +24,7 @@ import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.concurrent.Execs;
import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher;
@ -167,7 +167,7 @@ public class VariantColumnSupplierTest extends InitializedNullHandlingTest
@BeforeClass @BeforeClass
public static void staticSetup() public static void staticSetup()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
} }
@Parameterized.Parameters(name = "data = {0}") @Parameterized.Parameters(name = "data = {0}")

View File

@ -24,6 +24,7 @@ import org.apache.druid.curator.CuratorModule;
import org.apache.druid.curator.discovery.DiscoveryModule; import org.apache.druid.curator.discovery.DiscoveryModule;
import org.apache.druid.discovery.NodeRole; import org.apache.druid.discovery.NodeRole;
import org.apache.druid.guice.AnnouncerModule; import org.apache.druid.guice.AnnouncerModule;
import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.guice.CoordinatorDiscoveryModule; import org.apache.druid.guice.CoordinatorDiscoveryModule;
import org.apache.druid.guice.DruidInjectorBuilder; import org.apache.druid.guice.DruidInjectorBuilder;
import org.apache.druid.guice.DruidSecondaryModule; import org.apache.druid.guice.DruidSecondaryModule;
@ -34,7 +35,6 @@ import org.apache.druid.guice.JavaScriptModule;
import org.apache.druid.guice.LifecycleModule; import org.apache.druid.guice.LifecycleModule;
import org.apache.druid.guice.LocalDataStorageDruidModule; import org.apache.druid.guice.LocalDataStorageDruidModule;
import org.apache.druid.guice.MetadataConfigModule; import org.apache.druid.guice.MetadataConfigModule;
import org.apache.druid.guice.NestedDataModule;
import org.apache.druid.guice.ServerModule; import org.apache.druid.guice.ServerModule;
import org.apache.druid.guice.ServerViewModule; import org.apache.druid.guice.ServerViewModule;
import org.apache.druid.guice.StartupLoggingModule; import org.apache.druid.guice.StartupLoggingModule;
@ -113,7 +113,7 @@ public class CoreInjectorBuilder extends DruidInjectorBuilder
new StorageNodeModule(), new StorageNodeModule(),
new JettyServerModule(), new JettyServerModule(),
new ExpressionModule(), new ExpressionModule(),
new NestedDataModule(), new BuiltInTypesModule(),
new DiscoveryModule(), new DiscoveryModule(),
new ServerViewModule(), new ServerViewModule(),
new MetadataConfigModule(), new MetadataConfigModule(),

View File

@ -31,7 +31,7 @@ import org.apache.druid.collections.bitmap.RoaringBitmapFactory;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.guice.NestedDataModule; import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.guice.StartupInjectorBuilder; import org.apache.druid.guice.StartupInjectorBuilder;
import org.apache.druid.guice.annotations.Json; import org.apache.druid.guice.annotations.Json;
import org.apache.druid.initialization.ServerInjectorBuilder; import org.apache.druid.initialization.ServerInjectorBuilder;
@ -84,7 +84,7 @@ public class DumpSegmentTest extends InitializedNullHandlingTest
public DumpSegmentTest() public DumpSegmentTest()
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
this.closer = Closer.create(); this.closer = Closer.create();
} }
@ -156,15 +156,15 @@ public class DumpSegmentTest extends InitializedNullHandlingTest
{ {
Injector injector = Mockito.mock(Injector.class); Injector injector = Mockito.mock(Injector.class);
ObjectMapper mapper = TestHelper.makeJsonMapper(); ObjectMapper mapper = TestHelper.makeJsonMapper();
mapper.registerModules(NestedDataModule.getJacksonModulesList()); mapper.registerModules(BuiltInTypesModule.getJacksonModulesList());
mapper.setInjectableValues( mapper.setInjectableValues(
new InjectableValues.Std() new InjectableValues.Std()
.addValue(ExprMacroTable.class.getName(), TestExprMacroTable.INSTANCE) .addValue(ExprMacroTable.class.getName(), TestExprMacroTable.INSTANCE)
.addValue(ObjectMapper.class.getName(), mapper) .addValue(ObjectMapper.class.getName(), mapper)
.addValue(DefaultColumnFormatConfig.class, new DefaultColumnFormatConfig(null)) .addValue(DefaultColumnFormatConfig.class, new DefaultColumnFormatConfig(null, null))
); );
Mockito.when(injector.getInstance(Key.get(ObjectMapper.class, Json.class))).thenReturn(mapper); Mockito.when(injector.getInstance(Key.get(ObjectMapper.class, Json.class))).thenReturn(mapper);
Mockito.when(injector.getInstance(DefaultColumnFormatConfig.class)).thenReturn(new DefaultColumnFormatConfig(null)); Mockito.when(injector.getInstance(DefaultColumnFormatConfig.class)).thenReturn(new DefaultColumnFormatConfig(null, null));
List<Segment> segments = createSegments(tempFolder, closer); List<Segment> segments = createSegments(tempFolder, closer);
QueryableIndex queryableIndex = segments.get(0).asQueryableIndex(); QueryableIndex queryableIndex = segments.get(0).asQueryableIndex();
@ -196,15 +196,15 @@ public class DumpSegmentTest extends InitializedNullHandlingTest
{ {
Injector injector = Mockito.mock(Injector.class); Injector injector = Mockito.mock(Injector.class);
ObjectMapper mapper = TestHelper.makeJsonMapper(); ObjectMapper mapper = TestHelper.makeJsonMapper();
mapper.registerModules(NestedDataModule.getJacksonModulesList()); mapper.registerModules(BuiltInTypesModule.getJacksonModulesList());
mapper.setInjectableValues( mapper.setInjectableValues(
new InjectableValues.Std() new InjectableValues.Std()
.addValue(ExprMacroTable.class.getName(), TestExprMacroTable.INSTANCE) .addValue(ExprMacroTable.class.getName(), TestExprMacroTable.INSTANCE)
.addValue(ObjectMapper.class.getName(), mapper) .addValue(ObjectMapper.class.getName(), mapper)
.addValue(DefaultColumnFormatConfig.class, new DefaultColumnFormatConfig(null)) .addValue(DefaultColumnFormatConfig.class, new DefaultColumnFormatConfig(null, null))
); );
Mockito.when(injector.getInstance(Key.get(ObjectMapper.class, Json.class))).thenReturn(mapper); Mockito.when(injector.getInstance(Key.get(ObjectMapper.class, Json.class))).thenReturn(mapper);
Mockito.when(injector.getInstance(DefaultColumnFormatConfig.class)).thenReturn(new DefaultColumnFormatConfig(null)); Mockito.when(injector.getInstance(DefaultColumnFormatConfig.class)).thenReturn(new DefaultColumnFormatConfig(null, null));
List<Segment> segments = createSegments(tempFolder, closer); List<Segment> segments = createSegments(tempFolder, closer);
QueryableIndex queryableIndex = segments.get(0).asQueryableIndex(); QueryableIndex queryableIndex = segments.get(0).asQueryableIndex();

View File

@ -24,8 +24,8 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import org.apache.calcite.avatica.SqlType; import org.apache.calcite.avatica.SqlType;
import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.guice.DruidInjectorBuilder; import org.apache.druid.guice.DruidInjectorBuilder;
import org.apache.druid.guice.NestedDataModule;
import org.apache.druid.java.util.common.HumanReadableBytes; import org.apache.druid.java.util.common.HumanReadableBytes;
import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.StringUtils;
@ -130,7 +130,7 @@ public class CalciteArraysQueryTest extends BaseCalciteQueryTest
public void configureGuice(DruidInjectorBuilder builder) public void configureGuice(DruidInjectorBuilder builder)
{ {
super.configureGuice(builder); super.configureGuice(builder);
builder.addModule(new NestedDataModule()); builder.addModule(new BuiltInTypesModule());
} }
} }

View File

@ -34,8 +34,8 @@ import org.apache.druid.data.input.impl.StringDimensionSchema;
import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidException;
import org.apache.druid.error.DruidExceptionMatcher; import org.apache.druid.error.DruidExceptionMatcher;
import org.apache.druid.guice.BuiltInTypesModule;
import org.apache.druid.guice.DruidInjectorBuilder; import org.apache.druid.guice.DruidInjectorBuilder;
import org.apache.druid.guice.NestedDataModule;
import org.apache.druid.java.util.common.HumanReadableBytes; import org.apache.druid.java.util.common.HumanReadableBytes;
import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.math.expr.ExprMacroTable;
@ -196,7 +196,7 @@ public class CalciteNestedDataQueryTest extends BaseCalciteQueryTest
public void configureGuice(DruidInjectorBuilder builder) public void configureGuice(DruidInjectorBuilder builder)
{ {
super.configureGuice(builder); super.configureGuice(builder);
builder.addModule(new NestedDataModule()); builder.addModule(new BuiltInTypesModule());
} }
@SuppressWarnings("resource") @SuppressWarnings("resource")
@ -207,7 +207,7 @@ public class CalciteNestedDataQueryTest extends BaseCalciteQueryTest
final Injector injector final Injector injector
) )
{ {
NestedDataModule.registerHandlersAndSerde(); BuiltInTypesModule.registerHandlersAndSerde();
final QueryableIndex index = final QueryableIndex index =
IndexBuilder.create() IndexBuilder.create()
.tmpDir(tempDirProducer.newTempFolder()) .tmpDir(tempDirProducer.newTempFolder())

View File

@ -548,7 +548,7 @@ public class SqlTestFramework
{ {
binder.bind(DruidOperatorTable.class).in(LazySingleton.class); binder.bind(DruidOperatorTable.class).in(LazySingleton.class);
binder.bind(DataSegment.PruneSpecsHolder.class).toInstance(DataSegment.PruneSpecsHolder.DEFAULT); binder.bind(DataSegment.PruneSpecsHolder.class).toInstance(DataSegment.PruneSpecsHolder.DEFAULT);
binder.bind(DefaultColumnFormatConfig.class).toInstance(new DefaultColumnFormatConfig(null)); binder.bind(DefaultColumnFormatConfig.class).toInstance(new DefaultColumnFormatConfig(null, null));
} }
@Provides @Provides
@ -620,7 +620,6 @@ public class SqlTestFramework
.addModule(new SqlAggregationModule()) .addModule(new SqlAggregationModule())
.addModule(new ExpressionModule()) .addModule(new ExpressionModule())
.addModule(new TestSetupModule(builder)); .addModule(new TestSetupModule(builder));
builder.componentSupplier.configureGuice(injectorBuilder); builder.componentSupplier.configureGuice(injectorBuilder);
ServiceInjectorBuilder serviceInjector = new ServiceInjectorBuilder(injectorBuilder); ServiceInjectorBuilder serviceInjector = new ServiceInjectorBuilder(injectorBuilder);