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

Nullable fields #5

Open
workgena opened this issue May 29, 2017 · 3 comments
Open

Nullable fields #5

workgena opened this issue May 29, 2017 · 3 comments

Comments

@workgena
Copy link

workgena commented May 29, 2017

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.

@Fivell
Copy link

Fivell commented Jun 29, 2017

@archan937 , can this be merged?

@cerealcoder
Copy link

@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.

@clarsen
Copy link

clarsen commented May 30, 2019

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: ClickHouse/ClickHouse#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants