+ Partitioning strategy used for intervals where no partitioning rule matches. Use
+
+
+ The dimensions to partition on. +
, + "label": "Default partition dimensions", + "name": "defaultPartitionsSpec.partitionDimensions", + "required": true, + "type": "string-array", + }, + { + "defined": [Function], + "info":
+ Target number of rows per segment. Either
+
+ Optional virtual columns used if your default partitions spec range partitioning definition references virtual columns. +
, + "label": "Default partitioning virtual columns", + "name": "defaultPartitioningVirtualColumns", + "type": "custom", + }, + { + "customDialog": [Function], + "customSummary": [Function], + "info":+ Configure the reindexing rules that control how data is compacted as it ages. Rules define partitioning, deletion, index spec, and data schema changes. +
, + "label": "Rule provider", + "name": "ruleProvider", + "required": true, + "type": "custom", + }, + { + "adjustment": [Function], + "defaultValue": [Function], + "info":
+ Choose whether to skip recent data and how the offset is calculated.
+
+ ISO 8601 period. Skips data newer than this offset from the end of the latest segment. +
, + "label": "Skip offset value", + "name": "skipOffsetFromLatest", + "suggestions": [ + "PT0H", + "PT1H", + "P1D", + "P3D", + ], + "type": "string", + }, + { + "defined": [Function], + "info":+ ISO 8601 period. Skips data newer than this offset from the current time. +
, + "label": "Skip offset value", + "name": "skipOffsetFromNow", + "suggestions": [ + "PT0H", + "PT1H", + "P1D", + "P3D", + ], + "type": "string", + }, + { + "defaultValue": 25, + "hideInMore": true, + "info":+ Priority of compaction tasks. +
, + "min": 0, + "name": "taskPriority", + "type": "number", + }, + { + "hideInMore": true, + "info":+ Maximum total input segment size in bytes per compaction task. +
, + "name": "inputSegmentSizeBytes", + "type": "size-bytes", + }, + { + "defaultValue": false, + "info":+ Enable concurrent append and replace for the datasource. Recommended if you are appending data to a datasource while compaction is running. +
, + "label": "Task context: concurrent locks", + "name": "taskContext.useConcurrentLocks", + "type": "boolean", + }, + { + "info":+ Maximum number of tasks (including the controller) for MSQ compaction. Must be at least 2 (one controller, one worker). +
, + "label": "Task context: max num tasks", + "min": 2, + "name": "taskContext.maxNumTasks", + "placeholder": "(cluster default)", + "type": "number", + "zeroMeansUndefined": true, + }, + { + "hideInMore": true, + "info":+ Maximum number of rows to hold in memory before persisting. Lower values reduce memory usage but may increase disk I/O. +
, + "label": "Task context: max rows in memory", + "name": "taskContext.maxRowsInMemory", + "placeholder": "(default)", + "type": "number", + "zeroMeansUndefined": true, + }, + { + "hideInMore": true, + "info":+ Maximum frame size in bytes for MSQ tasks. Increase if tasks fail due to frame size limits. +
, + "label": "Task context: max frame size", + "name": "taskContext.maxFrameSize", + "placeholder": "(default)", + "type": "number", + "zeroMeansUndefined": true, + }, + { + "hideInMore": true, + "info":+ Full task context map. Common settings are available as dedicated fields above. Use this to set additional MSQ context parameters. +
, + "label": "Task context: additional settings", + "name": "taskContext", + "type": "json", + }, + { + "hideInMore": true, + "info":
+ Tuning config for compaction tasks. Note: you cannot set
+
+ For perfect rollup, you should use either
+
+ 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
+
+ Note that either
+
+ Target number of rows to include in a partition, should be a number that targets segments of 500MB~1GB. +
+
+
+ If
+
+ Note that either
+
+ 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. +
+
+ Note that either
+
+ The dimensions to partition on. Leave blank to select all dimensions. +
, + "name": "tuningConfig.partitionsSpec.partitionDimensions", + "placeholder": "(all dimensions)", + "type": "string-array", + }, + { + "defined": [Function], + "info":+ The dimension to partition on. +
, + "name": "tuningConfig.partitionsSpec.partitionDimension", + "required": true, + "type": "string", + }, + { + "defined": [Function], + "info":+ The dimensions to partition on. +
, + "name": "tuningConfig.partitionsSpec.partitionDimensions", + "required": true, + "type": "string-array", + }, + { + "defined": [Function], + "info":+ Target number of rows to include in a partition, should be a number that targets segments of 500MB~1GB. +
+
+ Note that either
+
+ Maximum number of rows to include in a partition. +
+
+ Note that either
+
+ Assume that input data has already been grouped on time and dimensions. Ingestion will run faster, but may choose sub-optimal partitions if this assumption is violated. +
, + "name": "tuningConfig.partitionsSpec.assumeGrouped", + "type": "boolean", + }, + { + "defaultValue": 1, + "info":+ Limit of the number of segments to merge in a single phase when merging segments for publishing. This limit affects the total number of columns present in a set of segments to merge. If the limit is exceeded, segment merging occurs in multiple phases. Druid merges at least 2 segments per phase, regardless of this setting. +
++ Default: -1 (unlimited) +
++ If you want to append data to a datasource while compaction is running, you need to enable concurrent append and replace for the datasource by updating the compaction settings. +
+
+ For more information refer to the
+
+
+ ISO 8601 period defining the age threshold. The rule applies to data older than the current time minus this period. +
, + "name": "olderThan", + "required": true, + "suggestions": [ + "P1D", + "P7D", + "P30D", + "P90D", + "P180D", + "P365D", + ], + "type": "string", + }, + { + "info":+ Human-readable description of this rule. +
, + "name": "description", + "type": "string", + }, + { + "info":+ Time granularity for segment buckets. +
, + "name": "segmentGranularity", + "required": true, + "suggestions": [ + "MINUTE", + "FIFTEEN_MINUTE", + "HOUR", + "DAY", + "MONTH", + "QUARTER", + "YEAR", + ], + "type": "string", + }, + { + "info":
+ Use
+
+ The dimensions to partition on. +
, + "label": "Partition dimensions", + "name": "partitionsSpec.partitionDimensions", + "required": true, + "type": "string-array", + }, + { + "defined": [Function], + "info":+ Target number of rows per segment for range partitioning. +
, + "label": "Target rows per segment", + "name": "partitionsSpec.targetRowsPerSegment", + "type": "number", + "zeroMeansUndefined": true, + }, + { + "customDialog": [Function], + "customSummary": [Function], + "defined": [Function], + "info":+ Virtual columns for partitioning by nested or derived fields. +
, + "name": "virtualColumns", + "type": "custom", + }, + ] + } + onChange={[Function]} + onNewRule={[Function]} + rules={[]} + title="Partitioning rules" + /> ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current time minus this period. +
, + "name": "olderThan", + "required": true, + "suggestions": [ + "P1D", + "P7D", + "P30D", + "P90D", + "P180D", + "P365D", + ], + "type": "string", + }, + { + "info":+ Human-readable description of this rule. +
, + "name": "description", + "type": "string", + }, + { + "info":
+ A Druid filter matching rows to
+
+ delete
+
+ . The compacted data retains rows that do not match this filter. Multiple deletion rules combine as
+
+
+ Virtual columns for filtering on nested or derived fields. +
, + "name": "virtualColumns", + "type": "json", + }, + ] + } + onChange={[Function]} + onNewRule={[Function]} + rules={[]} + title="Deletion rules" + /> ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current time minus this period. +
, + "name": "olderThan", + "required": true, + "suggestions": [ + "P1D", + "P7D", + "P30D", + "P90D", + "P180D", + "P365D", + ], + "type": "string", + }, + { + "info":+ Human-readable description of this rule. +
, + "name": "description", + "type": "string", + }, + { + "info":+ An IndexSpec object defining bitmap type, metric compression, and other encoding settings for compacted segments. +
, + "name": "indexSpec", + "required": true, + "type": "json", + }, + ] + } + onChange={[Function]} + onNewRule={[Function]} + rules={[]} + title="Index spec rules" + /> ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current time minus this period. +
, + "name": "olderThan", + "required": true, + "suggestions": [ + "P1D", + "P7D", + "P30D", + "P90D", + "P180D", + "P365D", + ], + "type": "string", + }, + { + "info":+ Human-readable description of this rule. +
, + "name": "description", + "type": "string", + }, + { + "info":+ Query granularity for the compacted segments. Leave unset to preserve existing granularity. +
, + "name": "queryGranularity", + "placeholder": "(unset)", + "suggestions": [ + "MINUTE", + "FIFTEEN_MINUTE", + "HOUR", + "DAY", + "MONTH", + "QUARTER", + "YEAR", + ], + "type": "string", + }, + { + "info":
+ Whether to enable rollup. Set to
+
+ Array of aggregator factories for rollup metrics. Example: +
+
+ [
+ {
+ "type": "longSum",
+ "name": "added",
+ "fieldName": "added"
+ },
+ {
+ "type": "longSum",
+ "name": "deleted",
+ "fieldName": "deleted"
+ }
+]
+
+ + Dimensions config for the compacted segments. Example: +
+
+ {
+ "dimensions": [
+ "page",
+ { "type": "string", "name": "channel" }
+ ]
+}
+
+ + List of aggregate projections. +
, + "name": "projections", + "type": "json", + }, + ] + } + onChange={[Function]} + onNewRule={[Function]} + rules={[]} + title="Data schema rules" + /> ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current time minus this period. +
, + "name": "olderThan", + "required": true, + "suggestions": [ + "P1D", + "P7D", + "P30D", + "P90D", + "P180D", + "P365D", + ], + "type": "string", + }, + { + "info":+ Human-readable description of this rule. +
, + "name": "description", + "type": "string", + }, + { + "info":+ Time granularity for segment buckets. +
, + "name": "segmentGranularity", + "required": true, + "suggestions": [ + "MINUTE", + "FIFTEEN_MINUTE", + "HOUR", + "DAY", + "MONTH", + "QUARTER", + "YEAR", + ], + "type": "string", + }, + { + "info":
+ Use
+
+ The dimensions to partition on. +
, + "label": "Partition dimensions", + "name": "partitionsSpec.partitionDimensions", + "required": true, + "type": "string-array", + }, + { + "defined": [Function], + "info":+ Target number of rows per segment for range partitioning. +
, + "label": "Target rows per segment", + "name": "partitionsSpec.targetRowsPerSegment", + "type": "number", + "zeroMeansUndefined": true, + }, + { + "customDialog": [Function], + "customSummary": [Function], + "defined": [Function], + "info":+ Virtual columns for partitioning by nested or derived fields. +
, + "name": "virtualColumns", + "type": "custom", + }, + ] + } + onChange={[Function]} + onNewRule={[Function]} + rules={ + [ + { + "id": "daily-30d", + "olderThan": "P30D", + "partitionsSpec": { + "maxRowsPerSegment": 5000000, + "type": "dynamic", + }, + "segmentGranularity": "DAY", + }, + ] + } + title="Partitioning rules" + /> ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current time minus this period. +
, + "name": "olderThan", + "required": true, + "suggestions": [ + "P1D", + "P7D", + "P30D", + "P90D", + "P180D", + "P365D", + ], + "type": "string", + }, + { + "info":+ Human-readable description of this rule. +
, + "name": "description", + "type": "string", + }, + { + "info":
+ A Druid filter matching rows to
+
+ delete
+
+ . The compacted data retains rows that do not match this filter. Multiple deletion rules combine as
+
+
+ Virtual columns for filtering on nested or derived fields. +
, + "name": "virtualColumns", + "type": "json", + }, + ] + } + onChange={[Function]} + onNewRule={[Function]} + rules={ + [ + { + "deleteWhere": { + "column": "isRobot", + "matchValue": "true", + "type": "equals", + }, + "id": "remove-bots", + "olderThan": "P90D", + }, + ] + } + title="Deletion rules" + /> ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current time minus this period. +
, + "name": "olderThan", + "required": true, + "suggestions": [ + "P1D", + "P7D", + "P30D", + "P90D", + "P180D", + "P365D", + ], + "type": "string", + }, + { + "info":+ Human-readable description of this rule. +
, + "name": "description", + "type": "string", + }, + { + "info":+ An IndexSpec object defining bitmap type, metric compression, and other encoding settings for compacted segments. +
, + "name": "indexSpec", + "required": true, + "type": "json", + }, + ] + } + onChange={[Function]} + onNewRule={[Function]} + rules={[]} + title="Index spec rules" + /> ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current time minus this period. +
, + "name": "olderThan", + "required": true, + "suggestions": [ + "P1D", + "P7D", + "P30D", + "P90D", + "P180D", + "P365D", + ], + "type": "string", + }, + { + "info":+ Human-readable description of this rule. +
, + "name": "description", + "type": "string", + }, + { + "info":+ Query granularity for the compacted segments. Leave unset to preserve existing granularity. +
, + "name": "queryGranularity", + "placeholder": "(unset)", + "suggestions": [ + "MINUTE", + "FIFTEEN_MINUTE", + "HOUR", + "DAY", + "MONTH", + "QUARTER", + "YEAR", + ], + "type": "string", + }, + { + "info":
+ Whether to enable rollup. Set to
+
+ Array of aggregator factories for rollup metrics. Example: +
+
+ [
+ {
+ "type": "longSum",
+ "name": "added",
+ "fieldName": "added"
+ },
+ {
+ "type": "longSum",
+ "name": "deleted",
+ "fieldName": "deleted"
+ }
+]
+
+ + Dimensions config for the compacted segments. Example: +
+
+ {
+ "dimensions": [
+ "page",
+ { "type": "string", "name": "channel" }
+ ]
+}
+
+ + List of aggregate projections. +
, + "name": "projections", + "type": "json", + }, + ] + } + onChange={[Function]} + onNewRule={[Function]} + rules={[]} + title="Data schema rules" + /> ++ Druid expression that computes the virtual column value. +
, + "name": "expression", + "required": true, + "type": "string", + }, + { + "info":+ Output type of the expression result. +
, + "name": "outputType", + "suggestions": [ + "STRING", + "LONG", + "FLOAT", + "DOUBLE", + "COMPLEX", + ], + "type": "string", + }, + ] + } + model={ + { + "expression": "concat(cityName, ':', countryName)", + "name": "city_and_country", + "outputType": "STRING", + "type": "expression", + } + } + onChange={[Function]} + /> +
Your current config sets the legacy inputSegmentSizeBytes to{' '}
@@ -107,51 +204,64 @@ export const CompactionConfigDialog = React.memo(function CompactionConfigDialog
- If you want to append data to a datasource while compaction is running, you need - to enable concurrent append and replace for the datasource by updating the - compaction settings. -
-
- For more information refer to the{' '}
-
+ If you want to append data to a datasource while compaction is running, you + need to enable concurrent append and replace for the datasource by updating + the compaction settings. +
+
+ For more information refer to the{' '}
+
{description}
+ {rules.map((rule, index) => ( +Output name of the virtual column.
, + }, + { + name: 'expression', + type: 'string', + required: true, + info:Druid expression that computes the virtual column value.
, + }, + { + name: 'outputType', + type: 'string', + suggestions: ['STRING', 'LONG', 'FLOAT', 'DOUBLE', 'COMPLEX'], + info:Output type of the expression result.
, + }, +]; + +export function newExpressionVirtualColumn(): ExpressionVirtualColumn { + return { + type: 'expression', + name: '', + expression: '', + }; +} + +export function summarizeVirtualColumns( + virtualColumns: ExpressionVirtualColumn[] | undefined, +): string { + if (!virtualColumns?.length) return '(none)'; + return virtualColumns.map(vc => vc.name || '(unnamed)').join(', '); +} + +// --- Reindexing rule types --- + +export interface ReindexingRule { + id: string; + olderThan: string; + description?: string; +} + +export interface PartitioningRule extends ReindexingRule { + segmentGranularity: string; + partitionsSpec: any; + virtualColumns?: any; +} + +export interface DeletionRule extends ReindexingRule { + deleteWhere: any; + virtualColumns?: any; +} + +export interface IndexSpecRule extends ReindexingRule { + indexSpec: any; +} + +export interface DataSchemaRule extends ReindexingRule { + dimensionsSpec?: any; + metricsSpec?: any[]; + queryGranularity?: string; + rollup?: boolean; + projections?: any[]; +} + +// --- Rule provider types --- + +export interface InlineRuleProvider { + type: 'inline'; + partitioningRules?: PartitioningRule[]; + deletionRules?: DeletionRule[]; + indexSpecRules?: IndexSpecRule[]; + dataSchemaRules?: DataSchemaRule[]; +} + +export type RuleProvider = InlineRuleProvider; + +// --- Top-level reindex cascade config --- + +export interface ReindexCascadeConfig { + type: 'reindexCascade'; + dataSource: string; + defaultSegmentGranularity: string; + defaultPartitionsSpec: any; + defaultPartitioningVirtualColumns?: any; + ruleProvider: RuleProvider; + taskPriority?: number; + inputSegmentSizeBytes?: number; + taskContext?: Record+ Segment granularity used for intervals where no partitioning rule matches. This is the + default time bucketing for segments. +
+ ), + }, + { + name: 'defaultPartitionsSpec.type', + label: 'Default partitioning type', + type: 'string', + suggestions: ['dynamic', 'range'], + info: ( +
+ Partitioning strategy used for intervals where no partitioning rule matches. Use{' '}
+ dynamic for best-effort rollup or range for range-based
+ partitioning.
+
The dimensions to partition on.
, + }, + { + name: 'defaultPartitionsSpec.targetRowsPerSegment', + label: 'Default target rows per segment', + type: 'number', + zeroMeansUndefined: true, + defined: c => + oneOfKnown(deepGet(c, 'defaultPartitionsSpec.type'), KNOWN_DEFAULT_PARTITION_TYPES, 'range'), + required: c => + !deepGet(c, 'defaultPartitionsSpec.targetRowsPerSegment') && + !deepGet(c, 'defaultPartitionsSpec.maxRowsPerSegment'), + info: ( +
+ Target number of rows per segment. Either targetRowsPerSegment or{' '}
+ maxRowsPerSegment must be set.
+
+ Optional virtual columns used if your default partitions spec range partitioning definition + references virtual columns. +
+ ), + // customDialog is set by the CompactionConfigDialog component + }, + // ruleProvider (custom dialog) + { + name: 'ruleProvider', + label: 'Rule provider', + type: 'custom', + required: true, + customSummary: summarizeRuleProvider, + info: ( ++ Configure the reindexing rules that control how data is compacted as it ages. Rules define + partitioning, deletion, index spec, and data schema changes. +
+ ), + // customDialog is set by the CompactionConfigDialog component + }, + // Skip offset - virtual selector with 3 options: disabled, fromLatest, fromNow + { + name: 'skipOffsetType', + label: 'Skip offset', + type: 'string', + suggestions: ['disabled', 'fromLatest', 'fromNow'], + defaultValue: (c: ReindexCascadeConfig) => { + if (c.skipOffsetFromNow) return 'fromNow'; + if (c.skipOffsetFromLatest) return 'fromLatest'; + return 'disabled'; + }, + adjustment: c => { + const skipType = (c as any).skipOffsetType; + const adjusted = { ...c }; + if (skipType === 'fromNow') { + if (!adjusted.skipOffsetFromNow) { + adjusted.skipOffsetFromNow = adjusted.skipOffsetFromLatest || 'P1D'; + } + delete adjusted.skipOffsetFromLatest; + } else if (skipType === 'fromLatest') { + if (!adjusted.skipOffsetFromLatest) { + adjusted.skipOffsetFromLatest = adjusted.skipOffsetFromNow || 'P1D'; + } + delete adjusted.skipOffsetFromNow; + } else { + // disabled + delete adjusted.skipOffsetFromLatest; + delete adjusted.skipOffsetFromNow; + } + delete (adjusted as any).skipOffsetType; + return adjusted; + }, + info: ( +
+ Choose whether to skip recent data and how the offset is calculated. disabled{' '}
+ means no skip offset. fromLatest skips relative to the end of the latest
+ segment. fromNow skips relative to the current time.
+
ISO 8601 period. Skips data newer than this offset from the end of the latest segment.
+ ), + }, + { + name: 'skipOffsetFromNow', + label: 'Skip offset value', + type: 'string', + suggestions: ['PT0H', 'PT1H', 'P1D', 'P3D'], + defined: c => Boolean(c.skipOffsetFromNow), + info:ISO 8601 period. Skips data newer than this offset from the current time.
, + }, + { + name: 'taskPriority', + type: 'number', + defaultValue: 25, + min: 0, + hideInMore: true, + info:Priority of compaction tasks.
, + }, + { + name: 'inputSegmentSizeBytes', + type: 'size-bytes', + hideInMore: true, + info:Maximum total input segment size in bytes per compaction task.
, + }, + // Promoted task context fields + { + name: 'taskContext.useConcurrentLocks', + label: 'Task context: concurrent locks', + type: 'boolean', + defaultValue: false, + info: ( ++ Enable concurrent append and replace for the datasource. Recommended if you are appending + data to a datasource while compaction is running. +
+ ), + }, + { + name: 'taskContext.maxNumTasks', + label: 'Task context: max num tasks', + type: 'number', + min: 2, + placeholder: '(cluster default)', + zeroMeansUndefined: true, + info: ( ++ Maximum number of tasks (including the controller) for MSQ compaction. Must be at least 2 + (one controller, one worker). +
+ ), + }, + { + name: 'taskContext.maxRowsInMemory', + label: 'Task context: max rows in memory', + type: 'number', + zeroMeansUndefined: true, + placeholder: '(default)', + hideInMore: true, + info: ( ++ Maximum number of rows to hold in memory before persisting. Lower values reduce memory usage + but may increase disk I/O. +
+ ), + }, + { + name: 'taskContext.maxFrameSize', + label: 'Task context: max frame size', + type: 'number', + zeroMeansUndefined: true, + placeholder: '(default)', + hideInMore: true, + info: ( ++ Maximum frame size in bytes for MSQ tasks. Increase if tasks fail due to frame size limits. +
+ ), + }, + { + name: 'taskContext', + label: 'Task context: additional settings', + type: 'json', + hideInMore: true, + info: ( ++ Full task context map. Common settings are available as dedicated fields above. Use this to + set additional MSQ context parameters. +
+ ), + }, + { + name: 'tuningConfig', + type: 'json', + hideInMore: true, + info: ( +
+ Tuning config for compaction tasks. Note: you cannot set partitionsSpec inside{' '}
+ tuningConfig for cascading reindexing — partitioning is controlled by rules and
+ defaults.
+
Unique identifier for this rule.
, + }, + { + name: 'olderThan', + type: 'string', + required: true, + suggestions: PERIOD_SUGGESTIONS, + info: ( ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current + time minus this period. +
+ ), + }, + { + name: 'description', + type: 'string', + info:Human-readable description of this rule.
, + }, + { + name: 'segmentGranularity', + type: 'string', + required: true, + suggestions: SEGMENT_GRANULARITY_SUGGESTIONS, + info:Time granularity for segment buckets.
, + }, + { + name: 'partitionsSpec.type', + label: 'Partitioning type', + type: 'string', + suggestions: ['dynamic', 'range'], + info: ( +
+ Use dynamic for best-effort rollup or range for range-based
+ partitioning.
+
The dimensions to partition on.
, + }, + { + name: 'partitionsSpec.targetRowsPerSegment', + label: 'Target rows per segment', + type: 'number', + zeroMeansUndefined: true, + defined: r => deepGet(r, 'partitionsSpec.type') === 'range', + info:Target number of rows per segment for range partitioning.
, + }, + { + name: 'virtualColumns', + type: 'custom', + defined: r => deepGet(r, 'partitionsSpec.type') === 'range', + customSummary: summarizeVirtualColumns, + info:Virtual columns for partitioning by nested or derived fields.
, + // customDialog is set by the RuleProviderEditor component + }, +]; + +export const DELETION_RULE_FIELDS: FieldUnique identifier for this rule.
, + }, + { + name: 'olderThan', + type: 'string', + required: true, + suggestions: PERIOD_SUGGESTIONS, + info: ( ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current + time minus this period. +
+ ), + }, + { + name: 'description', + type: 'string', + info:Human-readable description of this rule.
, + }, + { + name: 'deleteWhere', + type: 'json', + required: true, + info: ( +
+ A Druid filter matching rows to delete. The compacted data retains rows
+ that do not match this filter. Multiple deletion rules combine as{' '}
+ NOT(A OR B OR C).
+
Virtual columns for filtering on nested or derived fields.
, + }, +]; + +export const INDEX_SPEC_RULE_FIELDS: FieldUnique identifier for this rule.
, + }, + { + name: 'olderThan', + type: 'string', + required: true, + suggestions: PERIOD_SUGGESTIONS, + info: ( ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current + time minus this period. +
+ ), + }, + { + name: 'description', + type: 'string', + info:Human-readable description of this rule.
, + }, + { + name: 'indexSpec', + type: 'json', + required: true, + info: ( ++ An IndexSpec object defining bitmap type, metric compression, and other encoding settings + for compacted segments. +
+ ), + }, +]; + +export const DATA_SCHEMA_RULE_FIELDS: FieldUnique identifier for this rule.
, + }, + { + name: 'olderThan', + type: 'string', + required: true, + suggestions: PERIOD_SUGGESTIONS, + info: ( ++ ISO 8601 period defining the age threshold. The rule applies to data older than the current + time minus this period. +
+ ), + }, + { + name: 'description', + type: 'string', + info:Human-readable description of this rule.
, + }, + { + name: 'queryGranularity', + type: 'string', + placeholder: '(unset)', + suggestions: SEGMENT_GRANULARITY_SUGGESTIONS, + info: ( ++ Query granularity for the compacted segments. Leave unset to preserve existing granularity. +
+ ), + }, + { + name: 'rollup', + type: 'boolean', + info: ( +
+ Whether to enable rollup. Set to true only when metricsSpec is
+ defined.
+
Array of aggregator factories for rollup metrics. Example:
+
+ {`[
+ {
+ "type": "longSum",
+ "name": "added",
+ "fieldName": "added"
+ },
+ {
+ "type": "longSum",
+ "name": "deleted",
+ "fieldName": "deleted"
+ }
+]`}
+
+ >
+ ),
+ },
+ {
+ name: 'dimensionsSpec',
+ type: 'json',
+ info: (
+ <>
+ Dimensions config for the compacted segments. Example:
+{`{
+ "dimensions": [
+ "page",
+ { "type": "string", "name": "channel" }
+ ]
+}`}
+ >
+ ),
+ },
+ {
+ name: 'projections',
+ type: 'json',
+ hideInMore: true,
+ info: List of aggregate projections.
, + }, +]; + +// --- Default config --- + +export function newReindexCascadeConfig(dataSource: string): ReindexCascadeConfig { + return { + type: 'reindexCascade', + dataSource, + defaultSegmentGranularity: 'DAY', + defaultPartitionsSpec: { type: 'dynamic', maxRowsPerSegment: 5000000 }, + ruleProvider: { type: 'inline' }, + }; +} diff --git a/web-console/src/druid-models/index.ts b/web-console/src/druid-models/index.ts index 7a3bb2218a97..3e51b9ec781a 100644 --- a/web-console/src/druid-models/index.ts +++ b/web-console/src/druid-models/index.ts @@ -20,6 +20,7 @@ export * from './array-ingest-mode/array-ingest-mode'; export * from './async-query/async-query'; export * from './broker-dynamic-config/broker-dynamic-config'; export * from './compaction-config/compaction-config'; +export * from './compaction-config/reindex-cascade-config'; export * from './compaction-dynamic-config/compaction-dynamic-config'; export * from './compaction-status/compaction-status'; export * from './console/console'; diff --git a/web-console/src/views/datasources-view/datasources-view.tsx b/web-console/src/views/datasources-view/datasources-view.tsx index 49e0f0e29966..767bbe0cc48f 100644 --- a/web-console/src/views/datasources-view/datasources-view.tsx +++ b/web-console/src/views/datasources-view/datasources-view.tsx @@ -316,6 +316,7 @@ export interface DatasourcesViewState { datasourcesAndDefaultRulesState: QueryState