-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query using JSONExtractRaw over a boolean value hangs with 100% CPU usage #6195
Labels
bug
Confirmed user-visible misbehaviour in official release
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TL;DR
Describe the bug
Running such a query over a MergeTree table makes it hang and use 100% of the CPU core:
SELECT click_id, JSONExtractRaw(data, 'adBlock') FROM fingerprint WHERE date = today() ORDER BY created_at LIMIT 1;
It doesn't get either killed or completed (waited for a hour on a table with just ~500K rows). There's also nothing in the error log. Had to restart the server :(
The funny thing is if I explicitly add more clauses in the WHERE, there's no hanging. Like this one:
SELECT click_id, JSONExtractRaw(data, 'adBlock') FROM fingerprint WHERE date = today() AND click_id = 'd60f013d-2f15-4c34-8a33-39de48e6b97b' ORDER BY created_at LIMIT 1;
(the
click_id
value is the same that would've returned by the first query)JSONExtractRaw(data, 'otherKey')
over the keys having the string (and not a boolean) works fine. It seems to happen only with the booleans.Other functions like JSONExtractString or JSONExtractBool over those boolean elements work fine.
(well, I was also hoping that
JSONExtractString(json_string_field, 'some_boolean')
would return'true'
or'false'
, but whatever)SELECT DISTINCT visitParamExtractRaw(data, 'adBlock') FROM fingerprint;
shows:The third, empty value is there because there are several rows with the
data
being the empty string (not even an empty object like'{}'
).By the way,
visitParamExtractRaw
works fine:perf top -p $(pidof clickhouse-server)
while having multiple hanged queries:The same command while everything's alright:
Additional context
It's a MergeTree table that originally had such structure:
Then I added a new column:
The trace log of such a hanged query:
It's weird, but I couldn't reproduce it myself yet.
The text was updated successfully, but these errors were encountered: