-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Support dot notation for JSON-casted columns #53908
Copy link
Copy link
Closed
Labels
Description
Use case
Improved UX for querying JSON-casted data (e.g. stored as a string). Schema inference would determine the type at query-time.
Describe the solution you'd like
Querying like:
SELECT o.a, o.b.c, o.b.d[3] FROM json
Rather than:
SELECT JSONExtractString(JSONExtractString(message, 'request'), 'method') as method,
JSONExtractInt(message, 'status') as status,
count()
...
Describe alternatives you've considered
Using a JSON data type is the only decent UX in clickhouse for JSON data. The other approaches advised such as pair-wise arrays or maps feel hacky and/or don't support keys with different data types (e.g. a is int, b is string).
The JSON data type is also not ideal for high-cardinality of possible JSON paths: #39492
Here is a fiddle of what I would like to do (and it fails): https://fiddle.clickhouse.com/db25eb58-311c-4c41-b0d5-36630cf8f78d
Reactions are currently unavailable