switch to using arrays by default (#17133)

This commit is contained in:
Vadim Ogievetsky 2024-09-24 09:20:04 -07:00 committed by GitHub
parent 1a13bd5485
commit 4872f0457a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View File

@ -296,6 +296,9 @@ export type SchemaMode = 'fixed' | 'string-only-discovery' | 'type-aware-discove
export type ArrayMode = 'arrays' | 'multi-values';
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 {
return (
deepGet(spec, 'spec.dataSchema.dimensionsSpec.forceSegmentSortByTime') ??

View File

@ -83,7 +83,9 @@ import {
computeFlattenPathsForData,
CONSTANT_TIMESTAMP_SPEC,
CONSTANT_TIMESTAMP_SPEC_FIELDS,
DEFAULT_ARRAY_MODE,
DEFAULT_FORCE_SEGMENT_SORT_BY_TIME,
DEFAULT_SCHEMA_MODE,
DIMENSION_SPEC_FIELDS,
fillDataSourceNameIfNeeded,
fillInputFormatIfNeeded,
@ -317,8 +319,8 @@ function initializeSchemaWithSampleIfNeeded(
spec,
sample,
DEFAULT_FORCE_SEGMENT_SORT_BY_TIME,
'fixed',
'multi-values',
DEFAULT_SCHEMA_MODE,
DEFAULT_ARRAY_MODE,
getRollup(spec, false),
);
}

View File

@ -27,6 +27,7 @@ import type { ArrayMode, InputFormat, InputSource } from '../../../druid-models'
import {
BATCH_INPUT_FORMAT_FIELDS,
chooseByBestTimestamp,
DEFAULT_ARRAY_MODE,
DETECTION_TIMESTAMP_SPEC,
getPossibleSystemFieldsForInputSource,
guessColumnTypeFromSampleResponse,
@ -93,7 +94,7 @@ export const InputFormatStep = React.memo(function InputFormatStep(props: InputF
InputSourceAndFormat | undefined
>(isValidInputFormat(initInputFormat) ? inputSourceAndFormat : undefined);
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>({
query: inputSourceAndFormatToSample,