apache druid 目前版本迭代非常频繁,功能也有很大的升级,基本保持着 2个月左右就出现一次版本升级。
关联查询一般是nosql数据库难以实现的功能,但apache druid 最新版本中已经开始 支持 Joins。
支持Joins
-- Joins "sales" with "countries" (using "store" as the join key) to get sales by country.
SELECT
store_to_country.v AS country,
SUM(sales.revenue) AS country_revenue
FROM
sales
INNER JOIN lookup.store_to_country ON sales.store = store_to_country.k
GROUP BY
countries.v语法
<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
{
"queryType": "scan",
"dataSource": {
"type": "union",
"dataSources": ["<tableDataSourceName1>", "<tableDataSourceName2>", "<tableDataSourceName3>"]
},
"columns": ["column1", "column2"],
"intervals": ["0000/3000"]
}Sql 支持 thetaSketch
THETA_SKETCH_ESTIMATE(expr) | Returns the distinct count estimate from a theta sketch. expr must return a theta sketch. |
THETA_SKETCH_ESTIMATE_WITH_ERROR_BOUNDS(expr, errorBoundsStdDev) | Returns the distinct count estimate and error bounds from a theta sketch. expr must return a theta sketch. |
THETA_SKETCH_UNION([size], expr0, expr1, ...) | Returns a union of theta sketches, where each input expression must return a theta sketch. The size can be optionally specified as the first parameter. |
THETA_SKETCH_INTERSECT([size], expr0, expr1, ...) | Returns an intersection of theta sketches, where each input expression must return a theta sketch. The size can be optionally specified as the first parameter. |
THETA_SKETCH_NOT([size], expr0, expr1, ...) | Returns a set difference of theta sketches, where each input expression must return a theta sketch. The size can be optionally specified as the first parameter. |
更多的参加官网