vastdb 0.0.5.2__py3-none-any.whl → 0.0.5.4__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 CHANGED
@@ -757,6 +757,7 @@ class VastdbApi:
757
757
  if not port:
758
758
  port = 443 if secure else 80
759
759
 
760
+ self.default_max_list_columns_page_size = 1000
760
761
  self.session = requests.Session()
761
762
  self.session.verify = False
762
763
  self.session.headers['user-agent'] = "VastData Tabular API 1.0 - 2022 (c)"
@@ -1207,7 +1208,7 @@ class VastdbApi:
1207
1208
  data=serialized_schema, headers=headers)
1208
1209
  return self._check_res(res, "drop_columns", expected_retvals)
1209
1210
 
1210
- def list_columns(self, bucket, schema, table, *, txid=0, client_tags=None, max_keys=1000, next_key=0,
1211
+ def list_columns(self, bucket, schema, table, *, txid=0, client_tags=None, max_keys=None, next_key=0,
1211
1212
  count_only=False, name_prefix="", exact_match=False,
1212
1213
  expected_retvals=None, bc_list_internals=False):
1213
1214
  """
@@ -1218,6 +1219,7 @@ class VastdbApi:
1218
1219
  tabular-max-keys: 1000
1219
1220
  tabular-next-key: NextColumnId
1220
1221
  """
1222
+ max_keys = max_keys or self.default_max_list_columns_page_size
1221
1223
  client_tags = client_tags or []
1222
1224
  expected_retvals = expected_retvals or []
1223
1225
 
@@ -1294,7 +1296,7 @@ class VastdbApi:
1294
1296
  return self._check_res(res, "get_transaction", expected_retvals)
1295
1297
 
1296
1298
  def select_row_ids(self, bucket, schema, table, params, txid=0, client_tags=[], expected_retvals=[],
1297
- retry_count=0, enable_sorted_projections=False):
1299
+ retry_count=0, enable_sorted_projections=True):
1298
1300
  """
1299
1301
  POST /mybucket/myschema/mytable?query-data=SelectRowIds HTTP/1.1
1300
1302
  """
@@ -1311,7 +1313,7 @@ class VastdbApi:
1311
1313
  return self._check_res(res, "query_data", expected_retvals)
1312
1314
 
1313
1315
  def read_columns_data(self, bucket, schema, table, params, txid=0, client_tags=[], expected_retvals=[], tenant_guid=None,
1314
- retry_count=0, enable_sorted_projections=False):
1316
+ retry_count=0, enable_sorted_projections=True):
1315
1317
  """
1316
1318
  POST /mybucket/myschema/mytable?query-data=ReadColumns HTTP/1.1
1317
1319
  """
@@ -1327,7 +1329,7 @@ class VastdbApi:
1327
1329
  return self._check_res(res, "query_data", expected_retvals)
1328
1330
 
1329
1331
  def count_rows(self, bucket, schema, table, params, txid=0, client_tags=[], expected_retvals=[], tenant_guid=None,
1330
- retry_count=0, enable_sorted_projections=False):
1332
+ retry_count=0, enable_sorted_projections=True):
1331
1333
  """
1332
1334
  POST /mybucket/myschema/mytable?query-data=CountRows HTTP/1.1
1333
1335
  """
@@ -1483,10 +1485,11 @@ class VastdbApi:
1483
1485
  return False
1484
1486
 
1485
1487
  def _query_page(self, bucket, schema, table, query_data_request, split=(0, 1, 8), num_sub_splits=1, response_row_id=False,
1486
- txid=0, limit_rows=0, sub_split_start_row_ids=[], filters=None, field_names=None):
1488
+ txid=0, limit_rows=0, sub_split_start_row_ids=[], filters=None, field_names=None, enable_sorted_projections=True):
1487
1489
  res = self.query_data(bucket=bucket, schema=schema, table=table, params=query_data_request.serialized, split=split,
1488
1490
  num_sub_splits=num_sub_splits, response_row_id=response_row_id, txid=txid,
1489
- limit_rows=limit_rows, sub_split_start_row_ids=sub_split_start_row_ids)
1491
+ limit_rows=limit_rows, sub_split_start_row_ids=sub_split_start_row_ids,
1492
+ enable_sorted_projections=enable_sorted_projections)
1490
1493
  start_row_ids = {}
1491
1494
  sub_split_tables = parse_query_data_response(res.raw, query_data_request.response_schema,
1492
1495
  start_row_ids=start_row_ids)
@@ -1497,10 +1500,11 @@ class VastdbApi:
1497
1500
  return table_page, start_row_ids
1498
1501
 
1499
1502
  def _query_page_iterator(self, bucket, schema, table, query_data_request, split=(0, 1, 8), num_sub_splits=1, response_row_id=False,
1500
- txid=0, limit_rows=0, start_row_ids={}, filters=None, field_names=None):
1503
+ txid=0, limit_rows=0, start_row_ids={}, filters=None, field_names=None, enable_sorted_projections=True):
1501
1504
  res = self.query_data(bucket=bucket, schema=schema, table=table, params=query_data_request.serialized, split=split,
1502
1505
  num_sub_splits=num_sub_splits, response_row_id=response_row_id, txid=txid,
1503
- limit_rows=limit_rows, sub_split_start_row_ids=start_row_ids.items())
1506
+ limit_rows=limit_rows, sub_split_start_row_ids=start_row_ids.items(),
1507
+ enable_sorted_projections=enable_sorted_projections)
1504
1508
  for sub_split_table in parse_query_data_response(res.raw, query_data_request.response_schema,
1505
1509
  start_row_ids=start_row_ids):
