chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[Bug]: Clickhouse storage fails when filtering some small floating point numbers

Open levand opened this issue 2 years ago • 0 comments

What happened?

When using the Clickhouse backend and sending a query that filters by metadata, Clickhouse throws a perplexing error of the form:

"error":"DatabaseError(\":HTTPDriver for http://test_clickhouse:8123 returned response code 400)\\n Code: 62. DB::Exception: Syntax error: failed at position 291 (')') (line 1, col 291): ))) AND collection_uuid = 'b79dba7f-b63d-46de-a161-c19ed1a0714b' ORDER BY collection_uuid\\n LIMIT 5000\\n FORMAT Native. Expected one of: token, DoubleColon\")"}

Example query to demonstrate the issue:

collection.get(where={'foo': {'$gt': 1.1125369292536007e-308}})

I have temporarily worked around this by casting all filter inputs in Clickhouse to float32 using numpy.float32(). But it shouldn't happen.

Versions

Chroma v0.3.22, Python 3.10

Relevant log output

No response

levand avatar May 02 '23 01:05 levand