A
A
Andrey Andryushchenko2018-07-10 18:02:46
Python
Andrey Andryushchenko, 2018-07-10 18:02:46

How to store JSON object in ClickHouse DB?

I have data that is stored as JSON objects that can store arrays, for example:

{
    "name":"test1",
    "info":{"ver":"beta"},
    "addresses":[
        {"ip":"134.83.91.28", "port":80},
        {"ip":"134.83.92.73", "port":8080}
    ]
}

Of course, there are no problems with saving such fields as name , with such fields as ver , in principle, too (I just created a field add column info.ver String), but I can’t figure it out with saving arrays with objects.
Are there any ideas / ready-made solutions? I would also be glad if you tell me how to implement this using the clickhouse_driver python module

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dvska, 2018-07-26
@dvska

Throw addresses in a field like https://clickhouse.yandex/docs/ru/data_types/array/,
in the form "134.83.91.28:80".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question