mirror of https://github.com/apache/druid.git
switch to using arrays by default (#17133)
This commit is contained in:
parent
1a13bd5485
commit
4872f0457a
|
@ -296,6 +296,9 @@ export type SchemaMode = 'fixed' | 'string-only-discovery' | 'type-aware-discove
|
||||||
export type ArrayMode = 'arrays' | 'multi-values';
|
export type ArrayMode = 'arrays' | 'multi-values';
|
||||||
|
|
||||||
export const DEFAULT_FORCE_SEGMENT_SORT_BY_TIME = true;
|
export const DEFAULT_FORCE_SEGMENT_SORT_BY_TIME = true;
|
||||||
|
export const DEFAULT_SCHEMA_MODE: SchemaMode = 'fixed';
|
||||||
|
export const DEFAULT_ARRAY_MODE: ArrayMode = 'arrays';
|
||||||
|
|
||||||
export function getForceSegmentSortByTime(spec: Partial<IngestionSpec>): boolean {
|
export function getForceSegmentSortByTime(spec: Partial<IngestionSpec>): boolean {
|
||||||
return (
|
return (
|
||||||
deepGet(spec, 'spec.dataSchema.dimensionsSpec.forceSegmentSortByTime') ??
|
deepGet(spec, 'spec.dataSchema.dimensionsSpec.forceSegmentSortByTime') ??
|
||||||
|
|
|
@ -83,7 +83,9 @@ import {
|
||||||
computeFlattenPathsForData,
|
computeFlattenPathsForData,
|
||||||
CONSTANT_TIMESTAMP_SPEC,
|
CONSTANT_TIMESTAMP_SPEC,
|
||||||
CONSTANT_TIMESTAMP_SPEC_FIELDS,
|
CONSTANT_TIMESTAMP_SPEC_FIELDS,
|
||||||
|
DEFAULT_ARRAY_MODE,
|
||||||
DEFAULT_FORCE_SEGMENT_SORT_BY_TIME,
|
DEFAULT_FORCE_SEGMENT_SORT_BY_TIME,
|
||||||
|
DEFAULT_SCHEMA_MODE,
|
||||||
DIMENSION_SPEC_FIELDS,
|
DIMENSION_SPEC_FIELDS,
|
||||||
fillDataSourceNameIfNeeded,
|
fillDataSourceNameIfNeeded,
|
||||||
fillInputFormatIfNeeded,
|
fillInputFormatIfNeeded,
|
||||||
|
@ -317,8 +319,8 @@ function initializeSchemaWithSampleIfNeeded(
|
||||||
spec,
|
spec,
|
||||||
sample,
|
sample,
|
||||||
DEFAULT_FORCE_SEGMENT_SORT_BY_TIME,
|
DEFAULT_FORCE_SEGMENT_SORT_BY_TIME,
|
||||||
'fixed',
|
DEFAULT_SCHEMA_MODE,
|
||||||
'multi-values',
|
DEFAULT_ARRAY_MODE,
|
||||||
getRollup(spec, false),
|
getRollup(spec, false),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import type { ArrayMode, InputFormat, InputSource } from '../../../druid-models'
|
||||||
import {
|
import {
|
||||||
BATCH_INPUT_FORMAT_FIELDS,
|
BATCH_INPUT_FORMAT_FIELDS,
|
||||||
chooseByBestTimestamp,
|
chooseByBestTimestamp,
|
||||||
|
DEFAULT_ARRAY_MODE,
|
||||||
DETECTION_TIMESTAMP_SPEC,
|
DETECTION_TIMESTAMP_SPEC,
|
||||||
getPossibleSystemFieldsForInputSource,
|
getPossibleSystemFieldsForInputSource,
|
||||||
guessColumnTypeFromSampleResponse,
|
guessColumnTypeFromSampleResponse,
|
||||||
|
@ -93,7 +94,7 @@ export const InputFormatStep = React.memo(function InputFormatStep(props: InputF
|
||||||
InputSourceAndFormat | undefined
|
InputSourceAndFormat | undefined
|
||||||
>(isValidInputFormat(initInputFormat) ? inputSourceAndFormat : undefined);
|
>(isValidInputFormat(initInputFormat) ? inputSourceAndFormat : undefined);
|
||||||
const [selectTimestamp, setSelectTimestamp] = useState(true);
|
const [selectTimestamp, setSelectTimestamp] = useState(true);
|
||||||
const [arrayMode, setArrayMode] = useState<ArrayMode>('multi-values');
|
const [arrayMode, setArrayMode] = useState<ArrayMode>(DEFAULT_ARRAY_MODE);
|
||||||
|
|
||||||
const [previewState] = useQueryManager<InputSourceAndFormat, SampleResponse>({
|
const [previewState] = useQueryManager<InputSourceAndFormat, SampleResponse>({
|
||||||
query: inputSourceAndFormatToSample,
|
query: inputSourceAndFormatToSample,
|
||||||
|
|
Loading…
Reference in New Issue