timeplus-io / proton-python-driver

Python driver for Proton which support Proton native wire protocol
Other
10 stars 3 forks source link

bool type exception when query bool type column in proton-python-client #5

Open jhao0117 opened 2 years ago

jhao0117 commented 2 years ago
  1. 22c4746c784c :) create stream test_type (uuid uuid, int int, uint uint8, string string, float float, decimal decimal32(3), bool bool, fixed_string fixed_string(32), date date, datetime datetime, enum enum('a'=1, 'b'=2, 'z'=26), lowcardi low_cardinality(string), tuple tuple(s string, i int), ipv4 ipv4, ipv6 ipv6, map map(string, int), nullable nullable(datetime64), timestamp datetime64(3) default now64(3))

CREATE STREAM test_type ( uuid uuid, int int, uint uint8, string string, float float, decimal decimal32(3), bool bool, fixed_string fixed_string(32), date date, datetime datetime, enum enum('a' = 1, 'b' = 2, 'z' = 26), lowcardi low_cardinality(string), tuple tuple(s string, i int), ipv4 ipv4, ipv6 ipv6, map map(string, int), nullable nullable(datetime64), timestamp datetime64(3) DEFAULT now64(3) )

Query id: 6259258a-77c1-4cfa-a3a1-f938b55c6868

  1. insert into test_type (uuid, int, uint, string, float, decimal, bool, fixed_string, date, datetime, enum, lowcardi, tuple, ipv4, ipv6, map, nullable, timestamp) values (generate_uuidv4(), -1234567, 12345678, '{@string}', 12345.1234, 123456.123, true, '{@string32}', to_date('2022-03-24'), to_datetime('2022-03-24 17:17:17'), 'a', '{@lowcardinalitystring}', ('a', 0), '192.168.168.168', '2a02:aa08:e000:3100::20', {'key1':111}, null ,'2020-01-01 11:11:11');

INSERT INTO test_type (uuid, int, uint, string, float, decimal, bool, fixed_string, date, datetime, enum, lowcardi, tuple, ipv4, ipv6, map, nullable, timestamp) FORMAT Values

Query id: 70b793d6-1117-490d-82c6-d0393be81016

Connecting to localhost:8463 as user default. Connected to proton server version 1.0.22 revision 54455.

Ok.

  1. execute select * from table(test_type) in proton-client, success.
  2. execute select * from table(test_type) in proton-python-client, exception.

    client.execute('select * from table(test_type)') Traceback (most recent call last): File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/columns/service.py", line 106, in get_column_by_spec cls = column_by_type[spec] KeyError: 'bool'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/client.py", line 296, in execute rv = self.process_ordinary_query( File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/client.py", line 482, in process_ordinary_query return self.receive_result(with_column_types=with_column_types, File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/client.py", line 143, in receive_result return result.get_result() File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/result.py", line 50, in get_result for packet in self.packet_generator: File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/client.py", line 159, in packet_generator packet = self.receive_packet() File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/client.py", line 173, in receive_packet packet = self.connection.receive_packet() File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/connection.py", line 485, in receive_packet packet.block = self.receive_data() File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/connection.py", line 558, in receive_data return (self.block_in_raw if raw else self.block_in).read() File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/streams/native.py", line 74, in read column = read_column(self.context, column_type, n_rows, File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/columns/service.py", line 115, in read_column column = get_column_by_spec(column_spec, column_options) File "/Users/jameshao/venvs/proton/lib/python3.9/site-packages/clickhouse_driver/columns/service.py", line 110, in get_column_by_spec raise errors.UnknownTypeError('Unknown type {}'.format(spec)) clickhouse_driver.errors.UnknownTypeError: Code: 50. Unknown type bool

jovezhong commented 2 years ago

(Jove Github Bot) deferred this ticket to the next sprint.

jovezhong commented 2 years ago

(Jove Github Bot) assuming it is not done, deferred this ticket to the next sprint.

jovezhong commented 2 years ago

(Jove Github Bot) assuming it is not done, deferred this ticket to the next sprint.

jovezhong commented 2 years ago

(Jove Github Bot) assuming it is not done, deferred this ticket to the next sprint.

jovezhong commented 1 year ago

(Jove Github Bot) assuming it is not done, deferred this ticket to the next sprint.

jovezhong commented 1 year ago

(Jove Github Bot) assuming it is not done, deferred this ticket to the next sprint.

jovezhong commented 1 year ago

(Jove Github Bot) assuming it is not done, deferred this ticket to the next sprint.