clickhouse-driver 0.1.3__cp38-cp38-macosx_10_9_x86_64.whl → 0.2.9__cp38-cp38-macosx_10_9_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- clickhouse_driver/__init__.py +1 -1
- clickhouse_driver/block.py +36 -4
- clickhouse_driver/bufferedreader.cpython-38-darwin.so +0 -0
- clickhouse_driver/bufferedwriter.cpython-38-darwin.so +0 -0
- clickhouse_driver/client.py +439 -135
- clickhouse_driver/clientinfo.py +44 -5
- clickhouse_driver/columns/arraycolumn.py +73 -106
- clickhouse_driver/columns/base.py +81 -7
- clickhouse_driver/columns/boolcolumn.py +7 -0
- clickhouse_driver/columns/datecolumn.py +69 -10
- clickhouse_driver/columns/datetimecolumn.py +15 -29
- clickhouse_driver/columns/decimalcolumn.py +20 -59
- clickhouse_driver/columns/enumcolumn.py +29 -20
- clickhouse_driver/columns/floatcolumn.py +4 -5
- clickhouse_driver/columns/intcolumn.py +63 -2
- clickhouse_driver/columns/ipcolumn.py +2 -3
- clickhouse_driver/columns/jsoncolumn.py +37 -0
- clickhouse_driver/columns/largeint.cpython-38-darwin.so +0 -0
- clickhouse_driver/columns/lowcardinalitycolumn.py +26 -7
- clickhouse_driver/columns/mapcolumn.py +73 -0
- clickhouse_driver/columns/nestedcolumn.py +10 -0
- clickhouse_driver/columns/numpy/__init__.py +0 -0
- clickhouse_driver/columns/numpy/base.py +47 -0
- clickhouse_driver/columns/numpy/boolcolumn.py +8 -0
- clickhouse_driver/columns/numpy/datecolumn.py +19 -0
- clickhouse_driver/columns/numpy/datetimecolumn.py +146 -0
- clickhouse_driver/columns/numpy/floatcolumn.py +24 -0
- clickhouse_driver/columns/numpy/intcolumn.py +43 -0
- clickhouse_driver/columns/numpy/lowcardinalitycolumn.py +96 -0
- clickhouse_driver/columns/numpy/service.py +58 -0
- clickhouse_driver/columns/numpy/stringcolumn.py +78 -0
- clickhouse_driver/columns/numpy/tuplecolumn.py +37 -0
- clickhouse_driver/columns/service.py +86 -17
- clickhouse_driver/columns/simpleaggregatefunctioncolumn.py +1 -1
- clickhouse_driver/columns/stringcolumn.py +73 -0
- clickhouse_driver/columns/tuplecolumn.py +63 -0
- clickhouse_driver/columns/util.py +61 -0
- clickhouse_driver/columns/uuidcolumn.py +2 -3
- clickhouse_driver/compression/base.py +39 -4
- clickhouse_driver/compression/lz4.py +4 -38
- clickhouse_driver/compression/zstd.py +4 -35
- clickhouse_driver/connection.py +275 -47
- clickhouse_driver/context.py +5 -0
- clickhouse_driver/dbapi/__init__.py +9 -6
- clickhouse_driver/dbapi/connection.py +16 -5
- clickhouse_driver/dbapi/cursor.py +37 -3
- clickhouse_driver/dbapi/errors.py +2 -3
- clickhouse_driver/dbapi/extras.py +73 -0
- clickhouse_driver/defines.py +27 -3
- clickhouse_driver/errors.py +24 -44
- clickhouse_driver/log.py +16 -5
- clickhouse_driver/numpy/__init__.py +0 -0
- clickhouse_driver/numpy/block.py +8 -0
- clickhouse_driver/numpy/helpers.py +28 -0
- clickhouse_driver/numpy/result.py +123 -0
- clickhouse_driver/opentelemetry.py +43 -0
- clickhouse_driver/progress.py +15 -3
- clickhouse_driver/protocol.py +28 -3
- clickhouse_driver/result.py +14 -19
- clickhouse_driver/settings/available.py +52 -0
- clickhouse_driver/settings/types.py +2 -2
- clickhouse_driver/settings/writer.py +22 -9
- clickhouse_driver/streams/native.py +32 -8
- clickhouse_driver/util/compat.py +38 -41
- clickhouse_driver/util/escape.py +47 -10
- clickhouse_driver/util/helpers.py +148 -5
- clickhouse_driver/varint.cpython-38-darwin.so +0 -0
- clickhouse_driver/writer.py +2 -6
- {clickhouse_driver-0.1.3.dist-info → clickhouse_driver-0.2.9.dist-info}/METADATA +31 -20
- clickhouse_driver-0.2.9.dist-info/RECORD +89 -0
- {clickhouse_driver-0.1.3.dist-info → clickhouse_driver-0.2.9.dist-info}/WHEEL +1 -1
- clickhouse_driver/columns/stringcolumn.cpython-38-darwin.so +0 -0
- clickhouse_driver-0.1.3.dist-info/RECORD +0 -65
- {clickhouse_driver-0.1.3.dist-info → clickhouse_driver-0.2.9.dist-info}/LICENSE +0 -0
- {clickhouse_driver-0.1.3.dist-info → clickhouse_driver-0.2.9.dist-info}/top_level.txt +0 -0
clickhouse_driver/__init__.py
CHANGED
clickhouse_driver/block.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from .columns.util import get_inner_spec, get_inner_columns_with_types
|
|
1
2
|
from .reader import read_varint, read_binary_uint8, read_binary_int32
|
|
2
3
|
from .varint import write_varint
|
|
3
4
|
from .writer import write_binary_uint8, write_binary_int32
|
|
@@ -61,7 +62,7 @@ class BaseBlock(object):
|
|
|
61
62
|
raise NotImplementedError
|
|
62
63
|
|
|
63
64
|
def transposed(self):
|
|
64
|
-
return list(
|
|
65
|
+
return list(zip(*self.data))
|
|
65
66
|
|
|
66
67
|
|
|
67
68
|
class ColumnOrientedBlock(BaseBlock):
|
|
@@ -132,6 +133,9 @@ class RowOrientedBlock(BaseBlock):
|
|
|
132
133
|
|
|
133
134
|
@property
|
|
134
135
|
def num_columns(self):
|
|
136
|
+
if self.columns_with_types is not None:
|
|
137
|
+
return len(self.columns_with_types)
|
|
138
|
+
|
|
135
139
|
return len(self.data[0]) if self.num_rows else 0
|
|
136
140
|
|
|
137
141
|
@property
|
|
@@ -148,17 +152,45 @@ class RowOrientedBlock(BaseBlock):
|
|
|
148
152
|
return [row[index] for row in self.data]
|
|
149
153
|
|
|
150
154
|
def _mutate_dicts_to_rows(self, data):
|
|
151
|
-
column_names = [x[0] for x in self.columns_with_types]
|
|
152
|
-
|
|
153
155
|
check_row_type = False
|
|
154
156
|
if self.types_check:
|
|
155
157
|
check_row_type = self._check_dict_row_type
|
|
156
158
|
|
|
159
|
+
return self._pure_mutate_dicts_to_rows(
|
|
160
|
+
data,
|
|
161
|
+
self.columns_with_types,
|
|
162
|
+
check_row_type,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
def _pure_mutate_dicts_to_rows(
|
|
166
|
+
self,
|
|
167
|
+
data,
|
|
168
|
+
columns_with_types,
|
|
169
|
+
check_row_type,
|
|
170
|
+
):
|
|
171
|
+
columns_with_cwt = []
|
|
172
|
+
for name, type_ in columns_with_types:
|
|
173
|
+
cwt = None
|
|
174
|
+
if type_.startswith('Nested'):
|
|
175
|
+
inner_spec = get_inner_spec('Nested', type_)
|
|
176
|
+
cwt = get_inner_columns_with_types(inner_spec)
|
|
177
|
+
columns_with_cwt.append((name, cwt))
|
|
178
|
+
|
|
157
179
|
for i, row in enumerate(data):
|
|
158
180
|
if check_row_type:
|
|
159
181
|
check_row_type(row)
|
|
160
182
|
|
|
161
|
-
|
|
183
|
+
new_data = []
|
|
184
|
+
for name, cwt in columns_with_cwt:
|
|
185
|
+
if cwt is None:
|
|
186
|
+
new_data.append(row[name])
|
|
187
|
+
else:
|
|
188
|
+
new_data.append(self._pure_mutate_dicts_to_rows(
|
|
189
|
+
row[name], cwt, check_row_type
|
|
190
|
+
))
|
|
191
|
+
data[i] = new_data
|
|
192
|
+
# return for recursion
|
|
193
|
+
return data
|
|
162
194
|
|
|
163
195
|
def _check_rows(self, data):
|
|
164
196
|
expected_row_len = len(self.columns_with_types)
|
|
Binary file
|
|
Binary file
|