Skip to content

Commit

Permalink
Assign default value to newly added derived column upon reload (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
shounakmk219 authored Mar 18, 2024
1 parent 7c6ce9d commit 1f668c7
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,10 @@ protected boolean createColumnV1Indices(String column)
for (String argument : arguments) {
ColumnMetadata columnMetadata = _segmentMetadata.getColumnMetadataFor(argument);
if (columnMetadata == null) {
LOGGER.warn("Skip creating derived column: {} because argument: {} does not exist in the segment", column,
argument);
if (errorOnFailure) {
throw new RuntimeException(String.format(
"Failed to create derived column: %s because argument: %s does not exist in the segment", column,
argument));
}
return false;
LOGGER.warn("Assigning default value to derived column: {} because argument: {} does not exist in the "
+ "segment", column, argument);
createDefaultValueColumnV1Indices(column);
return true;
}
// TODO: Support creation of derived columns from forward index disabled columns
if (!_segmentWriter.hasIndexFor(argument, StandardIndexes.forward())) {
Expand Down

0 comments on commit 1f668c7

Please sign in to comment.