Slackbot
01/04/2024, 5:27 AMSoumyava Das
01/04/2024, 5:29 AMPhani Sai Chand Gali
01/04/2024, 5:39 AMSoumyava Das
01/04/2024, 5:44 AMPhani Sai Chand Gali
01/04/2024, 6:02 AMPhani Sai Chand Gali
01/04/2024, 6:17 AMSoumyava Das
01/04/2024, 8:09 AMPhani Sai Chand Gali
01/04/2024, 8:49 AMPhani Sai Chand Gali
01/04/2024, 8:51 AMApoorv Gupta
01/04/2024, 9:22 AMExprMacro ).
• We have so far only used these UDFs via native queries, but are interested in exposing them SQL as well so that we can move to SQL queries for everything.
What we need help with is understanding how to write calcite extensions to expose these UDFs in sql. For reference our UDFs generally take in 1-2 double sketches + 1-2 longs/doubles as inputs, and have a double as output.Apoorv Gupta
01/04/2024, 9:27 AM"virtualColumns": [
{
"type": "expression",
"name": "wasserstein_distance",
"expression": "approximateNumericalDrift(\"basesplit.baseline_quantile_sketch_raw\", \"actual_quantile_sketch_raw\", \u0027WASSERSTEIN\u0027)"
}
],
which we want to convert to something like:
SELECT approximateNumericalDrift(\"basesplit.baseline_quantile_sketch_raw\", \"actual_quantile_sketch_raw\", \u0027WASSERSTEIN\u0027) as wasserstein_distance"Apoorv Gupta
01/04/2024, 9:35 AMPhani Sai Chand Gali
01/04/2024, 1:06 PMPhani Sai Chand Gali
01/08/2024, 11:35 AMDATA_QUALITY_OUT_OF_RANGE
SELECT DATA_QUALITY_OUT_OF_RANGE(0.5, 0.99, DS_QUANTILES_SKETCH("double_sketch", 128)) FROM "my_table"
WHERE "count" > 1000
But when we try to use a Group By query
SELECT my_col, DATA_QUALITY_OUT_OF_RANGE(0.5, 0.99, DS_QUANTILES_SKETCH("double_sketch", 128)) FROM "my_table"
WHERE "count" > 1000
GROUP BY 1
, it gives us the following error
Error: Unknown exception
Cannot construct instance of `org.apache.druid.query.topn.TopNQuery`, problem: com/truera/expressions/OutOfRangeExpMacro$1DriftExpr at [Source: (org.eclipse.jetty.server.HttpInputOverHTTP); line: -1, column: 59291]
com.fasterxml.jackson.databind.exc.ValueInstantiationException
Could you help us on this?Soumyava Das
01/08/2024, 11:50 AM"useApproximateTopN": false in the query context. Also you can set "debug":true in the query context that will give you a detailed log. Will appreciate it if you can run and share the logMike Sherman
01/08/2024, 2:50 PMPhani Sai Chand Gali
01/09/2024, 2:26 AM