vastdb 1.3.1__py3-none-any.whl → 1.3.2__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/schema.py CHANGED
@@ -77,7 +77,11 @@ class Schema:
77
77
  return result
78
78
 
79
79
  def create_table(self, table_name: str, columns: pa.Schema, fail_if_exists=True, use_external_row_ids_allocation=False) -> "Table":
80
- """Create a new table under this schema."""
80
+ """Create a new table under this schema.
81
+
82
+ A virtual `vastdb_rowid` column (of `int64` type) can be created to access and filter by internal VAST row IDs.
83
+ See https://support.vastdata.com/s/article/UUID-48d0a8cf-5786-5ef3-3fa3-9c64e63a0967 for more details.
84
+ """
81
85
  if current := self.table(table_name, fail_if_missing=False):
82
86
  if fail_if_exists:
83
87
  raise errors.TableExists(self.bucket.name, self.name, table_name)
@@ -72,20 +72,31 @@ def test_ndu_while_querying(session, test_bucket_name, schema_name, table_name):
72
72
  """
73
73
  Executing queries while a NDU takes place.
74
74
  """
75
- # TODO: Before merging run mypy and print query result
76
-
75
+ amount_of_queries_in_parallel = 5
77
76
  config = QueryConfig(num_splits=1, num_sub_splits=1)
78
-
79
77
  logger.info(f'{test_bucket_name=}, {schema_name=}, {table_name=}')
80
78
 
81
- for query in range(300):
79
+ seed = random.randint(0, 100)
80
+ logger.info(f'{seed=}')
81
+ r = random.Random(seed)
82
+
83
+ def _execute_single_query(expected=None):
84
+ time.sleep(r.random())
82
85
  with session.transaction() as tx:
83
86
  t = tx.bucket(test_bucket_name).schema(schema_name).table(table_name)
84
87
  s = time.time()
85
- if query == 0:
86
- res = t.select(config=config).read_all()
87
- logger.info(f'{res=}')
88
- else:
89
- assert res == t.select(config=config).read_all()
88
+ res = t.select(config=config).read_all()
90
89
  e = time.time()
91
- logger.info(f'{query=} took {e - s}')
90
+ if expected:
91
+ assert expected == res
92
+ logger.info(f'query took {e - s}')
93
+ return res
94
+
95
+ initial_res = _execute_single_query()
96
+ for i in range(300):
97
+ with ThreadPoolExecutor() as executor:
98
+ futures = [executor.submit(_execute_single_query, initial_res) for _ in range(amount_of_queries_in_parallel)]
99
+ for future in futures:
100
+ future.result()
101
+
102
+ logger.info(f"finished running {amount_of_queries_in_parallel} queries, loop {i}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vastdb
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: VAST Data SDK
5
5
  Home-page: https://github.com/vast-data/vastdb_sdk
6
6
  Author: VAST DATA
@@ -155,7 +155,7 @@ vastdb/config.py,sha256=1tMYtzKXerGcIUjH4tIGEvZNWvO4fviCEdcNCnELJZo,2269
155
155
  vastdb/conftest.py,sha256=X2kVveySPQYZlVBXUMoo7Oea5IsvmJzjdqq3fpH2kVw,3469
156
156
  vastdb/errors.py,sha256=2XR1ko7J5nkfiHSAgwuVAADw0SsyqxOwSeFaGgKZEXM,4186
157
157
  vastdb/features.py,sha256=DxV746LSkORwVSD6MP2hdXRfnyoLkJwtOwGmp1dnquo,1322
158
- vastdb/schema.py,sha256=IaZDJsx0ms_dJVXeyCcSD8Dt3TNJkqR3739XOnDBM_E,6177
158
+ vastdb/schema.py,sha256=EzTj0dIjLI23A2SAI1rYdhB6YqHdWSE4BBSqiKFbDtw,6418
159
159
  vastdb/session.py,sha256=toMR0BXwTaECdWDKnIZky1F3MA1SmelRBiqCrqQ3GCM,2067
160
160
  vastdb/table.py,sha256=C6Zz0zolRRRbf5EQBvDRAofl3kGvfz4PjZwGeQongTI,31106
161
161
  vastdb/transaction.py,sha256=NlVkEowJ_pmtffjWBBDaKExYDKPekjSZyj_fK_bZPJE,3026
@@ -201,9 +201,9 @@ vastdb/tests/test_util.py,sha256=n7gvT5Wg6b6bxgqkFXkYqvFd_W1GlUdVfmPv66XYXyA,195
201
201
  vastdb/tests/util.py,sha256=dpRJYbboDnlqL4qIdvScpp8--5fxRUBIcIYitrfcj9o,555
202
202
  vastdb/vast_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
203
203
  vastdb/vast_tests/test_ha.py,sha256=744P4G6VJ09RIkHhMQL4wlipCBJWQVMhyvUrSc4k1HQ,975
204
- vastdb/vast_tests/test_scale.py,sha256=yPF5sL2X7fiP_QooV3OnZAzsW38ANfkHFXq8B1_Uh-s,3515
205
- vastdb-1.3.1.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
206
- vastdb-1.3.1.dist-info/METADATA,sha256=oyVkT5bnbEKiuHPfiYuQKtu0C1N7yfeQTSOnhRWpF8c,1340
207
- vastdb-1.3.1.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
208
- vastdb-1.3.1.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
209
- vastdb-1.3.1.dist-info/RECORD,,
204
+ vastdb/vast_tests/test_scale.py,sha256=5jGwOdZH6Tv5tPdZYPWoqcxOceI2jA5i2D1zNKZHER4,3958
205
+ vastdb-1.3.2.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
206
+ vastdb-1.3.2.dist-info/METADATA,sha256=NWJHQlPY-3V5nFmm9dLysGrLN7POvhVjq1qbFDfsr64,1340
207
+ vastdb-1.3.2.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
208
+ vastdb-1.3.2.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
209
+ vastdb-1.3.2.dist-info/RECORD,,
File without changes