Ari Huttunen
08/15/2023, 11:55 AM@Override
public @DataTypeHint("ARRAY<DOUBLE>") Double[] getValue(@DataTypeHint("RAW") PercentileArrayAggregateAccumulator acc) {
return acc.getValue();
}
calling this in the accumulator
public @DataTypeHint("ARRAY<DOUBLE>") Double[] getValue() {
return new Double[]{
digest.quantile(0.1),
digest.quantile(0.5),
digest.quantile(0.9)
};
}
Is this the right syntax? How would I handle the array in the SQL side? I saw "ARRAY<DOUBLE>" in some Flink code.
edit: the docs have this kind of an example
// define a nested data type
@DataTypeHint("ROW<s STRING, t TIMESTAMP_LTZ(3)>")
public Row eval(int i) {
return Row.of(String.valueOf(i), Instant.ofEpochSecond(i));
}