Slackbot
03/24/2023, 3:20 PMKyle Hoondert
03/24/2023, 3:21 PMkey and value be in this case?Kumar Saket
03/24/2023, 3:22 PMgroupBy query is going to be used in a lookup table for quicker access.Kumar Saket
03/24/2023, 3:23 PMstring type to quantilesDoublesSketch ? I can store sketches as string in lookup table and when doing query - I can cast them to ``quantilesDoublesSketch``Kumar Saket
03/24/2023, 3:48 PMVijay Narayanan
03/24/2023, 4:09 PMKumar Saket
03/24/2023, 4:16 PM{
"queryType": "groupBy",
"dataSource": "table_name",
"granularity": "all",
"dimensions": [
"column_name"
],
"aggregations": [
{
"type": "quantilesDoublesSketch",
"fieldName": "double_sketch",
"k": 256,
"name": "baseline_quantile_sketch"
}
],
"postAggregations": [
{
"type": "fieldAccess",
"fieldName": "baseline_quantile_sketch",
"name": "baseline_quantile_sketch_raw"
}
],
"filter": {
"type": "and",
"fields": [
{
"type": "selector",
"dimension": "__model_id__",
"value": "079c6aa9-2027-4c0e-8fbf-c3c0817514d1"
},
{
"type": "in",
"dimension": "column_name",
"values": [
"area",
"baths",
"beds",
"datePriceChanged"
]
}
]
},
"intervals": "2015-08-28/2025-10-20"
}
This is my query, intension is to store column_name as key and baseline_quantile_sketch_raw as value.
I’m able to store baseline_quantile_sketch_raw as the value but in string datatype - wanted to see if this can be stored as sketch type?Kumar Saket
03/24/2023, 4:17 PMgroup by query will not give you a sketch. It will get you a number@Vijay Narayanan - Couldn’t really follow your comment, can you see the query I posted above..
Vijay Narayanan
03/24/2023, 4:28 PMKumar Saket
03/24/2023, 4:37 PMKumar Saket
03/24/2023, 4:58 PMApoorv Gupta
03/24/2023, 5:01 PMKumar Saket
03/24/2023, 5:21 PMSELECT
TIME_FLOOR(CASE WHEN CAST("t_hour" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("t_hour" AS BIGINT)) ELSE TIME_PARSE("t_hour") END, 'PT1H') AS __time,
"channel",
SUM("__count") AS "__count",
DS_THETA(COMPLEX_DECODE_BASE64('thetaSketch', "theta_user")) AS "theta_user",
DS_HLL(COMPLEX_DECODE_BASE64('HLLSketch', "hll_user")) AS "hll_user"
FROM "source"
GROUP BY 1, 2
PARTITIONED BY DAY
May be using COMPLEX_DECODE_BASE64 with DS_THETA or something similar should do the Job. Not sure though..Vijay Narayanan
03/25/2023, 2:25 AM