-
Notifications
You must be signed in to change notification settings - Fork 8.3k
uniqTheta produces random results with multithreaded streams #45292
Copy link
Copy link
Closed
Labels
not plannedKnown issue, no plans to fix it currenltyKnown issue, no plans to fix it currenltyunexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.
Description
SELECT
count() AS cnt,
uniq(number) AS uniq,
(abs(uniq - cnt) / cnt) * 100 AS uniqError,
uniqTheta(number) AS uniqTheta,
(abs(uniqTheta - cnt) / cnt) * 100 AS ThetaError,
g
FROM
(
SELECT
number,
1 AS g
FROM numbers_mt(1000000000.)
)
GROUP BY g
┌────────cnt─┬───────uniq─┬─uniqError─┬─uniqTheta─┬─ThetaError─┬─g─┐
│ 1000000000 │ 1001803777 │ 0.1803777 │ 244195952 │ 75.5804048 │ 1 │
└────────────┴────────────┴───────────┴───────────┴────────────┴───┘
┌────────cnt─┬───────uniq─┬─uniqError─┬─uniqTheta─┬─ThetaError─┬─g─┐
│ 1000000000 │ 1001803777 │ 0.1803777 │ 499922124 │ 50.0077876 │ 1 │
└────────────┴────────────┴───────────┴───────────┴────────────┴───┘
┌────────cnt─┬───────uniq─┬─uniqError─┬─uniqTheta─┬─ThetaError─┬─g─┐
│ 1000000000 │ 1001803777 │ 0.1803777 │ 500732911 │ 49.9267089 │ 1 │
└────────────┴────────────┴───────────┴───────────┴────────────┴───┘
-- let's use numbers, not numbers_mt
SELECT
count() AS cnt,
uniq(number) AS uniq,
(abs(uniq - cnt) / cnt) * 100 AS uniqError,
uniqTheta(number) AS uniqTheta,
(abs(uniqTheta - cnt) / cnt) * 100 AS ThetaError,
g
FROM
(
SELECT
number,
1 AS g
FROM numbers(1000000000.)
)
GROUP BY g
┌────────cnt─┬───────uniq─┬─uniqError─┬─uniqTheta─┬──────────ThetaError─┬─g─┐
│ 1000000000 │ 1001803777 │ 0.1803777 │ 995807422 │ 0.41925779999999996 │ 1 │
└────────────┴────────────┴───────────┴───────────┴─────────────────────┴───┘
┌────────cnt─┬───────uniq─┬─uniqError─┬─uniqTheta─┬──────────ThetaError─┬─g─┐
│ 1000000000 │ 1001803777 │ 0.1803777 │ 995807422 │ 0.41925779999999996 │ 1 │
└────────────┴────────────┴───────────┴───────────┴─────────────────────┴───┘Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
not plannedKnown issue, no plans to fix it currenltyKnown issue, no plans to fix it currenltyunexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.