Skip to content
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

JSONAnalyze aggregate function #8867

Open
alexey-milovidov opened this issue Jan 27, 2020 · 3 comments
Open

JSONAnalyze aggregate function #8867

alexey-milovidov opened this issue Jan 27, 2020 · 3 comments
Labels
feature warmup task The task for new ClickHouse team members. Low risk, moderate complexity, no urgency.

Comments

@alexey-milovidov
Copy link
Member

alexey-milovidov commented Jan 27, 2020

Use case
The aggregate function takes String argument with JSON and outputs Array with all distinct paths in JSON along with the smallest data type that can accomodate all data values.

Example:

{"a": 123, "b": "2020-01-01T01:02:03Z"}
{"c": [123, 456], "b": "2020-01-01T01:02:03Z", "d": {"a": -1}}

The function should return

[
('a', 'Nullable(UInt8)'),
('b', 'DateTime'),
('c', 'Array(UInt16)'),
('d.a', 'Nullable(Int8)')
]
@freedomDR
Copy link
Contributor

Maybe I can achieve it ?

@alexey-milovidov
Copy link
Member Author

@freedomDR This will be very helpful!

@alexey-milovidov
Copy link
Member Author

The function should return the inferred type name, as the schema inference would do under the same settings.
Let's start with an ordinary function that will analyze just a single JSON.

@alexey-milovidov alexey-milovidov added warmup task The task for new ClickHouse team members. Low risk, moderate complexity, no urgency. and removed minor Priority: minor labels Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature warmup task The task for new ClickHouse team members. Low risk, moderate complexity, no urgency.
Projects
None yet
Development

No branches or pull requests

2 participants