vastdb 1.1.1__py3-none-any.whl → 1.1.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/table.py +11 -10
- vastdb/tests/test_tables.py +20 -0
- {vastdb-1.1.1.dist-info → vastdb-1.1.2.dist-info}/METADATA +1 -1
- {vastdb-1.1.1.dist-info → vastdb-1.1.2.dist-info}/RECORD +7 -7
- {vastdb-1.1.1.dist-info → vastdb-1.1.2.dist-info}/LICENSE +0 -0
- {vastdb-1.1.1.dist-info → vastdb-1.1.2.dist-info}/WHEEL +0 -0
- {vastdb-1.1.1.dist-info → vastdb-1.1.2.dist-info}/top_level.txt +0 -0
vastdb/table.py
CHANGED
|
@@ -474,16 +474,17 @@ class Table:
|
|
|
474
474
|
rows_chunk = rows[INTERNAL_ROW_ID]
|
|
475
475
|
except KeyError:
|
|
476
476
|
raise errors.MissingRowIdColumn
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
477
|
+
|
|
478
|
+
if columns is None:
|
|
479
|
+
columns = [name for name in rows.schema.names if name != INTERNAL_ROW_ID]
|
|
480
|
+
|
|
481
|
+
update_fields = [(INTERNAL_ROW_ID, pa.uint64())]
|
|
482
|
+
update_values = [_combine_chunks(rows_chunk)]
|
|
483
|
+
for col in columns:
|
|
484
|
+
update_fields.append(rows.field(col))
|
|
485
|
+
update_values.append(_combine_chunks(rows[col]))
|
|
486
|
+
|
|
487
|
+
update_rows_rb = pa.record_batch(schema=pa.schema(update_fields), data=update_values)
|
|
487
488
|
|
|
488
489
|
update_rows_rb = util.sort_record_batch_if_needed(update_rows_rb, INTERNAL_ROW_ID)
|
|
489
490
|
|
vastdb/tests/test_tables.py
CHANGED
|
@@ -204,6 +204,26 @@ def test_update_table(session, clean_bucket_name):
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
|
|
207
|
+
def test_update_from_select(session, clean_bucket_name):
|
|
208
|
+
columns = pa.schema([
|
|
209
|
+
('a', pa.int64()),
|
|
210
|
+
('b', pa.float32()),
|
|
211
|
+
('s', pa.utf8()),
|
|
212
|
+
])
|
|
213
|
+
expected = pa.table(schema=columns, data=[
|
|
214
|
+
[111, 222, 333],
|
|
215
|
+
[0.5, 1.5, 2.5],
|
|
216
|
+
['a', 'bb', 'ccc'],
|
|
217
|
+
])
|
|
218
|
+
with prepare_data(session, clean_bucket_name, 's', 't', expected) as t:
|
|
219
|
+
for b in t.select(internal_row_id=True):
|
|
220
|
+
t.update(b)
|
|
221
|
+
t.update(pa.Table.from_batches([b]))
|
|
222
|
+
|
|
223
|
+
actual = t.select().read_all()
|
|
224
|
+
assert actual == expected
|
|
225
|
+
|
|
226
|
+
|
|
207
227
|
def test_select_with_multisplits(session, clean_bucket_name):
|
|
208
228
|
columns = pa.schema([
|
|
209
229
|
('a', pa.int32())
|
|
@@ -157,7 +157,7 @@ vastdb/errors.py,sha256=2XR1ko7J5nkfiHSAgwuVAADw0SsyqxOwSeFaGgKZEXM,4186
|
|
|
157
157
|
vastdb/features.py,sha256=DxV746LSkORwVSD6MP2hdXRfnyoLkJwtOwGmp1dnquo,1322
|
|
158
158
|
vastdb/schema.py,sha256=X7IRrogXH7Z0kes-DsDh1bRqIhvjH6owlFigGBXy7XQ,5913
|
|
159
159
|
vastdb/session.py,sha256=toMR0BXwTaECdWDKnIZky1F3MA1SmelRBiqCrqQ3GCM,2067
|
|
160
|
-
vastdb/table.py,sha256=
|
|
160
|
+
vastdb/table.py,sha256=C6Zz0zolRRRbf5EQBvDRAofl3kGvfz4PjZwGeQongTI,31106
|
|
161
161
|
vastdb/transaction.py,sha256=NlVkEowJ_pmtffjWBBDaKExYDKPekjSZyj_fK_bZPJE,3026
|
|
162
162
|
vastdb/util.py,sha256=eunfTuqbCrqQEFZEO9T15N-Bu8Fqpw7Zlqp2TAGfYaY,5870
|
|
163
163
|
vastdb/bench/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -196,14 +196,14 @@ vastdb/tests/test_nested.py,sha256=LPU6uV3Ri23dBzAEMFQqRPbqapV5LfmiHSHkhILPIY0,6
|
|
|
196
196
|
vastdb/tests/test_projections.py,sha256=3y1kubwVrzO-xoR0hyps7zrjOJI8niCYspaFTN16Q9w,4540
|
|
197
197
|
vastdb/tests/test_sanity.py,sha256=oiV2gb05aPyG5RMNUQZlyjNlg3T7Fig1_8OJzpAgcsk,3038
|
|
198
198
|
vastdb/tests/test_schemas.py,sha256=l70YQMlx2UL1KRQhApriiG2ZM7GJF-IzWU31H3Yqn1U,3312
|
|
199
|
-
vastdb/tests/test_tables.py,sha256=
|
|
199
|
+
vastdb/tests/test_tables.py,sha256=URfd0_rh5sleCFGbNsJBdIGdXOvIiiLGyhKTNtswU98,32578
|
|
200
200
|
vastdb/tests/test_util.py,sha256=Ok_sAEBJsRGF5Voa_v5eu3eAd52GWu8jMjjQbadwW-s,1260
|
|
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
204
|
vastdb/vast_tests/test_scale.py,sha256=EpjCJmVAQrNBxVnHGJ-KHCoxevhqOcyqYFPMIIY9s60,2714
|
|
205
|
-
vastdb-1.1.
|
|
206
|
-
vastdb-1.1.
|
|
207
|
-
vastdb-1.1.
|
|
208
|
-
vastdb-1.1.
|
|
209
|
-
vastdb-1.1.
|
|
205
|
+
vastdb-1.1.2.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
|
|
206
|
+
vastdb-1.1.2.dist-info/METADATA,sha256=n2QV0OrTzVR9pQKUmVhsH3c5dIS29Vl5C1h0AyDEJDg,1340
|
|
207
|
+
vastdb-1.1.2.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
208
|
+
vastdb-1.1.2.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
|
|
209
|
+
vastdb-1.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|