vastdb 0.0.5.3__py3-none-any.whl → 0.0.5.5__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.
- vastdb/api.py +35 -13
- {vastdb-0.0.5.3.dist-info → vastdb-0.0.5.5.dist-info}/METADATA +1 -4
- {vastdb-0.0.5.3.dist-info → vastdb-0.0.5.5.dist-info}/RECORD +6 -30
- {vastdb-0.0.5.3.dist-info → vastdb-0.0.5.5.dist-info}/WHEEL +1 -1
- vast_protobuf/__init__.py +0 -0
- vast_protobuf/substrait/__init__.py +0 -0
- vast_protobuf/substrait/algebra_pb2.py +0 -1344
- vast_protobuf/substrait/capabilities_pb2.py +0 -46
- vast_protobuf/substrait/ddl_pb2.py +0 -57
- vast_protobuf/substrait/extended_expression_pb2.py +0 -49
- vast_protobuf/substrait/extensions/__init__.py +0 -0
- vast_protobuf/substrait/extensions/extensions_pb2.py +0 -89
- vast_protobuf/substrait/function_pb2.py +0 -168
- vast_protobuf/substrait/parameterized_types_pb2.py +0 -181
- vast_protobuf/substrait/plan_pb2.py +0 -67
- vast_protobuf/substrait/type_expressions_pb2.py +0 -198
- vast_protobuf/substrait/type_pb2.py +0 -350
- vast_protobuf/tabular/__init__.py +0 -0
- vast_protobuf/tabular/rpc_pb2.py +0 -344
- vastdb/bench_scan.py +0 -45
- vastdb/tests/__init__.py +0 -0
- vastdb/tests/conftest.py +0 -45
- vastdb/tests/test_create_table_from_parquets.py +0 -50
- vastdb/tests/test_sanity.py +0 -63
- vastdb/tests/test_schemas.py +0 -39
- vastdb/tests/test_tables.py +0 -40
- vastdb/util.py +0 -77
- vastdb/v2.py +0 -360
- {vastdb-0.0.5.3.dist-info → vastdb-0.0.5.5.dist-info}/LICENSE +0 -0
- {vastdb-0.0.5.3.dist-info → vastdb-0.0.5.5.dist-info}/top_level.txt +0 -0
vastdb/api.py
CHANGED
|
@@ -974,8 +974,17 @@ class VastdbApi:
|
|
|
974
974
|
|
|
975
975
|
return snapshots, is_truncated, marker
|
|
976
976
|
|
|
977
|
+
@staticmethod
|
|
978
|
+
def encode_table_props(**kwargs):
|
|
979
|
+
if all(v is None for v in kwargs.values()):
|
|
980
|
+
return None
|
|
981
|
+
else:
|
|
982
|
+
return "$".join([f"{k}={v}" for k, v in kwargs.items()])
|
|
977
983
|
|
|
978
|
-
def create_table(self, bucket, schema, name, arrow_schema, txid=0, client_tags=[], expected_retvals=[],
|
|
984
|
+
def create_table(self, bucket, schema, name, arrow_schema, txid=0, client_tags=[], expected_retvals=[],
|
|
985
|
+
topic_partitions=0, create_imports_table=False, use_external_row_ids_allocation=False):
|
|
986
|
+
topic_partitions=0, create_imports_table=False, use_external_row_ids_allocation=False,
|
|
987
|
+
src_timestamp=None, retention_in_mins=None, past_threshold_ts=None, future_threshold_ts=None):
|
|
979
988
|
"""
|
|
980
989
|
Create a table, use the following request
|
|
981
990
|
POST /bucket/schema/table?table HTTP/1.1
|
|
@@ -997,6 +1006,10 @@ class VastdbApi:
|
|
|
997
1006
|
headers['Content-Length'] = str(len(serialized_schema))
|
|
998
1007
|
url_params = {'topic_partitions': str(topic_partitions)} if topic_partitions else {}
|
|
999
1008
|
|
|
1009
|
+
if topic_partitions > 0:
|
|
1010
|
+
table_props = self.encode_table_props(src_timestamp=src_timestamp, retention_in_mins=retention_in_mins, past_threshold_ts=past_threshold_ts, future_threshold_ts=future_threshold_ts)
|
|
1011
|
+
url_params['table-props'] = table_props
|
|
1012
|
+
|
|
1000
1013
|
res = self.session.post(self._api_prefix(bucket=bucket, schema=schema, table=name, command="table", url_params=url_params),
|
|
1001
1014
|
data=serialized_schema, headers=headers)
|
|
1002
1015
|
return self._check_res(res, "create_table", expected_retvals)
|
|
@@ -1048,7 +1061,8 @@ class VastdbApi:
|
|
|
1048
1061
|
return self._check_res(res, "get_table_stats", expected_retvals)
|
|
1049
1062
|
|
|
1050
1063
|
def alter_table(self, bucket, schema, name, txid=0, client_tags=[], table_properties="",
|
|
1051
|
-
new_name="", expected_retvals=[]
|
|
1064
|
+
new_name="", expected_retvals=[],
|
|
1065
|
+
src_timestamp=None, retention_in_mins=None, past_threshold_ts=None, future_threshold_ts=None):
|
|
1052
1066
|
"""
|
|
1053
1067
|
PUT /mybucket/myschema/mytable?table HTTP/1.1
|
|
1054
1068
|
Content-Length: ContentLength
|
|
@@ -1060,6 +1074,9 @@ class VastdbApi:
|
|
|
1060
1074
|
"""
|
|
1061
1075
|
builder = flatbuffers.Builder(1024)
|
|
1062
1076
|
|
|
1077
|
+
if src_timestamp is not None or retention_in_mins is not None or past_threshold_ts is not None or future_threshold_ts is not None:
|
|
1078
|
+
table_properties = self.encode_table_props(src_timestamp=src_timestamp, retention_in_mins=retention_in_mins, past_threshold_ts=past_threshold_ts, future_threshold_ts=future_threshold_ts)
|
|
1079
|
+
|
|
1063
1080
|
properties = builder.CreateString(table_properties)
|
|
1064
1081
|
tabular_alter_table.Start(builder)
|
|
1065
1082
|
if len(table_properties):
|
|
@@ -1296,7 +1313,7 @@ class VastdbApi:
|
|
|
1296
1313
|
return self._check_res(res, "get_transaction", expected_retvals)
|
|
1297
1314
|
|
|
1298
1315
|
def select_row_ids(self, bucket, schema, table, params, txid=0, client_tags=[], expected_retvals=[],
|
|
1299
|
-
retry_count=0, enable_sorted_projections=
|
|
1316
|
+
retry_count=0, enable_sorted_projections=True):
|
|
1300
1317
|
"""
|
|
1301
1318
|
POST /mybucket/myschema/mytable?query-data=SelectRowIds HTTP/1.1
|
|
1302
1319
|
"""
|
|
@@ -1313,7 +1330,7 @@ class VastdbApi:
|
|
|
1313
1330
|
return self._check_res(res, "query_data", expected_retvals)
|
|
1314
1331
|
|
|
1315
1332
|
def read_columns_data(self, bucket, schema, table, params, txid=0, client_tags=[], expected_retvals=[], tenant_guid=None,
|
|
1316
|
-
retry_count=0, enable_sorted_projections=
|
|
1333
|
+
retry_count=0, enable_sorted_projections=True):
|
|
1317
1334
|
"""
|
|
1318
1335
|
POST /mybucket/myschema/mytable?query-data=ReadColumns HTTP/1.1
|
|
1319
1336
|
"""
|
|
@@ -1329,7 +1346,7 @@ class VastdbApi:
|
|
|
1329
1346
|
return self._check_res(res, "query_data", expected_retvals)
|
|
1330
1347
|
|
|
1331
1348
|
def count_rows(self, bucket, schema, table, params, txid=0, client_tags=[], expected_retvals=[], tenant_guid=None,
|
|
1332
|
-
retry_count=0, enable_sorted_projections=
|
|
1349
|
+
retry_count=0, enable_sorted_projections=True):
|
|
1333
1350
|
"""
|
|
1334
1351
|
POST /mybucket/myschema/mytable?query-data=CountRows HTTP/1.1
|
|
1335
1352
|
"""
|
|
@@ -1485,10 +1502,11 @@ class VastdbApi:
|
|
|
1485
1502
|
return False
|
|
1486
1503
|
|
|
1487
1504
|
def _query_page(self, bucket, schema, table, query_data_request, split=(0, 1, 8), num_sub_splits=1, response_row_id=False,
|
|
1488
|
-
txid=0, limit_rows=0, sub_split_start_row_ids=[], filters=None, field_names=None):
|
|
1505
|
+
txid=0, limit_rows=0, sub_split_start_row_ids=[], filters=None, field_names=None, enable_sorted_projections=True):
|
|
1489
1506
|
res = self.query_data(bucket=bucket, schema=schema, table=table, params=query_data_request.serialized, split=split,
|
|
1490
1507
|
num_sub_splits=num_sub_splits, response_row_id=response_row_id, txid=txid,
|
|
1491
|
-
limit_rows=limit_rows, sub_split_start_row_ids=sub_split_start_row_ids
|
|
1508
|
+
limit_rows=limit_rows, sub_split_start_row_ids=sub_split_start_row_ids,
|
|
1509
|
+
enable_sorted_projections=enable_sorted_projections)
|
|
1492
1510
|
start_row_ids = {}
|
|
1493
1511
|
sub_split_tables = parse_query_data_response(res.raw, query_data_request.response_schema,
|
|
1494
1512
|
start_row_ids=start_row_ids)
|
|
@@ -1499,10 +1517,11 @@ class VastdbApi:
|
|
|
1499
1517
|
return table_page, start_row_ids
|
|
1500
1518
|
|
|
1501
1519
|
def _query_page_iterator(self, bucket, schema, table, query_data_request, split=(0, 1, 8), num_sub_splits=1, response_row_id=False,
|
|
1502
|
-
txid=0, limit_rows=0, start_row_ids={}, filters=None, field_names=None):
|
|
1520
|
+
txid=0, limit_rows=0, start_row_ids={}, filters=None, field_names=None, enable_sorted_projections=True):
|
|
1503
1521
|
res = self.query_data(bucket=bucket, schema=schema, table=table, params=query_data_request.serialized, split=split,
|
|
1504
1522
|
num_sub_splits=num_sub_splits, response_row_id=response_row_id, txid=txid,
|
|
1505
|
-
limit_rows=limit_rows, sub_split_start_row_ids=start_row_ids.items()
|
|
1523
|
+
limit_rows=limit_rows, sub_split_start_row_ids=start_row_ids.items(),
|
|
1524
|
+
enable_sorted_projections=enable_sorted_projections)
|
|
1506
1525
|
for sub_split_table in parse_query_data_response(res.raw, query_data_request.response_schema,
|
|
1507
1526
|
start_row_ids=start_row_ids):
|
|
1508
1527
|
for record_batch in sub_split_table.to_batches():
|
|
@@ -1510,7 +1529,8 @@ class VastdbApi:
|
|
|
1510
1529
|
_logger.info(f"query_page_iterator: start_row_ids={start_row_ids}")
|
|
1511
1530
|
|
|
1512
1531
|
def query_iterator(self, bucket, schema, table, num_sub_splits=1, num_row_groups_per_sub_split=8,
|
|
1513
|
-
response_row_id=False, txid=0, limit_per_sub_split=128*1024, filters=None, field_names=None
|
|
1532
|
+
response_row_id=False, txid=0, limit_per_sub_split=128*1024, filters=None, field_names=None,
|
|
1533
|
+
enable_sorted_projections=True):
|
|
1514
1534
|
"""
|
|
1515
1535
|
query rows into a table.
|
|
1516
1536
|
|
|
@@ -1588,7 +1608,8 @@ class VastdbApi:
|
|
|
1588
1608
|
split=(split_id, num_splits, num_row_groups_per_sub_split),
|
|
1589
1609
|
num_sub_splits=num_sub_splits, response_row_id=response_row_id,
|
|
1590
1610
|
txid=txid, limit_rows=limit_per_sub_split,
|
|
1591
|
-
start_row_ids=start_row_ids
|
|
1611
|
+
start_row_ids=start_row_ids,
|
|
1612
|
+
enable_sorted_projections=enable_sorted_projections):
|
|
1592
1613
|
output_queue.put((split_id, record_batch))
|
|
1593
1614
|
while not next_sems[split_id].acquire(timeout=1): # wait for the main thread to request the next record batch
|
|
1594
1615
|
if killall:
|
|
@@ -1682,7 +1703,7 @@ class VastdbApi:
|
|
|
1682
1703
|
|
|
1683
1704
|
def query(self, bucket, schema, table, num_sub_splits=1, num_row_groups_per_sub_split=8,
|
|
1684
1705
|
response_row_id=False, txid=0, limit=0, limit_per_sub_split=131072, filters=None, field_names=None,
|
|
1685
|
-
queried_columns=None):
|
|
1706
|
+
queried_columns=None, enable_sorted_projections=True):
|
|
1686
1707
|
"""
|
|
1687
1708
|
query rows into a table.
|
|
1688
1709
|
|
|
@@ -1769,7 +1790,8 @@ class VastdbApi:
|
|
|
1769
1790
|
split=(split_id, num_splits, num_row_groups_per_sub_split),
|
|
1770
1791
|
num_sub_splits=num_sub_splits, response_row_id=response_row_id,
|
|
1771
1792
|
txid=txid, limit_rows=limit_rows,
|
|
1772
|
-
sub_split_start_row_ids=start_row_ids.items()
|
|
1793
|
+
sub_split_start_row_ids=start_row_ids.items(),
|
|
1794
|
+
enable_sorted_projections=enable_sorted_projections)
|
|
1773
1795
|
with lock:
|
|
1774
1796
|
table_pages.append(table_page)
|
|
1775
1797
|
row_counts[split_id] += len(table_page)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vastdb
|
|
3
|
-
Version: 0.0.5.
|
|
3
|
+
Version: 0.0.5.5
|
|
4
4
|
Summary: VAST Data SDK
|
|
5
5
|
Home-page: https://github.com/vast-data/vastdb_sdk
|
|
6
6
|
Author: VAST DATA
|
|
7
7
|
Author-email: hello@vastdata.com
|
|
8
8
|
License: Copyright (C) VAST Data Ltd.
|
|
9
|
-
Platform: UNKNOWN
|
|
10
9
|
Description-Content-Type: text/markdown
|
|
11
10
|
License-File: LICENSE
|
|
12
11
|
Requires-Dist: flatbuffers
|
|
@@ -43,5 +42,3 @@ vastdb_session = create_vastdb_session(access_key, secret_key)
|
|
|
43
42
|
```
|
|
44
43
|
#### For the complete Guide for the SDK please go to VastData github: https://github.com/vast-data/vastdb_sdk
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
@@ -147,34 +147,10 @@ vast_flatbuf/tabular/ListTablesResponse.py,sha256=V7jZAS8ryKY8s6o_QyjWzgan-rsGm1
|
|
|
147
147
|
vast_flatbuf/tabular/ObjectDetails.py,sha256=qW0WtbkCYYE_L-Kw6VNRDCLYaRm5lKvTbLNkfD4zV4A,3589
|
|
148
148
|
vast_flatbuf/tabular/S3File.py,sha256=KC9c2oS5-JXwTTriUVFdjOvRG0B54Cq9kviSDZY3NI0,4450
|
|
149
149
|
vast_flatbuf/tabular/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
150
|
-
vast_protobuf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
151
|
-
vast_protobuf/substrait/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
152
|
-
vast_protobuf/substrait/algebra_pb2.py,sha256=Y0RBz_IszyfCTgyNA5fh-tJPq6IJs3QqhYZoyFOy2Wg,100838
|
|
153
|
-
vast_protobuf/substrait/capabilities_pb2.py,sha256=NDfdXUrGPNGfB11h3QI1OrYtZypfAlu9lE17BAVimMQ,2453
|
|
154
|
-
vast_protobuf/substrait/ddl_pb2.py,sha256=2MDXdDznqoD6vtMSWwvkxpiZ-yPBnSXchc8jDQyoKZw,2683
|
|
155
|
-
vast_protobuf/substrait/extended_expression_pb2.py,sha256=Rs8A8HmNcEevxO3jVsNlIeYqyXCaIwGb2xTK8p7_eFU,3481
|
|
156
|
-
vast_protobuf/substrait/function_pb2.py,sha256=dtVctHDJC-BsofPY0ktPYLJkAWxLAKVMsOhGER36hoo,13339
|
|
157
|
-
vast_protobuf/substrait/parameterized_types_pb2.py,sha256=hCTBDXbqunSuSmrxnkvFDNUjCxr8UPE8XrghpX2mqsM,15074
|
|
158
|
-
vast_protobuf/substrait/plan_pb2.py,sha256=LDQFI5QE-KpVItmqzG9k-9XuiAT-eaXuOTMUaMoeODQ,3831
|
|
159
|
-
vast_protobuf/substrait/type_expressions_pb2.py,sha256=hpvSwkZjmpEfh0q6pGeCt_5ARzyOoX2HVXYXNShSh3s,17633
|
|
160
|
-
vast_protobuf/substrait/type_pb2.py,sha256=w-FzIb2OJNpaOCp1f1ox_CVDevB1ID5wudju8e1NkBY,20790
|
|
161
|
-
vast_protobuf/substrait/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
162
|
-
vast_protobuf/substrait/extensions/extensions_pb2.py,sha256=I_6c6nMmMaYvVtzF-5ycqpzFYlsAVlKQDyatoU8RewQ,6110
|
|
163
|
-
vast_protobuf/tabular/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
164
|
-
vast_protobuf/tabular/rpc_pb2.py,sha256=7kW2WrA2sGk6WVbD83mc_cKkZ2MxoImSO5GOVz6NbbE,23776
|
|
165
150
|
vastdb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
166
|
-
vastdb/api.py,sha256=
|
|
167
|
-
vastdb/
|
|
168
|
-
vastdb/
|
|
169
|
-
vastdb/
|
|
170
|
-
vastdb/
|
|
171
|
-
vastdb
|
|
172
|
-
vastdb/tests/test_create_table_from_parquets.py,sha256=dxykmvUR-vui6Z3qUvXPYJ9Nw6V_qcxKl4NDNQK4kiY,1963
|
|
173
|
-
vastdb/tests/test_sanity.py,sha256=7HmCjuOmtoYnuWiPjMP6m7sYQYop1_qRCzq2ZX0rKlc,2404
|
|
174
|
-
vastdb/tests/test_schemas.py,sha256=-nntn3ltBaaqSTsUvi-i9J0yr4TYvOTRyTNY039vEIk,1047
|
|
175
|
-
vastdb/tests/test_tables.py,sha256=KPe0ESVGWixecTSwQ8whzSF-NZrNVZ-Kv-C4Gz-OQnQ,1225
|
|
176
|
-
vastdb-0.0.5.3.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
|
|
177
|
-
vastdb-0.0.5.3.dist-info/METADATA,sha256=Yd93AoZE5ZUhJUr0MhtfhcMaQUtSFZ1wbzc6vvEvclQ,1369
|
|
178
|
-
vastdb-0.0.5.3.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
|
|
179
|
-
vastdb-0.0.5.3.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
|
|
180
|
-
vastdb-0.0.5.3.dist-info/RECORD,,
|
|
151
|
+
vastdb/api.py,sha256=xAucqj_W_gGIsZdvwSg6nsSXqQOUMOuZL2xhMaFkIbI,126708
|
|
152
|
+
vastdb-0.0.5.5.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
|
|
153
|
+
vastdb-0.0.5.5.dist-info/METADATA,sha256=hx58H4GZBF8jphMOOkxMVlBAVwuRdLSeBRSemdZcQEc,1349
|
|
154
|
+
vastdb-0.0.5.5.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
155
|
+
vastdb-0.0.5.5.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
|
|
156
|
+
vastdb-0.0.5.5.dist-info/RECORD,,
|
vast_protobuf/__init__.py
DELETED
|
File without changes
|
|
File without changes
|