Slackbot
03/08/2023, 11:57 AMVijay Narayanan
03/08/2023, 12:28 PMVijay Narayanan
03/08/2023, 12:29 PMLior Durahly
03/08/2023, 2:20 PMSELECT "ORDINAL_POSITION", "COLUMN_NAME", "IS_NULLABLE", "DATA_TYPE", "JDBC_TYPE"
FROM INFORMATION_SCHEMA.COLUMNS
where "COLUMN_NAME" = 'k1024'
I got the attached result
But running the ds_histogram on the column like use suggesting:
SELECT
DS_HISTOGRAM("k1024",10,20,30) AS median_s
FROM "wikipedia_new"
Gives me the following error:
Error: SQL query is unsupported
Query not supported. Please check Broker logs for additional details. SQL was: SELECT DS_HISTOGRAM("k1024",10,20,30) AS median_s FROM "wikipedia_new"
org.apache.calcite.plan.RelOptPlanner$CannotPlanExceptionVijay Narayanan
03/08/2023, 2:30 PMselect DS_HISTOGRAM(DS_QUANTILES_SKETCH("sum_added"),20,30,40) from "wikipedia_quantilesketch"
and got
[14386.0,1152.0,1276.0,7619.0]
sum_added is a quantilesdoublesketch created in the druid ingestionVijay Narayanan
03/08/2023, 2:30 PMLior Durahly
03/08/2023, 2:32 PMDS_QUANTILES_SKETCH causes druid to recalculate the sketch and not use the pre-calculated sketch(by the plan I attached)Vijay Narayanan
03/08/2023, 2:34 PMLior Durahly
03/08/2023, 2:37 PMLior Durahly
03/08/2023, 2:40 PMsum_added and addaed gives the same planVadim
03/08/2023, 11:23 PMAS in on of your queries implied) you want to use APPROX_QUANTILE_DS(expr, probability, [k]) with the second argument as 0.5, the first argument could be a sketch column or a numeric column (see https://druid.apache.org/docs/latest/querying/sql-aggregations.html)Gian Merlino
03/09/2023, 2:59 AMCool, thank you for the answer.
Is it possible to see how the query runs under the hood and see that it does sketch merge?☝️ for this, if you see a sketch type in
aggregations with fieldName set to the name of a sketch column, then it is doing a sketch mergeLior Durahly
03/09/2023, 1:28 PMASLior Durahly
03/09/2023, 1:31 PMsketch merge because from the plan I cant see thatGian Merlino
03/09/2023, 11:45 PMk1024 is a sketch field (the JSON won't tell you that; but if it is, then you would get a sketch merge)Lior Durahly
03/12/2023, 8:53 AMGian Merlino
03/13/2023, 9:09 PM