From 1f668c72d29c264e723510d397f0aea518c27b34 Mon Sep 17 00:00:00 2001 From: Shounak kulkarni Date: Tue, 19 Mar 2024 02:52:02 +0500 Subject: [PATCH] Assign default value to newly added derived column upon reload (#12648) --- .../defaultcolumn/BaseDefaultColumnHandler.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/defaultcolumn/BaseDefaultColumnHandler.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/defaultcolumn/BaseDefaultColumnHandler.java index bb55d27f33b8..67e92fd63a10 100644 --- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/defaultcolumn/BaseDefaultColumnHandler.java +++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/defaultcolumn/BaseDefaultColumnHandler.java @@ -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())) {