You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2023/01/18 05:17:29 UTC
[GitHub] [druid] abhishekagarwal87 commented on a diff in pull request #13682: `date_expand` function
abhishekagarwal87 commented on code in PR #13682:
URL: https://github.com/apache/druid/pull/13682#discussion_r1073103928
##########
core/src/main/java/org/apache/druid/math/expr/Function.java:
##########
@@ -3681,4 +3681,58 @@ protected HumanReadableBytes.UnitSystem getUnitSystem()
return HumanReadableBytes.UnitSystem.DECIMAL;
}
}
+
+
+ class DateExpandFunction implements Function
+ {
+ @Override
+ public String name()
+ {
+ return "date_expand";
+ }
+
+ @Override
+ public void validateArguments(List<Expr> args)
+ {
+ validationHelperCheckArgumentCount(args, 3);
+ }
+
+ @Nullable
+ @Override
+ public ExpressionType getOutputType(Expr.InputBindingInspector inspector, List<Expr> args)
+ {
+ return ExpressionType.LONG_ARRAY;
+ }
+
+ @Override
+ public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings)
+ {
+ final ExprEval expr = args.get(0).eval(bindings);
+ final long time = expr.asLong();
+
+ final int start = args.get(1).eval(bindings).asInt();
+ final int end = args.get(2).eval(bindings).asInt();
+
+
+ Long[] s = new Long[end - start + 1];
Review Comment:
@clintropolis - do you have a class that @findingrish can use as an example?
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org