Condition on UInt64 field in WHERE clause in ClickHouse

Viewed 189

In ClickHouse Playground dataset conditions on UInt64 fields don't seem to work. For example query:

SELECT * FROM hits_100m_obfuscated where WatchID = 8120543446287443000

doesn't return anything (even though I copied the ID from the dataset). Same is true if the condition is on UserID. But the following works just fine:

SELECT * FROM hits_100m_obfuscated where ClientIP = 3078276782

I guess the reason is that ClientIP field has type UInt32, but both UserID and WatchID - UInt64. I tried to use toUInt64 and CAST, but didn't succeed.

Any idea what am I doing wrong?

2 Answers

It looks like it is a bug of Playground.

As a temporary workaround, you can send a direct request to service endpoint using the favorite HTTP API client such as Postman, Fiddler, curl etc:

curl "https://play.clickhouse.tech/api/v20.3/?database=datasets&user=playground&password=clickhouse&query=SELECT+*+FROM+hits_100m_obfuscated+where+WatchID=8927014313511165737+limit+1+format+Vertical"

enter image description here

Related