This message was deleted.
# general
s
This message was deleted.
j
We use a `queryGranularity`of `minute`during ingestion and query.
v
What a fascinating use-case!
I just tried to use
longLast
for ingestion and it seems to work at least in the data loader (via the sampler):
Opa! nope, that did not actually work:
LongLastAggregatorFactory is not supported during ingestion for rollup
d
I use stringFirst and stringLast to get the first and last values of an event that has a fixed daily timestamp, effectively getting the latest and earliest values that were emitted that day. This works well, however you can't group by an aggregation so you can't
select count(*), latest(myfield) from table group by 2
because it is an agg of an agg. But I found you can actually group by it by using a scalar instead of
latest
, eg
json_value(parse_json(to_json_string("myfield")),'$.rhs', 'STRING'))
. Ideally you could just use
json_value
, but you can't seem to treat a
Complex<Tuple<T1,T2>>
as json even though it renders that way (probably an oversight in druid, no more than that).
I should warn doing that without perfect rollup or reasonably sized subqueries is not advised.
j
Thank you all for your replies πŸ˜€. @David McHealy : Fortunately, we don’t have to group by that field, at least to my knowledge. Do you specify a timeColumn during ingestion, or are you using the default?
a
there is a PR to add this missing support - https://github.com/apache/druid/pull/10949 - posting here in case anyone in this thread wants to take that PR to the finish line πŸ˜‰
j
@Abhishek Agarwal Thank you, that looks great πŸ™‚ If I continue to be assigned on this project I might just pick that PR up. I have to brush up my java skills though πŸ˜…
πŸ™Œ 1