e6data-python-connector 2.0.1__py3-none-any.whl → 2.0.3__py3-none-any.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.
- e6data_python_connector/datainputstream.py +17 -11
- e6data_python_connector/e6data_grpc.py +1 -0
- {e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/METADATA +2 -2
- {e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/RECORD +8 -8
- {e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/LICENSE +0 -0
- {e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/WHEEL +0 -0
- {e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/entry_points.txt +0 -0
- {e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/top_level.txt +0 -0
|
@@ -8,7 +8,7 @@ from thrift.transport import TTransport
|
|
|
8
8
|
|
|
9
9
|
from e6data_python_connector.e6x_vector.ttypes import Chunk, Vector, VectorType
|
|
10
10
|
from e6data_python_connector.constants import ZONE
|
|
11
|
-
from e6data_python_connector.date_time_utils import floor_div, floor_mod
|
|
11
|
+
from e6data_python_connector.date_time_utils import floor_div, floor_mod, get_zone
|
|
12
12
|
|
|
13
13
|
try:
|
|
14
14
|
from thrift.protocol import fastbinary
|
|
@@ -24,6 +24,10 @@ except ImportError:
|
|
|
24
24
|
_logger = logging.getLogger(__name__)
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
def get_null(vector: Vector, index: int):
|
|
28
|
+
return vector.nullSet[0] if vector.isConstantVector else vector.nullSet[index]
|
|
29
|
+
|
|
30
|
+
|
|
27
31
|
class DataInputStream:
|
|
28
32
|
def __init__(self, stream):
|
|
29
33
|
self.stream = stream
|
|
@@ -203,14 +207,14 @@ def get_column_from_chunk(vector: Vector) -> list:
|
|
|
203
207
|
try:
|
|
204
208
|
if d_type == VectorType.LONG:
|
|
205
209
|
for row in range(vector.size):
|
|
206
|
-
if vector
|
|
210
|
+
if get_null(vector, row):
|
|
207
211
|
value_array.append(None)
|
|
208
212
|
continue
|
|
209
213
|
value_array.append(vector.data.int64Data.data[
|
|
210
214
|
row] if not vector.isConstantVector else vector.data.numericConstantData.data)
|
|
211
215
|
elif d_type == VectorType.DATE:
|
|
212
216
|
for row in range(vector.size):
|
|
213
|
-
if vector
|
|
217
|
+
if get_null(vector, row):
|
|
214
218
|
value_array.append(None)
|
|
215
219
|
continue
|
|
216
220
|
epoch_seconds = floor_div(vector.data.dateData.data[
|
|
@@ -221,54 +225,56 @@ def get_column_from_chunk(vector: Vector) -> list:
|
|
|
221
225
|
value_array.append(date.strftime("%Y-%m-%d"))
|
|
222
226
|
elif d_type == VectorType.DATETIME:
|
|
223
227
|
for row in range(vector.size):
|
|
224
|
-
if vector
|
|
228
|
+
if get_null(vector, row):
|
|
225
229
|
value_array.append(None)
|
|
226
230
|
continue
|
|
227
231
|
epoch_micros = vector.data.timeData.data[
|
|
228
232
|
row] if not vector.isConstantVector else vector.data.timeConstantData.data
|
|
229
233
|
epoch_seconds = floor_div(epoch_micros, 1000_000)
|
|
230
234
|
micros_of_the_day = floor_mod(epoch_micros, 1000_000)
|
|
231
|
-
|
|
235
|
+
zone_offset = pytz.timezone('UTC') if vector.zoneOffset == 'Z' else pytz.timezone(
|
|
236
|
+
get_zone(vector.zoneOffset))
|
|
237
|
+
date_time = datetime.fromtimestamp(epoch_seconds, zone_offset)
|
|
232
238
|
date_time = date_time + timedelta(microseconds=micros_of_the_day)
|
|
233
239
|
value_array.append(date_time.strftime("%Y-%m-%d %H:%M:%S"))
|
|
234
240
|
elif d_type == VectorType.STRING or d_type == VectorType.ARRAY or d_type == VectorType.MAP or d_type == VectorType.STRUCT:
|
|
235
241
|
for row in range(vector.size):
|
|
236
|
-
if vector
|
|
242
|
+
if get_null(vector, row):
|
|
237
243
|
value_array.append(None)
|
|
238
244
|
continue
|
|
239
245
|
value_array.append(vector.data.varcharData.data[
|
|
240
246
|
row] if not vector.isConstantVector else vector.data.varcharConstantData.data)
|
|
241
247
|
elif d_type == VectorType.DOUBLE:
|
|
242
248
|
for row in range(vector.size):
|
|
243
|
-
if vector
|
|
249
|
+
if get_null(vector, row):
|
|
244
250
|
value_array.append(None)
|
|
245
251
|
continue
|
|
246
252
|
value_array.append(vector.data.float64Data.data[
|
|
247
253
|
row] if not vector.isConstantVector else vector.data.numericDecimalConstantData.data)
|
|
248
254
|
elif d_type == VectorType.BINARY:
|
|
249
255
|
for row in range(vector.size):
|
|
250
|
-
if vector
|
|
256
|
+
if get_null(vector, row):
|
|
251
257
|
value_array.append(None)
|
|
252
258
|
continue
|
|
253
259
|
value_array.append(vector.data.varcharData.data[
|
|
254
260
|
row] if not vector.isConstantVector else vector.data.varcharConstantData.data)
|
|
255
261
|
elif d_type == VectorType.FLOAT:
|
|
256
262
|
for row in range(vector.size):
|
|
257
|
-
if vector
|
|
263
|
+
if get_null(vector, row):
|
|
258
264
|
value_array.append(None)
|
|
259
265
|
continue
|
|
260
266
|
value_array.append(vector.data.float32Data.data[
|
|
261
267
|
row] if not vector.isConstantVector else vector.data.numericDecimalConstantData.data)
|
|
262
268
|
elif d_type == VectorType.BOOLEAN:
|
|
263
269
|
for row in range(vector.size):
|
|
264
|
-
if vector
|
|
270
|
+
if get_null(vector, row):
|
|
265
271
|
value_array.append(None)
|
|
266
272
|
continue
|
|
267
273
|
value_array.append(vector.data.boolData.data[
|
|
268
274
|
row] if not vector.isConstantVector else vector.data.boolConstantData.data)
|
|
269
275
|
elif d_type == VectorType.INTEGER:
|
|
270
276
|
for row in range(vector.size):
|
|
271
|
-
if vector
|
|
277
|
+
if get_null(vector, row):
|
|
272
278
|
value_array.append(None)
|
|
273
279
|
continue
|
|
274
280
|
value_array.append(vector.data.int32Data.data[
|
{e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: e6data-python-connector
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: Client for the e6data distributed SQL Engine.
|
|
5
5
|
Home-page: https://github.com/e6x-labs/e6data-python-connector
|
|
6
6
|
Author: Uniphi, Inc.
|
|
@@ -27,7 +27,7 @@ Requires-Dist: sqlalchemy
|
|
|
27
27
|
|
|
28
28
|
# e6data Python Connector
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
32
|
## Introduction
|
|
33
33
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
e6data_python_connector/__init__.py,sha256=x_VwhPQ7XLlthR-NJL9Vl7lkLBRCG2pSjmyZSBHOBpM,103
|
|
2
2
|
e6data_python_connector/common.py,sha256=nk0CDQ5j1iu8DctBOXX4QypPYmxSgIgoA-Cn1UZXLic,9976
|
|
3
3
|
e6data_python_connector/constants.py,sha256=h5w0lWiFsxz__zUZRlo1f72-8mT_vt9gcWvtWh0viFI,682
|
|
4
|
-
e6data_python_connector/datainputstream.py,sha256=
|
|
4
|
+
e6data_python_connector/datainputstream.py,sha256=P0DOwzhcn18tpIfKayQCa_gylDK7htaLNcoMW5cZfgY,11552
|
|
5
5
|
e6data_python_connector/date_time_utils.py,sha256=ew1CjhfB93trRdu8jBOy2ihZNSecDPcmxS1USmWxqzE,13623
|
|
6
6
|
e6data_python_connector/dialect.py,sha256=-FFQ4mjSviqfcnDC0Ju0c1p3i4XqFLmekPd-CSZ_g0Q,10938
|
|
7
|
-
e6data_python_connector/e6data_grpc.py,sha256
|
|
7
|
+
e6data_python_connector/e6data_grpc.py,sha256=-wPh3JVBetVPeTWTED7TMge2TbGNotgP0l5kaDqyuuY,20848
|
|
8
8
|
e6data_python_connector/exceptions.py,sha256=vrUqdzMq3LjbCmvr5_TcRq9eKmdqGfe-uVjR0BJQf5U,382
|
|
9
9
|
e6data_python_connector/typeId.py,sha256=2EMNWK2SO5CBReNuJphma6xp-69r9GDwwys66t-kSk0,1777
|
|
10
10
|
e6data_python_connector/e6x_vector/__init__.py,sha256=YFcZTT8Cm-6Y4oTiCaqq0DT1lw2W09WqoEc5_pTAwW0,34
|
|
@@ -17,9 +17,9 @@ e6data_python_connector/server/e6x_engine_pb2.py,sha256=2aShk-jX1UQxFzMVx58gXf9N
|
|
|
17
17
|
e6data_python_connector/server/e6x_engine_pb2.pyi,sha256=z5olI2I4xHNivRULRmsEXvuEpmxX2vlnUMk8YarmMY8,17824
|
|
18
18
|
e6data_python_connector/server/e6x_engine_pb2_grpc.py,sha256=pezNVTO8oSCDcVr0fYi-zlr2X71Q6nDNeMooVNHMITo,45052
|
|
19
19
|
e6data_python_connector/server/ttypes.py,sha256=uWxwSp4m6e-7SeSEckbZtSduGYmfzXWM09iy5eltBPA,21227
|
|
20
|
-
e6data_python_connector-2.0.
|
|
21
|
-
e6data_python_connector-2.0.
|
|
22
|
-
e6data_python_connector-2.0.
|
|
23
|
-
e6data_python_connector-2.0.
|
|
24
|
-
e6data_python_connector-2.0.
|
|
25
|
-
e6data_python_connector-2.0.
|
|
20
|
+
e6data_python_connector-2.0.3.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
21
|
+
e6data_python_connector-2.0.3.dist-info/METADATA,sha256=a6lGKRebwIxPeWppYdCF-djboximM8EBH3OuBvY5O4g,6976
|
|
22
|
+
e6data_python_connector-2.0.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
23
|
+
e6data_python_connector-2.0.3.dist-info/entry_points.txt,sha256=MDK4cAOND0preLvq2Tlpnz00wXnP_Y_UopqJsAf3U7Y,77
|
|
24
|
+
e6data_python_connector-2.0.3.dist-info/top_level.txt,sha256=ChOS6qLf-SQycXr0uBiVxomIfYfbH2SgwrOWhW79ab0,24
|
|
25
|
+
e6data_python_connector-2.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{e6data_python_connector-2.0.1.dist-info → e6data_python_connector-2.0.3.dist-info}/top_level.txt
RENAMED
|
File without changes
|