mirror of https://github.com/apache/druid.git
fix issue with segment metadata cache and complex types when doing out of order upgrades from 0.22 (#14948)
This commit is contained in:
parent
757603a773
commit
5cecf6ce8f
|
@ -961,6 +961,9 @@ public class SegmentMetadataCache
|
||||||
// likelyhood of upgrading from some version lower than 0.23 is low
|
// likelyhood of upgrading from some version lower than 0.23 is low
|
||||||
try {
|
try {
|
||||||
valueType = ColumnType.fromString(entry.getValue().getType());
|
valueType = ColumnType.fromString(entry.getValue().getType());
|
||||||
|
if (valueType == null) {
|
||||||
|
valueType = ColumnType.ofComplex(entry.getValue().getType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ignored) {
|
catch (IllegalArgumentException ignored) {
|
||||||
valueType = ColumnType.UNKNOWN_COMPLEX;
|
valueType = ColumnType.UNKNOWN_COMPLEX;
|
||||||
|
|
|
@ -1417,9 +1417,21 @@ public class SegmentMetadataCacheTest extends SegmentMetadataCacheCommon
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
1234,
|
1234,
|
||||||
26,
|
null,
|
||||||
"a",
|
null,
|
||||||
"z",
|
null,
|
||||||
|
null
|
||||||
|
),
|
||||||
|
"distinct",
|
||||||
|
new ColumnAnalysis(
|
||||||
|
null,
|
||||||
|
"hyperUnique",
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
1234,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -1433,7 +1445,7 @@ public class SegmentMetadataCacheTest extends SegmentMetadataCacheCommon
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
Assert.assertEquals(
|
Assert.assertEquals(
|
||||||
RowSignature.builder().add("a", ColumnType.STRING).add("count", ColumnType.LONG).build(),
|
RowSignature.builder().add("a", ColumnType.STRING).add("count", ColumnType.LONG).add("distinct", ColumnType.ofComplex("hyperUnique")).build(),
|
||||||
signature
|
signature
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue