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

Coalesce to default value for notnull type when inserting #338

Open
spff opened this issue Oct 18, 2022 · 1 comment
Open

Coalesce to default value for notnull type when inserting #338

spff opened this issue Oct 18, 2022 · 1 comment
Labels

Comments

@spff
Copy link
Contributor

spff commented Oct 18, 2022

Describe the bug
when type is notnull LowCardinality(String) DEFAULT 'NULL'

To Reproduce
Minimal piece of Python code that reproduces the problem.

    client.execute("drop table if exists testnn")
    client.execute("create table testnn (x String DEFAULT 'aaa') Engine=Memory")
    client.execute("insert into testnn VALUES", [('3')])
    client.execute("insert into testnn VALUES", [{'x': 'yee'}])
    print(list(client.execute_iter('select * from testnn')))
    client.execute("insert into testnn VALUES", [{'x': None}])
    client.execute("insert into testnn VALUES", [(None)])

Expected behavior
Should success as the default value

Versions

  • Version of package with the problem.
    0.2.4
  • ClickHouse server version. Version can be obtained by running SELECT version() query.
    22.6.1.1985
  • Python version.
    3.9
@spff
Copy link
Contributor Author

spff commented Oct 18, 2022

I've also tried the settings={'input_format_null_as_default': True} but it fallbacked to '' instead of 'aaa'

@xzkostyan xzkostyan added the bug label Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants