gianm commented on code in PR #18500:
URL: https://github.com/apache/druid/pull/18500#discussion_r2334344433


##########
processing/src/main/java/org/apache/druid/query/expression/TimestampExtractExprMacro.java:
##########
@@ -183,6 +188,38 @@ public ExpressionType getOutputType(InputBindingInspector 
inspector)
     {
       return getOutputExpressionType(unit);
     }
+
+    @Override
+    public boolean canVectorize(InputBindingInspector inspector)
+    {
+      return args.get(0).canVectorize(inspector);
+    }
+
+    @Override
+    public <T> ExprVectorProcessor<T> 
asVectorProcessor(VectorInputBindingInspector inspector)
+    {
+      final ExprVectorProcessor<?> processor;
+
+      if (getOutputExpressionType(unit).is(ExprType.DOUBLE)) {
+        processor = new DoubleUnivariateLongFunctionVectorProcessor(
+            
CastToTypeVectorProcessor.cast(args.get(0).asVectorProcessor(inspector), 
ExpressionType.LONG),
+            input -> {
+              final DateTime dateTime = new DateTime(input, chronology);
+              return getExprEval(dateTime, unit).asDouble();

Review Comment:
   Reworked to split this into two methods that return `long` or `double` 
directly.



-- 
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]

Reply via email to