Slackbot
02/08/2023, 7:39 AMClint Wylie
02/08/2023, 10:18 AMClint Wylie
02/08/2023, 10:19 AMjson_object_agg, if you want ingestion to build the nested structures instead of just treat them like dimensionsClint Wylie
02/08/2023, 10:22 AMClint Wylie
02/08/2023, 10:23 AMClint Wylie
02/08/2023, 10:27 AMIgor Berman
02/08/2023, 10:28 AMIgor Berman
02/08/2023, 10:29 AMIgor Berman
02/08/2023, 10:30 AMClint Wylie
02/08/2023, 10:30 AMClint Wylie
02/08/2023, 10:30 AMClint Wylie
02/08/2023, 10:31 AMClint Wylie
02/08/2023, 10:32 AMClint Wylie
02/08/2023, 10:33 AMARRAY_AGG is currently only implemented as an expression aggregator https://github.com/apache/druid/blob/master/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArraySqlAggregator.java#L123Clint Wylie
02/08/2023, 10:34 AMIgor Berman
02/08/2023, 10:35 AMIgor Berman
02/08/2023, 10:35 AMClint Wylie
02/08/2023, 10:35 AMClint Wylie
02/08/2023, 10:36 AMClint Wylie
02/08/2023, 10:39 AMClint Wylie
02/08/2023, 10:42 AMClint Wylie
02/08/2023, 10:43 AMClint Wylie
02/08/2023, 10:45 AMClint Wylie
02/08/2023, 10:47 AMIgor Berman
02/08/2023, 10:47 AMClint Wylie
02/08/2023, 10:50 AMIgor Berman
02/08/2023, 1:08 PMError: Unknown exception
Function[json_query] second argument [('$.' || "k")] must be a literal [STRING] value
org.apache.druid.math.expr.ExpressionValidationException
{
"type": "expression",
"name": "country_id_agg",
"fields": [
"countryId"
],
"initialValue": "json_object()",
"fold": "json_object( map( (k) -> if( k==cast(countryId, string) , array(k, json_query(__acc, '$.'||k) + 1) , array(k,json_query(__acc, '$.'||k)) ), json_keys(__acc, '$') ) )",
"combine": "json_object(map((k) -> json_query(__acc, '$.'||k) + json_query(country_id_agg, '$.'||k), array_set_add_all(json_keys(__acc, '$'), json_keys(country_id_agg, '$'))))"
}Igor Berman
02/08/2023, 1:10 PM{
"type": "expression",
"name": "country_id_agg",
"fields": [
"countryId"
],
"initialValue": "[]",
"fold": "array_concat(fold( (kv1, kv2) -> json_object('k', json_value(kv1, '$.k'), 'v', json_value(kv1, '$.v') + json_value(kv2, '$.v') ), filter((kv) -> json_value(kv, '$.k') == countryId, __acc), json_object('k', countryId, 'v', 1) ) , filter((kv) -> json_value(kv, '$.k') != countryId, __acc) )",
"combine": "array_concat(__acc, country_id_agg)"
}
however it fails on
Error: Unknown exception
Cannot find strategy for type [COMPLEX<json>]
org.apache.druid.java.util.common.IAEIgor Berman
02/08/2023, 1:17 PMClint Wylie
02/08/2023, 11:34 PMCannot find strategy for type [COMPLEX<json>]
message seems a bit strange, what druid version?Clint Wylie
02/09/2023, 12:03 AMClint Wylie
02/09/2023, 12:05 AMIgor Berman
02/09/2023, 6:58 AMClint Wylie
02/09/2023, 11:43 AMClint Wylie
02/09/2023, 11:44 AMClint Wylie
02/09/2023, 11:46 AMClint Wylie
02/09/2023, 11:47 AMIgor Berman
02/09/2023, 11:48 AMIgor Berman
02/09/2023, 11:49 AMClint Wylie
02/09/2023, 11:49 AMSqlAggregator and how extensions wire them inClint Wylie
02/09/2023, 11:49 AMClint Wylie
02/09/2023, 11:53 AMFixedBucketsHistogramQuantileSqlAggregator is the fixed bucket histogram oneIgor Berman
02/09/2023, 11:53 AMIgor Berman
02/09/2023, 12:09 PMClint Wylie
02/09/2023, 12:12 PMClint Wylie
02/09/2023, 12:14 PMClint Wylie
02/09/2023, 12:15 PMClint Wylie
02/09/2023, 12:18 PMClint Wylie
02/09/2023, 12:19 PMIgor Berman
02/09/2023, 1:11 PMIgor Berman
02/09/2023, 8:10 PMClint Wylie
02/10/2023, 2:11 AMClint Wylie
02/10/2023, 2:16 AMClint Wylie
02/10/2023, 2:17 AMClint Wylie
02/10/2023, 2:18 AMClint Wylie
02/10/2023, 2:24 AMCompressedVariableSizedBlobColumnSerializer and corresponding CompressedVariableSizedBlobColumnSupplier)Clint Wylie
02/10/2023, 2:26 AMCOMPLEX<json> since that would conflict with the real nested columnsClint Wylie
02/10/2023, 2:26 AMClint Wylie
02/10/2023, 2:29 AMIgor Berman
02/10/2023, 10:00 AMComplex<Json> reference.Igor Berman
02/16/2023, 12:52 PM