This is an automated email from the ASF dual-hosted git repository. jackie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push: new c8c9c8444d [Minor] Fix typo in table config validation (#16081) c8c9c8444d is described below commit c8c9c8444de4a9396e6ec6a96c2f83a34ba634f1 Author: Xiaotian (Jackie) Jiang <17555551+jackie-ji...@users.noreply.github.com> AuthorDate: Wed Jun 11 15:57:19 2025 -0600 [Minor] Fix typo in table config validation (#16081) --- .../pinot/segment/local/utils/TableConfigUtils.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java index fa5a2b139f..c1edee398f 100644 --- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java +++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java @@ -108,7 +108,6 @@ public final class TableConfigUtils { } private static final Logger LOGGER = LoggerFactory.getLogger(TableConfigUtils.class); - private static final String STAR_TREE_CONFIG_NAME = "StarTreeIndex Config"; // supported TableTaskTypes, must be identical to the one return in the impl of {@link PinotTaskGenerator}. private static final String UPSERT_COMPACTION_TASK_TYPE = "UpsertCompactionTask"; @@ -428,6 +427,7 @@ public final class TableConfigUtils { "The destination column '" + columnName + "' of the aggregation function must be present in the schema"); Preconditions.checkState(fieldSpec.getFieldType() == FieldSpec.FieldType.METRIC, "The destination column '" + columnName + "' of the aggregation function must be a metric column"); + DataType dataType = fieldSpec.getDataType(); if (!aggregationColumns.add(columnName)) { throw new IllegalStateException("Duplicate aggregation config found for column '" + columnName + "'"); @@ -460,7 +460,6 @@ public final class TableConfigUtils { Preconditions.checkState(StringUtils.isNumeric(literal), "Second argument of DISTINCT_COUNT_HLL must be a number: %s", aggregationConfig); } - DataType dataType = fieldSpec.getDataType(); Preconditions.checkState(dataType == DataType.BYTES, "Result type for DISTINCT_COUNT_HLL must be BYTES: %s", aggregationConfig); } else if (functionType == DISTINCTCOUNTHLLPLUS) { @@ -482,11 +481,8 @@ public final class TableConfigUtils { Preconditions.checkState(StringUtils.isNumeric(literal), "Third argument of DISTINCT_COUNT_HLL_PLUS must be a number: %s", aggregationConfig); } - if (fieldSpec != null) { - DataType dataType = fieldSpec.getDataType(); - Preconditions.checkState(dataType == DataType.BYTES, - "Result type for DISTINCT_COUNT_HLL_PLUS must be BYTES: %s", aggregationConfig); - } + Preconditions.checkState(dataType == DataType.BYTES, + "Result type for DISTINCT_COUNT_HLL_PLUS must be BYTES: %s", aggregationConfig); } else if (functionType == SUMPRECISION) { Preconditions.checkState(numArguments >= 2 && numArguments <= 3, "SUM_PRECISION must specify precision (required), scale (optional): %s", aggregationConfig); @@ -496,11 +492,8 @@ public final class TableConfigUtils { String literal = secondArgument.getLiteral().getStringValue(); Preconditions.checkState(StringUtils.isNumeric(literal), "Second argument of SUM_PRECISION must be a number: %s", aggregationConfig); - if (fieldSpec != null) { - DataType dataType = fieldSpec.getDataType(); - Preconditions.checkState(dataType == DataType.BIG_DECIMAL || dataType == DataType.BYTES, - "Result type for DISTINCT_COUNT_HLL must be BIG_DECIMAL or BYTES: %s", aggregationConfig); - } + Preconditions.checkState(dataType == DataType.BIG_DECIMAL || dataType == DataType.BYTES, + "Result type for SUM_PRECISION must be BIG_DECIMAL or BYTES: %s", aggregationConfig); } else { Preconditions.checkState(numArguments == 1, "%s can only have one argument: %s", functionType, aggregationConfig); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org