Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web-console/e2e-tests/auto-compaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('Auto-compaction', () => {
const compactionConfig = new CompactionConfig({
skipOffsetFromLatest: 'PT0S',
partitionsSpec: new CompactionHashPartitionsSpec({
numShards: 1,
numShards: null,
}),
});
await configureCompaction(page, datasourceName, compactionConfig);
Expand Down
6 changes: 4 additions & 2 deletions web-console/e2e-tests/component/datasources/compaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export class CompactionHashPartitionsSpec implements CompactionPartitionsSpec {

async apply(page: playwright.Page): Promise<void> {
await setInput(page, PARTITIONING_TYPE, this.type);
await setInput(page, 'Num shards', String(this.numShards));
if (this.numShards != null) {
await setInput(page, 'Num shards', String(this.numShards));
}
}
}

Expand All @@ -48,7 +50,7 @@ async function setInput(page: playwright.Page, label: string, value: string): Pr
}

interface CompactionHashPartitionsSpecProps {
readonly numShards: number;
readonly numShards: number | null;
}

export interface CompactionHashPartitionsSpec extends CompactionHashPartitionsSpecProps {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ exports[`CompactionDialog matches snapshot with compactionConfig (dynamic partit
</React.Fragment>,
"label": "Num shards",
"name": "tuningConfig.partitionsSpec.numShards",
"required": true,
"type": "number",
},
Object {
Expand Down Expand Up @@ -319,7 +318,6 @@ exports[`CompactionDialog matches snapshot with compactionConfig (hashed partiti
</React.Fragment>,
"label": "Num shards",
"name": "tuningConfig.partitionsSpec.numShards",
"required": true,
"type": "number",
},
Object {
Expand Down Expand Up @@ -444,7 +442,7 @@ exports[`CompactionDialog matches snapshot with compactionConfig (hashed partiti
text="Close"
/>
<Blueprint3.Button
disabled={true}
disabled={false}
intent="primary"
onClick={[Function]}
text="Submit"
Expand Down Expand Up @@ -546,7 +544,6 @@ exports[`CompactionDialog matches snapshot with compactionConfig (single_dim par
</React.Fragment>,
"label": "Num shards",
"name": "tuningConfig.partitionsSpec.numShards",
"required": true,
"type": "number",
},
Object {
Expand Down Expand Up @@ -773,7 +770,6 @@ exports[`CompactionDialog matches snapshot without compactionConfig 1`] = `
</React.Fragment>,
"label": "Num shards",
"name": "tuningConfig.partitionsSpec.numShards",
"required": true,
"type": "number",
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const COMPACTION_CONFIG_FIELDS: Field<CompactionConfig>[] = [
name: 'tuningConfig.partitionsSpec.numShards',
label: 'Num shards',
type: 'number',
required: true, // ToDo: this will no longer be required after https://github.com/apache/druid/pull/10419 is merged
defined: (t: CompactionConfig) => deepGet(t, 'tuningConfig.partitionsSpec.type') === 'hashed',
info: (
<>
Expand Down Expand Up @@ -211,13 +210,7 @@ function validCompactionConfig(compactionConfig: CompactionConfig): boolean {
deepGet(compactionConfig, 'tuningConfig.partitionsSpec.type') || 'dynamic';
switch (partitionsSpecType) {
// case 'dynamic': // Nothing to check for dynamic
case 'hashed':
// ToDo: this will no longer be required after https://github.com/apache/druid/pull/10419 is merged
if (!deepGet(compactionConfig, 'tuningConfig.partitionsSpec.numShards')) {
return false;
}
break;

// case 'hashed': // Nothing to check for hashed
case 'single_dim':
if (!deepGet(compactionConfig, 'tuningConfig.partitionsSpec.partitionDimension')) {
return false;
Expand Down
5 changes: 0 additions & 5 deletions web-console/src/utils/ingestion-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2114,10 +2114,6 @@ export function invalidTuningConfig(tuningConfig: TuningConfig, intervals: any):

if (!intervals) return true;
switch (deepGet(tuningConfig, 'partitionsSpec.type')) {
case 'hashed':
if (!deepGet(tuningConfig, 'partitionsSpec.numShards')) return true;
break;

case 'single_dim':
if (!deepGet(tuningConfig, 'partitionsSpec.partitionDimension')) return true;
const hasTargetRowsPerSegment = Boolean(
Expand Down Expand Up @@ -2190,7 +2186,6 @@ export function getPartitionRelatedTuningSpecFormFields(
label: 'Num shards',
type: 'number',
defined: (t: TuningConfig) => deepGet(t, 'partitionsSpec.type') === 'hashed',
required: true,
info: (
<>
Directly specify the number of shards to create. If this is specified and 'intervals'
Expand Down