mirror of https://github.com/apache/druid.git
fix incorrect ColumnInspector in IncrementalIndex.makeColumnSelectorFactory (#12155)
This commit is contained in:
parent
eb4fafe08f
commit
e0c4c568cb
|
@ -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();
|
||||
|
|
|
@ -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<InputRow> 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<InputRow> 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<IncrementalIndexRow> dimsComparator()
|
||||
|
|
Loading…
Reference in New Issue