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

doesnt insert bigint with execute and list of values on mac m1 #400

Closed
ChepelDrepel opened this issue Nov 21, 2023 · 4 comments
Closed

doesnt insert bigint with execute and list of values on mac m1 #400

ChepelDrepel opened this issue Nov 21, 2023 · 4 comments

Comments

@ChepelDrepel
Copy link

ChepelDrepel commented Nov 21, 2023

ive created test table with uint256 col

a Uint256
) ENGINE = MergeTree()
      order by (a)

trying to insert with

    query="INSERT INTO default.test (a) values "
    client.execute(
        a,
        [{'a':123},],
        types_check=True,
    )

and it throws

File "clickhouse_driver/columns/largeint.pyx", line 216, in clickhouse_driver.columns.largeint.uint256_to_quads
TypeError: uint256_to_quads() takes exactly 2 positional arguments (3 given)

only on mac m1, same code with same driver works fine on window
clickhouse_driver 0.2.6
python3.10

@xzkostyan
Copy link
Member

Did you try latest master? It was fixed in 41ba852.

@butorov
Copy link

butorov commented Feb 7, 2024

Hi @xzkostyan,
I had a similar issue (but with int128_to_quads) on my M2 Pro.

...my app's stack trace...
|     client.execute(query, data)
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/client.py", line 367, in execute
|     rv = self.process_insert_query(
|          ^^^^^^^^^^^^^^^^^^^^^^^^^^
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/client.py", line 598, in process_insert_query
|     rv = self.send_data(sample_block, data,
|          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/client.py", line 651, in send_data
|     self.connection.send_data(block)
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/connection.py", line 667, in send_data
|     self.block_out.write(block)
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/streams/native.py", line 43, in write
|     write_column(self.context, col_name, col_type, items,
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/columns/service.py", line 167, in write_column
|     column.write_data(items, buf)
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/columns/base.py", line 145, in write_data
|     self._write_data(items, buf)
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/columns/decimalcolumn.py", line 70, in _write_data
|     super(DecimalColumn, self)._write_data(items, buf)
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/columns/base.py", line 149, in _write_data
|     self.write_items(prepared, buf)
|   File "/Users/user/.pyenv/versions/my-app-3.11.6/lib/python3.11/site-packages/clickhouse_driver/columns/intcolumn.py", line 113, in write_items
|     uint_64_pairs = self.to_quads(items, n_items)
|                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|   File "clickhouse_driver/columns/largeint.pyx", line 36, in clickhouse_driver.columns.largeint.int128_to_quads
| TypeError: int128_to_quads() takes exactly 2 positional arguments (3 given)
+------------------------------------

The same code works well while running in a Docker image (on the same machine, with the same Python and ClickHouse):

  • Python 3.11.6
  • ClickHouse 23.7.1 (ran in Docker from clickhouse/clickhouse-server:23.7.1)

I tested it with your latest master (on 24e8b35) and it worked well on all my test cases.

Do you have plans to release a new version with this bug fix? And is the master stable enough for production?

@xzkostyan
Copy link
Member

@butorov I'll release new version next week. Master is stable enough to be used in production.

@xzkostyan
Copy link
Member

Version 0.2.7 is released.

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.

3 participants