1506
1510
  for record_batch in sub_split_table.to_batches():
@@ -1508,7 +1512,8 @@ class VastdbApi:
1508
1512
  _logger.info(f"query_page_iterator: start_row_ids={start_row_ids}")
1509
1513
 
1510
1514
  def query_iterator(self, bucket, schema, table, num_sub_splits=1, num_row_groups_per_sub_split=8,
1511
- response_row_id=False, txid=0, limit_per_sub_split=128*1024, filters=None, field_names=None):
1515
+ response_row_id=False, txid=0, limit_per_sub_split=128*1024, filters=None, field_names=None,
1516
+ enable_sorted_projections=True):
1512
1517
  """
1513
1518
  query rows into a table.
1514
1519
 
@@ -1586,7 +1591,8 @@ class VastdbApi:
1586
1591
  split=(split_id, num_splits, num_row_groups_per_sub_split),
1587
1592
  num_sub_splits=num_sub_splits, response_row_id=response_row_id,
1588
1593
  txid=txid, limit_rows=limit_per_sub_split,
1589
- start_row_ids=start_row_ids):
1594
+ start_row_ids=start_row_ids,
1595
+ enable_sorted_projections=enable_sorted_projections):
1590
1596
  output_queue.put((split_id, record_batch))
1591
1597
  while not next_sems[split_id].acquire(timeout=1): # wait for the main thread to request the next record batch
1592
1598
  if killall:
@@ -1680,7 +1686,7 @@ class VastdbApi:
1680
1686
 
1681
1687
  def query(self, bucket, schema, table, num_sub_splits=1, num_row_groups_per_sub_split=8,
1682
1688
  response_row_id=False, txid=0, limit=0, limit_per_sub_split=131072, filters=None, field_names=None,
1683
- queried_columns=None):
1689
+ queried_columns=None, enable_sorted_projections=True):
1684
1690
  """
1685
1691
  query rows into a table.
1686
1692
 
@@ -1767,7 +1773,8 @@ class VastdbApi:
1767
1773
  split=(split_id, num_splits, num_row_groups_per_sub_split),
1768
1774
  num_sub_splits=num_sub_splits, response_row_id=response_row_id,
1769
1775
  txid=txid, limit_rows=limit_rows,
1770
- sub_split_start_row_ids=start_row_ids.items())
1776
+ sub_split_start_row_ids=start_row_ids.items(),
1777
+ enable_sorted_projections=enable_sorted_projections)
1771
1778
  with lock:
1772
1779
  table_pages.append(table_page)
1773
1780
  row_counts[split_id] += len(table_page)
@@ -2007,7 +2014,7 @@ class VastdbApi:
2007
2014
  txid, created_txid = self._begin_tx_if_necessary(txid)
2008
2015
 
2009
2016
  if rows:
2010
- columns = self._list_table_columns(bucket, schema, table, field_names=rows.keys())
2017
+ columns = self._list_table_columns(bucket, schema, table, field_names=rows.keys(), txid=txid)
2011
2018
  columns_dict = dict([(column[0], column[1]) for column in columns])
2012
2019
  arrow_schema = pa.schema([])
2013
2020
  arrays = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vastdb
3
- Version: 0.0.5.2
3
+ Version: 0.0.5.4
4
4
  Summary: VAST Data SDK
5
5
  Home-page: https://github.com/vast-data/vastdb_sdk
6
6
  Author: VAST DATA
@@ -147,26 +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=ZfkwDyTqaQ_j1wmp2iog9Yj3LW98S8IzLxs7gExiPG8,124746
167
- vastdb/v2.py,sha256=0fLulaIQGlIbVNBBFGd6iwYPuGhaaJIHTiJORyio_YQ,2438
168
- vastdb-0.0.5.2.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
169
- vastdb-0.0.5.2.dist-info/METADATA,sha256=t6yxMkCPHuy7GJU6lSmd6QjrCsGmcPvzJE0qihLjMQQ,1369
170
- vastdb-0.0.5.2.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
171
- vastdb-0.0.5.2.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
172
- vastdb-0.0.5.2.dist-info/RECORD,,
151
+ vastdb/api.py,sha256=lYM-CM42YBZ0IbR4AkqBFBaFETFORFREWgPab18WJr4,125448
152
+ vastdb-0.0.5.4.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
153
+ vastdb-0.0.5.4.dist-info/METADATA,sha256=lQ6-XEIX6yPL9DygrrildnMkU1v7EcL0DXjfYFWxEfY,1369
154
+ vastdb-0.0.5.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
155
+ vastdb-0.0.5.4.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
156
+ vastdb-0.0.5.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
vast_protobuf/__init__.py DELETED
File without changes
File without changes