diff --git a/indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java b/indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java index de07ffa9b89..7be4da386d8 100644 --- a/indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java +++ b/indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java @@ -39,7 +39,6 @@ import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.segment.DimensionHandlerUtils; import org.apache.druid.segment.VirtualColumns; import org.apache.druid.segment.column.ColumnType; -import org.apache.druid.segment.column.RowSignature; import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.incremental.IncrementalIndex; import org.apache.druid.segment.serde.ComplexMetricSerde; @@ -331,7 +330,7 @@ public class InputRowSerde writeString(k, out); try (Aggregator agg = aggFactory.factorize( - IncrementalIndex.makeColumnSelectorFactory(RowSignature.empty(), VirtualColumns.EMPTY, aggFactory, supplier, true) + IncrementalIndex.makeColumnSelectorFactory(VirtualColumns.EMPTY, aggFactory, supplier, true) )) { try { agg.aggregate(); diff --git a/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java b/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java index a94ae1c2349..d63c9b23191 100644 --- a/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java +++ b/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java @@ -71,6 +71,7 @@ import org.apache.druid.segment.column.ColumnCapabilities; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; import org.apache.druid.segment.column.ColumnHolder; import org.apache.druid.segment.column.ColumnType; +import org.apache.druid.segment.column.RowSignature; import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.serde.ComplexMetricExtractor; import org.apache.druid.segment.serde.ComplexMetricSerde; @@ -112,17 +113,18 @@ public abstract class IncrementalIndex extends AbstractIndex implements Iterable * @return column selector factory */ public static ColumnSelectorFactory makeColumnSelectorFactory( - final ColumnInspector columnInspector, final VirtualColumns virtualColumns, final AggregatorFactory agg, final Supplier in, final boolean deserializeComplexMetrics ) { + // we use RowSignature.empty() because ColumnInspector here should be the InputRow schema, not the + // IncrementalIndex schema, because we are reading values from the InputRow final RowBasedColumnSelectorFactory baseSelectorFactory = RowBasedColumnSelectorFactory.create( RowAdapters.standardRow(), in::get, - columnInspector, + RowSignature.empty(), true ); @@ -1019,7 +1021,7 @@ public abstract class IncrementalIndex extends AbstractIndex implements Iterable final boolean deserializeComplexMetrics ) { - return makeColumnSelectorFactory(this, virtualColumns, agg, in, deserializeComplexMetrics); + return makeColumnSelectorFactory(virtualColumns, agg, in, deserializeComplexMetrics); } protected final Comparator dimsComparator()