+ If the segments generated are a sub-optimal size for the requested partition dimensions, consider setting this field. +
++ A target row count for each partition. Each partition will have a row count close to the target assuming evenly distributed keys. Defaults to 5 million if numShards is null. +
++ If you know the optimal number of shards and want to speed up the time it takes for compaction to run, set this field. +
++ Directly specify the number of shards to create. If this is specified and 'intervals' is specified in the granularitySpec, the index task can skip the determine intervals/partitions pass through the data. +
+ If the segments generated are a sub-optimal size for the requested partition dimensions, consider setting this field. +
++ A target row count for each partition. Each partition will have a row count close to the target assuming evenly distributed keys. Defaults to 5 million if numShards is null. +
++ If you know the optimal number of shards and want to speed up the time it takes for compaction to run, set this field. +
++ Directly specify the number of shards to create. If this is specified and 'intervals' is specified in the granularitySpec, the index task can skip the determine intervals/partitions pass through the data. +
+ If the segments generated are a sub-optimal size for the requested partition dimensions, consider setting this field. +
++ A target row count for each partition. Each partition will have a row count close to the target assuming evenly distributed keys. Defaults to 5 million if numShards is null. +
++ If you know the optimal number of shards and want to speed up the time it takes for compaction to run, set this field. +
++ Directly specify the number of shards to create. If this is specified and 'intervals' is specified in the granularitySpec, the index task can skip the determine intervals/partitions pass through the data. +
+ If the segments generated are a sub-optimal size for the requested partition dimensions, consider setting this field. +
++ A target row count for each partition. Each partition will have a row count close to the target assuming evenly distributed keys. Defaults to 5 million if numShards is null. +
++ If you know the optimal number of shards and want to speed up the time it takes for compaction to run, set this field. +
++ Directly specify the number of shards to create. If this is specified and 'intervals' is specified in the granularitySpec, the index task can skip the determine intervals/partitions pass through the data. +
+ If the segments generated are a sub-optimal size for the requested partition dimensions, + consider setting this field. +
++ A target row count for each partition. Each partition will have a row count close to the + target assuming evenly distributed keys. Defaults to 5 million if numShards is null. +
+ > + ), + }, { name: 'tuningConfig.partitionsSpec.numShards', label: 'Num shards', type: 'number', - defined: (t: CompactionConfig) => deepGet(t, 'tuningConfig.partitionsSpec.type') === 'hashed', + defined: (t: CompactionConfig) => + deepGet(t, 'tuningConfig.partitionsSpec.type') === 'hashed' && + !deepGet(t, 'tuningConfig.partitionsSpec.targetRowsPerSegment'), info: ( <> - Directly specify the number of shards to create. If this is specified and 'intervals' is - specified in the granularitySpec, the index task can skip the determine intervals/partitions - pass through the data. ++ If you know the optimal number of shards and want to speed up the time it takes for + compaction to run, set this field. +
++ Directly specify the number of shards to create. If this is specified and 'intervals' is + specified in the granularitySpec, the index task can skip the determine + intervals/partitions pass through the data. +
> ), }, @@ -211,7 +239,12 @@ function validCompactionConfig(compactionConfig: CompactionConfig): boolean { deepGet(compactionConfig, 'tuningConfig.partitionsSpec.type') || 'dynamic'; switch (partitionsSpecType) { // case 'dynamic': // Nothing to check for dynamic - // case 'hashed': // Nothing to check for hashed + case 'hashed': + return !( + Boolean(deepGet(compactionConfig, 'tuningConfig.partitionsSpec.targetRowsPerSegment')) && + Boolean(deepGet(compactionConfig, 'tuningConfig.partitionsSpec.numShards')) + ); + break; case 'single_dim': if (!deepGet(compactionConfig, 'tuningConfig.partitionsSpec.partitionDimension')) { return false; diff --git a/web-console/src/utils/ingestion-spec.tsx b/web-console/src/utils/ingestion-spec.tsx index 996f8e0207e..73f6d43297f 100644 --- a/web-console/src/utils/ingestion-spec.tsx +++ b/web-console/src/utils/ingestion-spec.tsx @@ -2114,6 +2114,11 @@ export function invalidTuningConfig(tuningConfig: TuningConfig, intervals: any): if (!intervals) return true; switch (deepGet(tuningConfig, 'partitionsSpec.type')) { + case 'hashed': + return ( + Boolean(deepGet(tuningConfig, 'partitionsSpec.targetRowsPerSegment')) && + Boolean(deepGet(tuningConfig, 'partitionsSpec.numShards')) + ); case 'single_dim': if (!deepGet(tuningConfig, 'partitionsSpec.partitionDimension')) return true; const hasTargetRowsPerSegment = Boolean( @@ -2181,16 +2186,45 @@ export function getPartitionRelatedTuningSpecFormFields( info: <>Total number of rows in segments waiting for being pushed.>, }, // partitionsSpec type: hashed + { + name: 'partitionsSpec.targetRowsPerSegment', + label: 'Target rows per segment', + type: 'number', + defined: (t: TuningConfig) => + deepGet(t, 'partitionsSpec.type') === 'hashed' && + !deepGet(t, 'partitionsSpec.numShards'), + info: ( + <> ++ If the segments generated are a sub-optimal size for the requested partition + dimensions, consider setting this field. +
++ A target row count for each partition. Each partition will have a row count close to + the target assuming evenly distributed keys. Defaults to 5 million if numShards is + null. +
+ > + ), + }, { name: 'partitionsSpec.numShards', label: 'Num shards', type: 'number', - defined: (t: TuningConfig) => deepGet(t, 'partitionsSpec.type') === 'hashed', + defined: (t: TuningConfig) => + deepGet(t, 'partitionsSpec.type') === 'hashed' && + !deepGet(t, 'partitionsSpec.targetRowsPerSegment'), info: ( <> - Directly specify the number of shards to create. If this is specified and 'intervals' - is specified in the granularitySpec, the index task can skip the determine - intervals/partitions pass through the data. ++ If you know the optimal number of shards and want to speed up the time it takes for + compaction to run, set this field. +
++ Directly specify the number of shards to create. If this is specified and + 'intervals' is specified in the granularitySpec, the index task can skip the + determine intervals/partitions pass through the data. +
> ), },