clickhouse
clickhouse copied to clipboard
Nullable fields
Recently Yandex added support for Nullable types. But this gem does not support them.
Nullable fields are not documented yet. Some info can be found here
I forked gem and fixed this issue: https://github.com/workgena/clickhouse/pull/1/files https://github.com/workgena/clickhouse/pull/2/files
I'll try to write some test on this and create PR later.
@archan937 , can this be merged?
@workgena, have you been able to create any documentation regarding the use cases for, and the behavior of the Nullable feature? Let me know if you need any help typing something up.
Aside from fixing NULL on select, NULLs on INSERT still won't be handled well with the CSVWithNames format that the ruby driver uses due to this existing issue: https://github.com/yandex/ClickHouse/issues/469
I'm unable to insert where the schema says the field is Nullable and the record passed to Clickhouse.connection.insert_rows has a null value. Attempting the same insert with clickhouse-client CLI with a few different variations of "NULL", e.g. empty string, \N, gives same error.
FWIW, the JSONRows import format handles nulls fine, so modifying Clickhouse.connection.insert_rows to use that if there's a nil valued field is a way to make it work.