-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Tuple objects #372
Comments
What exception do you have? In [1]: import clickhouse_driver
...:
...: print(clickhouse_driver.__version__)
...: client = clickhouse_driver.Client.from_url('clickhouse://localhost')
...:
...: print(client.execute('SELECT version()'))
...: print(client.execute('SELECT tuple(number) FROM system.numbers limit 5'))
...: print(client.execute('SELECT tuple(number, number) FROM system.numbers limit 5'))
...:
0.2.5
[('23.3.1.2823',)]
[((0,),), ((1,),), ((2,),), ((3,),), ((4,),)]
[((0, 0),), ((1, 1),), ((2, 2),), ((3, 3),), ((4, 4),)] |
Some clarifications the columns in query must have type 'LowCardinality(string) and table Engine - MergeTree for one column I have infinite time for script execution |
Please provide snippet (CREATE TABLE, INSERT, SELECT) that throws this error. |
import clickhouse_driver
print(clickhouse_driver.__version__)
client = clickhouse_driver.Client.from_url('clickhouse://localhost')
print(client.execute('SELECT version()'))
# create table
create_query = '''CREATE TABLE IF NOT EXISTS test_low_cardinality_tuple
(
`column_1` LowCardinality(String),
`column_2` LowCardinality(String),
)
ENGINE = MergeTree
ORDER BY column_1
'''
client.execute(create_query)
# insert data
insert_query = 'INSERT INTO test_low_cardinality_tuple (column_1, column_2) VALUES'
VALUES = [('1', '2'), ('3', '4')]
client.execute(insert_query, VALUES)
# bad queries
test_query_1 = 'SELECT tuple(column_1) FROM test_low_cardinality_tuple'
test_query_2 = 'SELECT tuple(column_1, column_2) FROM test_low_cardinality_tuple'
# drop query
drop_query = 'DROP TABLE IF EXISTS test_low_cardinality_tuple'
# testing
try:
print(client.execute(test_query_1))
client.execute(drop_query)
except Exception as e:
print(str(e))
client.execute(drop_query)` |
xzkostyan
added a commit
that referenced
this issue
Apr 18, 2023
Fix is merged into latest master and will be included into next release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
clickhouse-driver cannot fulfill the request with
tuple
functionTo Reproduce
For reproduce a table with one or two column is suitable for you.
Queries examples
client.execute('SELECT tuple(column_1) FROM table')
client.execute('SELECT tuple(column_1, column_2) FROM table')
client.execute('SELECT (column_1,) FROM table')
client.execute('SELECT (column_1, column_2) FROM table')
Versions
The text was updated successfully, but these errors were encountered: