Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f8909b2
adds NestedCommonFormatColumnFormatSpec to customize json and auto co…
clintropolis Feb 27, 2025
721ff10
fix test
clintropolis Feb 27, 2025
0bc8cd2
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Jul 29, 2025
a1b7ac7
compaction stuff
clintropolis Jul 29, 2025
6c6fcd5
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Jul 29, 2025
97aa0da
fix compile
clintropolis Jul 29, 2025
1138259
fixes
clintropolis Jul 29, 2025
7c700f2
better name
clintropolis Jul 29, 2025
29a15ee
fix
clintropolis Jul 29, 2025
2419dd9
fix order
clintropolis Jul 29, 2025
0c47d50
fix test
clintropolis Jul 30, 2025
1b250c3
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Aug 7, 2025
9c9fc2c
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Aug 8, 2025
ee91313
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Sep 2, 2025
196075a
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Sep 15, 2025
51ff329
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Sep 19, 2025
0d44052
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Sep 19, 2025
026b958
changes:
clintropolis Sep 22, 2025
1f82393
static method
clintropolis Sep 22, 2025
054d9da
nullable
clintropolis Sep 22, 2025
1d3a0ad
fix npe
clintropolis Sep 22, 2025
e453fdf
oops
clintropolis Sep 22, 2025
60994e1
IndexSpec fields are now all nullable and not populated by default; p…
clintropolis Sep 24, 2025
1e20017
javadoc
clintropolis Sep 24, 2025
5eb46a1
missed one
clintropolis Sep 24, 2025
1940a77
fix test
clintropolis Sep 24, 2025
28e582f
fix more test
clintropolis Sep 24, 2025
e216a2a
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Sep 24, 2025
795bbc0
more javadoc
clintropolis Sep 25, 2025
1c739c6
rename class
clintropolis Sep 25, 2025
b47dd69
Merge remote-tracking branch 'upstream/master' into json-column-forma…
clintropolis Sep 30, 2025
56e428c
add log
clintropolis Sep 30, 2025
083beb2
fix test
clintropolis Sep 30, 2025
2732e1c
missed another one
clintropolis Sep 30, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void setup() throws IOException
indexFile = INDEX_MERGER_V9.persist(
incIndex,
tmpDir,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);
qIndex = INDEX_IO.loadIndex(indexFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void setup(FilteredAggregatorBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
qIndexesDir,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public void setup() throws IOException
final File file = INDEX_MERGER_V9.persist(
index,
new File(tmpDir, String.valueOf(i)),
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public void setup() throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndexes.get(i),
tmpFile,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void setup() throws IOException
File indexFile = indexMergerV9.persist(
incIndex,
tmpDir,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);

Expand All @@ -159,7 +159,7 @@ public void mergeV9(Blackhole blackhole) throws Exception
rollup,
schemaInfo.getAggsArray(),
tmpFile,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null,
-1
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void persistV9(Blackhole blackhole) throws Exception
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
tmpDir,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void setup()
final SegmentGenerator segmentGenerator = closer.register(new SegmentGenerator());

final QueryableIndex index =
segmentGenerator.generate(dataSegment, schemaInfo, IndexSpec.DEFAULT, Granularities.NONE, 1);
segmentGenerator.generate(dataSegment, schemaInfo, IndexSpec.getDefault(), Granularities.NONE, 1);

final Pair<PlannerFactory, SqlEngine> sqlSystem = SqlBaseBenchmark.createSqlSystem(
ImmutableMap.of(dataSegment, index),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ public void setup(GroupByBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ public void setup() throws JsonProcessingException
List<DimensionSchema> columnSchemas = schemaInfo.getDimensionsSpec()
.getDimensions()
.stream()
.map(x -> new AutoTypeColumnSchema(x.getName(), null))
.map(x -> AutoTypeColumnSchema.of(x.getName()))
.collect(Collectors.toList());
index = segmentGenerator.generate(
dataSegment,
schemaInfo,
DimensionsSpec.builder().setDimensions(columnSchemas).build(),
TransformSpec.NONE,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
Granularities.NONE,
rowsPerSegment
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public void setup(ScanBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public void setup(SearchBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ protected IndexSpec getIndexSpec()
.withComplexMetricCompression(
CompressionStrategy.valueOf(StringUtils.toUpperCase(complexCompression))
)
.build();
.build()
.getEffectiveSpec();
}

@Setup(Level.Trial)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class SqlBenchmarkDatasets
ImmutableList.copyOf(
Iterables.concat(
expressionsSchema.getDimensionsSpecExcludeAggs().getDimensions(),
Collections.singletonList(new AutoTypeColumnSchema("nested", null))
Collections.singletonList(AutoTypeColumnSchema.of("nested"))
)
)
).build(),
Expand Down Expand Up @@ -414,7 +414,7 @@ public BenchmarkSchema asAutoDimensions()
dimensionsSpec.withDimensions(
dimensionsSpec.getDimensions()
.stream()
.map(dim -> new AutoTypeColumnSchema(dim.getName(), null))
.map(dim -> AutoTypeColumnSchema.of(dim.getName()))
.collect(Collectors.toList())
),
aggregators,
Expand All @@ -425,7 +425,7 @@ public BenchmarkSchema asAutoDimensions()
.groupingColumns(
projection.getGroupingColumns()
.stream()
.map(dim -> new AutoTypeColumnSchema(dim.getName(), null))
.map(dim -> AutoTypeColumnSchema.of(dim.getName()))
.collect(Collectors.toList())
)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public void setup(TimeseriesBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void setup(TopNBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public void setup() throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndexes.get(i),
tmpDir,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
import org.apache.druid.query.aggregation.datasketches.theta.SketchModule;
import org.apache.druid.query.filter.SelectorDimFilter;
import org.apache.druid.segment.AutoTypeColumnSchema;
import org.apache.druid.segment.IndexSpec;
import org.apache.druid.segment.column.ColumnType;
import org.apache.druid.segment.nested.NestedCommonFormatColumnFormatSpec;
import org.apache.druid.segment.transform.CompactionTransformSpec;
import org.apache.druid.server.compaction.FixedIntervalOrderPolicy;
import org.apache.druid.server.coordinator.AutoCompactionSnapshot;
Expand Down Expand Up @@ -503,7 +505,7 @@ public void testAutoCompactionPreservesCreateBitmapIndexInDimensionSchema(Compac

List<DimensionSchema> dimensionSchemas = ImmutableList.of(
new StringDimensionSchema("language", DimensionSchema.MultiValueHandling.SORTED_ARRAY, false),
new AutoTypeColumnSchema("deleted", ColumnType.DOUBLE)
new AutoTypeColumnSchema("deleted", ColumnType.DOUBLE, null)
);

submitCompactionConfig(
Expand All @@ -519,7 +521,21 @@ public void testAutoCompactionPreservesCreateBitmapIndexInDimensionSchema(Compac
// Compacted into 1 segment for the entire year.
forceTriggerAutoCompaction(1);
verifySegmentsCompacted(1, MAX_ROWS_PER_SEGMENT_COMPACTED);
verifySegmentsCompactedDimensionSchema(dimensionSchemas);
List<DimensionSchema> expectedDimensionSchemas = List.of(
dimensionSchemas.get(0),
new AutoTypeColumnSchema(
"deleted",
ColumnType.DOUBLE,
// json serialization doesn't store bitmap in compaction state, so need to set to null
NestedCommonFormatColumnFormatSpec.builder(
NestedCommonFormatColumnFormatSpec.getEffectiveFormatSpec(
null,
IndexSpec.getDefault().getEffectiveSpec()
)
).setBitmapEncoding(null).build()
)
);
verifySegmentsCompactedDimensionSchema(expectedDimensionSchemas);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ public class ComplexTypesDeltaTable
new TimestampSpec("na", "posix", DateTimes.of("2024-01-01")),
new DimensionsSpec(
ImmutableList.of(
new AutoTypeColumnSchema("id", null),
new AutoTypeColumnSchema("array_info", null),
new AutoTypeColumnSchema("struct_info", null),
new AutoTypeColumnSchema("nested_struct_info", null),
new AutoTypeColumnSchema("map_info", null)
AutoTypeColumnSchema.of("id"),
AutoTypeColumnSchema.of("array_info"),
AutoTypeColumnSchema.of("struct_info"),
AutoTypeColumnSchema.of("nested_struct_info"),
AutoTypeColumnSchema.of("map_info")
)
),
ColumnsFilter.all()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public class SnapshotDeltaTable
new TimestampSpec("na", "posix", DateTimes.of("2024-01-01")),
new DimensionsSpec(
ImmutableList.of(
new AutoTypeColumnSchema("id", null),
new AutoTypeColumnSchema("map_info", null)
AutoTypeColumnSchema.of("id"),
AutoTypeColumnSchema.of("map_info")
)
),
ColumnsFilter.all()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void testSerdeWithDefaults() throws Exception
Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
Assert.assertEquals(new Period("PT10M"), config.getIntermediatePersistPeriod());
Assert.assertEquals(0, config.getMaxPendingPersists());
// Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpec());
// Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpec());
Assert.assertEquals(false, config.isReportParseExceptions());
Assert.assertEquals(Duration.ofMinutes(15).toMillis(), config.getHandoffConditionTimeout());

Expand Down Expand Up @@ -155,12 +155,13 @@ public void testtoString() throws Exception
"intermediatePersistPeriod=PT1H, " +
"maxPendingPersists=100, " +
"indexSpec=IndexSpec{" +
"bitmapSerdeFactory=RoaringBitmapSerdeFactory{}, " +
"dimensionCompression=lz4, " +
"stringDictionaryEncoding=Utf8{}, " +
"metricCompression=lz4, " +
"longEncoding=longs, " +
"bitmapSerdeFactory=null, " +
"dimensionCompression=null, " +
"stringDictionaryEncoding=null, " +
"metricCompression=null, " +
"longEncoding=null, " +
"complexMetricCompression=null, " +
"autoColumnFormatSpec=null, " +
"jsonCompression=null, " +
"segmentLoader=null" +
"}, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testSerdeWithDefaults() throws Exception
Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
Assert.assertEquals(new Period("PT10M"), config.getIntermediatePersistPeriod());
Assert.assertEquals(0, config.getMaxPendingPersists());
// Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpec());
// Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpec());
Assert.assertEquals(false, config.isReportParseExceptions());
Assert.assertEquals(java.time.Duration.ofMinutes(15).toMillis(), config.getHandoffConditionTimeout());
Assert.assertNull(config.getWorkerThreads());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,15 @@ public void testParseTransformNested() throws SchemaValidationException, IOExcep

DimensionsSpec dimensionsSpec = new DimensionsSpec(
ImmutableList.of(
new AutoTypeColumnSchema("someIntValueMap", null),
new AutoTypeColumnSchema("someStringValueMap", null),
new AutoTypeColumnSchema("someRecord", null),
new AutoTypeColumnSchema("someRecordArray", null),
AutoTypeColumnSchema.of("someIntValueMap"),
AutoTypeColumnSchema.of("someStringValueMap"),
AutoTypeColumnSchema.of("someRecord"),
AutoTypeColumnSchema.of("someRecordArray"),
new LongDimensionSchema("tSomeIntValueMap8"),
new LongDimensionSchema("tSomeIntValueMap8_2"),
new StringDimensionSchema("tSomeStringValueMap8"),
new LongDimensionSchema("tSomeRecordSubLong"),
new AutoTypeColumnSchema("tSomeRecordArray0", null),
AutoTypeColumnSchema.of("tSomeRecordArray0"),
new StringDimensionSchema("tSomeRecordArray0nestedString")
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public class DatasketchesProjectionTest extends InitializedNullHandlingTest
.groupingColumns(
projection.getGroupingColumns()
.stream()
.map(x -> new AutoTypeColumnSchema(x.getName(), null))
.map(x -> AutoTypeColumnSchema.of(x.getName()))
.collect(Collectors.toList())
)
.build()
Expand Down Expand Up @@ -167,7 +167,7 @@ public static Collection<?> constructorFeeder()

List<DimensionSchema> autoDims = dimsOrdered.getDimensions()
.stream()
.map(x -> new AutoTypeColumnSchema(x.getName(), null))
.map(x -> AutoTypeColumnSchema.of(x.getName()))
.collect(Collectors.toList());
for (boolean incremental : new boolean[]{true, false}) {
for (boolean sortByDim : new boolean[]{true, false}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public void testSerdeWithDefaults() throws Exception
Assert.assertNull(config.getMaxTotalRows());
Assert.assertEquals(new Period("PT10M"), config.getIntermediatePersistPeriod());
Assert.assertEquals(0, config.getMaxPendingPersists());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpec());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpecForIntermediatePersists());
Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpec());
Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpecForIntermediatePersists());
Assert.assertFalse(config.isReportParseExceptions());
Assert.assertEquals(Duration.ofMinutes(15).toMillis(), config.getHandoffConditionTimeout());
Assert.assertEquals(1, config.getNumPersistThreads());
Expand Down Expand Up @@ -139,8 +139,8 @@ public void testConvert()
.withMaxRowsPerSegment(2)
.withMaxTotalRows(10L)
.withMaxPendingPersists(4)
.withIndexSpec(IndexSpec.DEFAULT)
.withIndexSpecForIntermediatePersists(IndexSpec.DEFAULT)
.withIndexSpec(IndexSpec.getDefault())
.withIndexSpecForIntermediatePersists(IndexSpec.getDefault())
.withReportParseExceptions(true)
.withMaxColumnsToMerge(5)
.build();
Expand All @@ -154,7 +154,7 @@ public void testConvert()
Assert.assertEquals(new Period("PT3S"), copy.getIntermediatePersistPeriod());
Assert.assertNull(copy.getBasePersistDirectory());
Assert.assertEquals(4, copy.getMaxPendingPersists());
Assert.assertEquals(IndexSpec.DEFAULT, copy.getIndexSpec());
Assert.assertEquals(IndexSpec.getDefault(), copy.getIndexSpec());
Assert.assertTrue(copy.isReportParseExceptions());
Assert.assertEquals(5L, copy.getHandoffConditionTimeout());
Assert.assertEquals(2, copy.getNumPersistThreads());
Expand All @@ -174,8 +174,8 @@ public void testSerdeWithModifiedTuningConfigAddedField() throws IOException
new Period("PT3S"),
new File("/tmp/xxx"),
4,
IndexSpec.DEFAULT,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
IndexSpec.getDefault(),
true,
5L,
null,
Expand Down Expand Up @@ -227,8 +227,8 @@ public void testSerdeWithModifiedTuningConfigRemovedField() throws IOException
10L,
new Period("PT3S"),
4,
IndexSpec.DEFAULT,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
IndexSpec.getDefault(),
true,
5L,
null,
Expand Down Expand Up @@ -273,7 +273,7 @@ public void testEqualsAndHashCode()
EqualsVerifier.forClass(KafkaIndexTaskTuningConfig.class)
.withPrefabValues(
IndexSpec.class,
IndexSpec.DEFAULT,
IndexSpec.getDefault(),
IndexSpec.builder().withDimensionCompression(CompressionStrategy.ZSTD).build()
)
.usingGetClass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public void testSerdeWithDefaults() throws Exception
Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
Assert.assertEquals(new Period("PT10M"), config.getIntermediatePersistPeriod());
Assert.assertEquals(0, config.getMaxPendingPersists());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpec());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpecForIntermediatePersists());
Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpec());
Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpecForIntermediatePersists());
Assert.assertFalse(config.isReportParseExceptions());
Assert.assertEquals(java.time.Duration.ofMinutes(15).toMillis(), config.getHandoffConditionTimeout());
Assert.assertNull(config.getWorkerThreads());
Expand Down
Loading