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 cd79884ce9 Remove actually unsupported config that selectively enable nullable columns (#10653) cd79884ce9 is described below commit cd79884ce9fe11d6775f7a4b5fc4245de2777ceb Author: Gonzalo Ortiz Jaureguizar <gor...@users.noreply.github.com> AuthorDate: Mon Oct 16 19:09:55 2023 +0200 Remove actually unsupported config that selectively enable nullable columns (#10653) --- .../local/segment/index/nullvalue/NullValueIndexType.java | 13 +++++-------- .../apache/pinot/segment/spi/index/AbstractIndexType.java | 6 +++++- .../segment/spi/index/MergedColumnConfigDeserializer.java | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java index 316b72ef0b..c468870821 100644 --- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java +++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java @@ -77,14 +77,11 @@ public class NullValueIndexType extends AbstractIndexType<IndexConfig, NullValue @Override public ColumnConfigDeserializer<IndexConfig> createDeserializer() { - return IndexConfigDeserializer.fromIndexes(getPrettyName(), getIndexConfigClass()) - .withFallbackAlternative( - IndexConfigDeserializer.ifIndexingConfig( - IndexConfigDeserializer.alwaysCall((TableConfig tableConfig, Schema schema) -> - tableConfig.getIndexingConfig().isNullHandlingEnabled() - ? IndexConfig.ENABLED - : IndexConfig.DISABLED)) - ); + return IndexConfigDeserializer.ifIndexingConfig( + IndexConfigDeserializer.alwaysCall((TableConfig tableConfig, Schema schema) -> + tableConfig.getIndexingConfig().isNullHandlingEnabled() + ? IndexConfig.ENABLED + : IndexConfig.DISABLED)); } public NullValueVectorCreator createIndexCreator(File indexDir, String columnName) { diff --git a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/AbstractIndexType.java b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/AbstractIndexType.java index 110360cee4..7bff03bef4 100644 --- a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/AbstractIndexType.java +++ b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/AbstractIndexType.java @@ -62,7 +62,11 @@ public abstract class AbstractIndexType<C extends IndexConfig, IR extends IndexR if (_deserializer == null) { _deserializer = createDeserializer(); } - return _deserializer.deserialize(tableConfig, schema); + try { + return _deserializer.deserialize(tableConfig, schema); + } catch (MergedColumnConfigDeserializer.ConfigDeclaredTwiceException ex) { + throw new MergedColumnConfigDeserializer.ConfigDeclaredTwiceException(ex.getColumn(), this, ex); + } } @Override diff --git a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/MergedColumnConfigDeserializer.java b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/MergedColumnConfigDeserializer.java index 5642034acd..e0467fc378 100644 --- a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/MergedColumnConfigDeserializer.java +++ b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/MergedColumnConfigDeserializer.java @@ -21,6 +21,7 @@ package org.apache.pinot.segment.spi.index; import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import javax.annotation.Nullable; import org.apache.pinot.spi.config.table.TableConfig; import org.apache.pinot.spi.data.Schema; @@ -60,15 +61,29 @@ public class MergedColumnConfigDeserializer<C> implements ColumnConfigDeserializ public static class ConfigDeclaredTwiceException extends RuntimeException { private final String _column; + @Nullable + private final IndexType<?, ?, ?> _indexType; + + public ConfigDeclaredTwiceException(String column, IndexType<?, ?, ?> index, Throwable t) { + super("Configuration is declared in two different ways for index " + index.getId() + " on column " + column, t); + _column = column; + _indexType = index; + } public ConfigDeclaredTwiceException(String column) { super("Configuration is declared in two different ways for column " + column); _column = column; + _indexType = null; } public String getColumn() { return _column; } + + @Nullable + public IndexType<?, ?, ?> getIndexType() { + return _indexType; + } } public static enum OnConflict { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org