ankit0811 commented on code in PR #14462:
URL: https://github.com/apache/druid/pull/14462#discussion_r1411612349
##########
processing/src/main/java/org/apache/druid/query/aggregation/first/DoubleFirstAggregatorFactory.java:
##########
@@ -142,12 +160,24 @@ public VectorAggregator factorizeVector(
VectorColumnSelectorFactory columnSelectorFactory
)
{
+ VectorValueSelector timeSelector =
columnSelectorFactory.makeValueSelector(timeColumn);
ColumnCapabilities capabilities =
columnSelectorFactory.getColumnCapabilities(fieldName);
+
if (Types.isNumeric(capabilities)) {
VectorValueSelector valueSelector =
columnSelectorFactory.makeValueSelector(fieldName);
- VectorValueSelector timeSelector =
columnSelectorFactory.makeValueSelector(
- timeColumn);
- return new DoubleFirstVectorAggregator(timeSelector, valueSelector);
+ VectorObjectSelector objectSelector =
ExpressionVectorSelectors.castValueSelectorToObject(
+ columnSelectorFactory.getReadableVectorInspector(),
+ fieldName,
+ valueSelector,
+ capabilities.toColumnType(),
+ ColumnType.DOUBLE
+ );
+ return new DoubleFirstVectorAggregator(timeSelector, objectSelector);
+ }
Review Comment:
This is the same code flow as StringFirstAggregatorFactory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]