Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue with segment metadata cache and complex types when doing out of order upgrades from 0.22 #14948

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,9 @@ static RowSignature analysisToRowSignature(final SegmentAnalysis analysis)
// likelyhood of upgrading from some version lower than 0.23 is low
try {
valueType = ColumnType.fromString(entry.getValue().getType());
if (valueType == null) {
valueType = ColumnType.ofComplex(entry.getValue().getType());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [ColumnAnalysis.getType](1) should be avoided because it has been deprecated.
}
}
catch (IllegalArgumentException ignored) {
valueType = ColumnType.UNKNOWN_COMPLEX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1417,9 +1417,21 @@ public void testSegmentMetadataFallbackType()
false,
true,
1234,
26,
"a",
"z",
null,
null,
null,
null
),
"distinct",
new ColumnAnalysis(
null,
"hyperUnique",
false,
true,
1234,
null,
null,
null,
null
)
)
Expand All @@ -1433,7 +1445,7 @@ public void testSegmentMetadataFallbackType()
)
);
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
);
}
Expand Down