deltacat 1.1.35__py3-none-any.whl → 2.0__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.
- deltacat/__init__.py +42 -3
- deltacat/annotations.py +36 -0
- deltacat/api.py +168 -0
- deltacat/aws/s3u.py +4 -4
- deltacat/benchmarking/benchmark_engine.py +82 -0
- deltacat/benchmarking/benchmark_report.py +86 -0
- deltacat/benchmarking/benchmark_suite.py +11 -0
- deltacat/benchmarking/conftest.py +21 -0
- deltacat/benchmarking/data/random_row_generator.py +94 -0
- deltacat/benchmarking/data/row_generator.py +10 -0
- deltacat/benchmarking/test_benchmark_pipeline.py +106 -0
- deltacat/catalog/__init__.py +14 -0
- deltacat/catalog/delegate.py +199 -106
- deltacat/catalog/iceberg/__init__.py +4 -0
- deltacat/catalog/iceberg/iceberg_catalog_config.py +26 -0
- deltacat/catalog/iceberg/impl.py +368 -0
- deltacat/catalog/iceberg/overrides.py +74 -0
- deltacat/catalog/interface.py +273 -76
- deltacat/catalog/main/impl.py +720 -0
- deltacat/catalog/model/catalog.py +227 -20
- deltacat/catalog/model/properties.py +116 -0
- deltacat/catalog/model/table_definition.py +32 -1
- deltacat/compute/compactor/model/compaction_session_audit_info.py +7 -3
- deltacat/compute/compactor/model/delta_annotated.py +3 -3
- deltacat/compute/compactor/model/delta_file_envelope.py +3 -1
- deltacat/compute/compactor/model/delta_file_locator.py +3 -1
- deltacat/compute/compactor/model/round_completion_info.py +5 -5
- deltacat/compute/compactor/model/table_object_store.py +3 -2
- deltacat/compute/compactor/repartition_session.py +1 -1
- deltacat/compute/compactor/steps/dedupe.py +11 -4
- deltacat/compute/compactor/steps/hash_bucket.py +1 -1
- deltacat/compute/compactor/steps/materialize.py +6 -2
- deltacat/compute/compactor/utils/io.py +1 -1
- deltacat/compute/compactor/utils/sort_key.py +9 -2
- deltacat/compute/compactor_v2/compaction_session.py +2 -3
- deltacat/compute/compactor_v2/constants.py +1 -30
- deltacat/compute/compactor_v2/deletes/utils.py +3 -3
- deltacat/compute/compactor_v2/model/merge_input.py +1 -1
- deltacat/compute/compactor_v2/private/compaction_utils.py +5 -5
- deltacat/compute/compactor_v2/steps/merge.py +11 -80
- deltacat/compute/compactor_v2/utils/content_type_params.py +0 -17
- deltacat/compute/compactor_v2/utils/dedupe.py +1 -1
- deltacat/compute/compactor_v2/utils/io.py +1 -1
- deltacat/compute/compactor_v2/utils/primary_key_index.py +3 -15
- deltacat/compute/compactor_v2/utils/task_options.py +23 -43
- deltacat/compute/converter/constants.py +4 -0
- deltacat/compute/converter/converter_session.py +143 -0
- deltacat/compute/converter/model/convert_input.py +69 -0
- deltacat/compute/converter/model/convert_input_files.py +61 -0
- deltacat/compute/converter/model/converter_session_params.py +99 -0
- deltacat/compute/converter/pyiceberg/__init__.py +0 -0
- deltacat/compute/converter/pyiceberg/catalog.py +75 -0
- deltacat/compute/converter/pyiceberg/overrides.py +135 -0
- deltacat/compute/converter/pyiceberg/update_snapshot_overrides.py +251 -0
- deltacat/compute/converter/steps/__init__.py +0 -0
- deltacat/compute/converter/steps/convert.py +211 -0
- deltacat/compute/converter/steps/dedupe.py +60 -0
- deltacat/compute/converter/utils/__init__.py +0 -0
- deltacat/compute/converter/utils/convert_task_options.py +88 -0
- deltacat/compute/converter/utils/converter_session_utils.py +109 -0
- deltacat/compute/converter/utils/iceberg_columns.py +82 -0
- deltacat/compute/converter/utils/io.py +43 -0
- deltacat/compute/converter/utils/s3u.py +133 -0
- deltacat/compute/resource_estimation/delta.py +1 -19
- deltacat/constants.py +47 -1
- deltacat/env.py +51 -0
- deltacat/examples/__init__.py +0 -0
- deltacat/examples/basic_logging.py +101 -0
- deltacat/examples/common/__init__.py +0 -0
- deltacat/examples/common/fixtures.py +15 -0
- deltacat/examples/hello_world.py +27 -0
- deltacat/examples/iceberg/__init__.py +0 -0
- deltacat/examples/iceberg/iceberg_bucket_writer.py +139 -0
- deltacat/examples/iceberg/iceberg_reader.py +149 -0
- deltacat/exceptions.py +51 -9
- deltacat/logs.py +4 -1
- deltacat/storage/__init__.py +118 -28
- deltacat/storage/iceberg/__init__.py +0 -0
- deltacat/storage/iceberg/iceberg_scan_planner.py +28 -0
- deltacat/storage/iceberg/impl.py +737 -0
- deltacat/storage/iceberg/model.py +709 -0
- deltacat/storage/interface.py +217 -134
- deltacat/storage/main/__init__.py +0 -0
- deltacat/storage/main/impl.py +2077 -0
- deltacat/storage/model/delta.py +118 -71
- deltacat/storage/model/interop.py +24 -0
- deltacat/storage/model/list_result.py +8 -0
- deltacat/storage/model/locator.py +93 -3
- deltacat/{aws/redshift → storage}/model/manifest.py +122 -98
- deltacat/storage/model/metafile.py +1316 -0
- deltacat/storage/model/namespace.py +34 -18
- deltacat/storage/model/partition.py +362 -37
- deltacat/storage/model/scan/__init__.py +0 -0
- deltacat/storage/model/scan/push_down.py +19 -0
- deltacat/storage/model/scan/scan_plan.py +10 -0
- deltacat/storage/model/scan/scan_task.py +34 -0
- deltacat/storage/model/schema.py +892 -0
- deltacat/storage/model/shard.py +47 -0
- deltacat/storage/model/sort_key.py +170 -13
- deltacat/storage/model/stream.py +208 -80
- deltacat/storage/model/table.py +123 -29
- deltacat/storage/model/table_version.py +322 -46
- deltacat/storage/model/transaction.py +757 -0
- deltacat/storage/model/transform.py +198 -61
- deltacat/storage/model/types.py +111 -13
- deltacat/storage/rivulet/__init__.py +11 -0
- deltacat/storage/rivulet/arrow/__init__.py +0 -0
- deltacat/storage/rivulet/arrow/serializer.py +75 -0
- deltacat/storage/rivulet/dataset.py +744 -0
- deltacat/storage/rivulet/dataset_executor.py +87 -0
- deltacat/storage/rivulet/feather/__init__.py +5 -0
- deltacat/storage/rivulet/feather/file_reader.py +136 -0
- deltacat/storage/rivulet/feather/serializer.py +35 -0
- deltacat/storage/rivulet/fs/__init__.py +0 -0
- deltacat/storage/rivulet/fs/file_provider.py +105 -0
- deltacat/storage/rivulet/fs/file_store.py +130 -0
- deltacat/storage/rivulet/fs/input_file.py +76 -0
- deltacat/storage/rivulet/fs/output_file.py +86 -0
- deltacat/storage/rivulet/logical_plan.py +105 -0
- deltacat/storage/rivulet/metastore/__init__.py +0 -0
- deltacat/storage/rivulet/metastore/delta.py +190 -0
- deltacat/storage/rivulet/metastore/json_sst.py +105 -0
- deltacat/storage/rivulet/metastore/sst.py +82 -0
- deltacat/storage/rivulet/metastore/sst_interval_tree.py +260 -0
- deltacat/storage/rivulet/mvp/Table.py +101 -0
- deltacat/storage/rivulet/mvp/__init__.py +5 -0
- deltacat/storage/rivulet/parquet/__init__.py +5 -0
- deltacat/storage/rivulet/parquet/data_reader.py +0 -0
- deltacat/storage/rivulet/parquet/file_reader.py +127 -0
- deltacat/storage/rivulet/parquet/serializer.py +37 -0
- deltacat/storage/rivulet/reader/__init__.py +0 -0
- deltacat/storage/rivulet/reader/block_scanner.py +378 -0
- deltacat/storage/rivulet/reader/data_reader.py +136 -0
- deltacat/storage/rivulet/reader/data_scan.py +63 -0
- deltacat/storage/rivulet/reader/dataset_metastore.py +178 -0
- deltacat/storage/rivulet/reader/dataset_reader.py +156 -0
- deltacat/storage/rivulet/reader/pyarrow_data_reader.py +121 -0
- deltacat/storage/rivulet/reader/query_expression.py +99 -0
- deltacat/storage/rivulet/reader/reader_type_registrar.py +84 -0
- deltacat/storage/rivulet/schema/__init__.py +0 -0
- deltacat/storage/rivulet/schema/datatype.py +128 -0
- deltacat/storage/rivulet/schema/schema.py +251 -0
- deltacat/storage/rivulet/serializer.py +40 -0
- deltacat/storage/rivulet/serializer_factory.py +42 -0
- deltacat/storage/rivulet/writer/__init__.py +0 -0
- deltacat/storage/rivulet/writer/dataset_writer.py +29 -0
- deltacat/storage/rivulet/writer/memtable_dataset_writer.py +294 -0
- deltacat/tests/_io/__init__.py +1 -0
- deltacat/tests/catalog/test_catalogs.py +324 -0
- deltacat/tests/catalog/test_default_catalog_impl.py +16 -8
- deltacat/tests/compute/compact_partition_multiple_rounds_test_cases.py +21 -21
- deltacat/tests/compute/compact_partition_rebase_test_cases.py +6 -6
- deltacat/tests/compute/compact_partition_rebase_then_incremental_test_cases.py +56 -56
- deltacat/tests/compute/compact_partition_test_cases.py +19 -53
- deltacat/tests/compute/compactor/steps/test_repartition.py +2 -2
- deltacat/tests/compute/compactor/utils/test_io.py +6 -8
- deltacat/tests/compute/compactor_v2/test_compaction_session.py +0 -466
- deltacat/tests/compute/compactor_v2/utils/test_task_options.py +1 -273
- deltacat/tests/compute/conftest.py +75 -0
- deltacat/tests/compute/converter/__init__.py +0 -0
- deltacat/tests/compute/converter/conftest.py +80 -0
- deltacat/tests/compute/converter/test_convert_session.py +478 -0
- deltacat/tests/compute/converter/utils.py +123 -0
- deltacat/tests/compute/resource_estimation/test_delta.py +0 -16
- deltacat/tests/compute/test_compact_partition_incremental.py +2 -42
- deltacat/tests/compute/test_compact_partition_multiple_rounds.py +5 -46
- deltacat/tests/compute/test_compact_partition_params.py +3 -3
- deltacat/tests/compute/test_compact_partition_rebase.py +1 -46
- deltacat/tests/compute/test_compact_partition_rebase_then_incremental.py +5 -46
- deltacat/tests/compute/test_util_common.py +19 -12
- deltacat/tests/compute/test_util_create_table_deltas_repo.py +13 -22
- deltacat/tests/local_deltacat_storage/__init__.py +76 -103
- deltacat/tests/storage/__init__.py +0 -0
- deltacat/tests/storage/conftest.py +25 -0
- deltacat/tests/storage/main/__init__.py +0 -0
- deltacat/tests/storage/main/test_main_storage.py +1399 -0
- deltacat/tests/storage/model/__init__.py +0 -0
- deltacat/tests/storage/model/test_delete_parameters.py +21 -0
- deltacat/tests/storage/model/test_metafile_io.py +2535 -0
- deltacat/tests/storage/model/test_schema.py +308 -0
- deltacat/tests/storage/model/test_shard.py +22 -0
- deltacat/tests/storage/model/test_table_version.py +110 -0
- deltacat/tests/storage/model/test_transaction.py +308 -0
- deltacat/tests/storage/rivulet/__init__.py +0 -0
- deltacat/tests/storage/rivulet/conftest.py +149 -0
- deltacat/tests/storage/rivulet/fs/__init__.py +0 -0
- deltacat/tests/storage/rivulet/fs/test_file_location_provider.py +93 -0
- deltacat/tests/storage/rivulet/schema/__init__.py +0 -0
- deltacat/tests/storage/rivulet/schema/test_schema.py +241 -0
- deltacat/tests/storage/rivulet/test_dataset.py +406 -0
- deltacat/tests/storage/rivulet/test_manifest.py +67 -0
- deltacat/tests/storage/rivulet/test_sst_interval_tree.py +232 -0
- deltacat/tests/storage/rivulet/test_utils.py +122 -0
- deltacat/tests/storage/rivulet/writer/__init__.py +0 -0
- deltacat/tests/storage/rivulet/writer/test_dataset_write_then_read.py +341 -0
- deltacat/tests/storage/rivulet/writer/test_dataset_writer.py +79 -0
- deltacat/tests/storage/rivulet/writer/test_memtable_dataset_writer.py +75 -0
- deltacat/tests/test_deltacat_api.py +39 -0
- deltacat/tests/test_utils/filesystem.py +14 -0
- deltacat/tests/test_utils/message_pack_utils.py +54 -0
- deltacat/tests/test_utils/pyarrow.py +8 -15
- deltacat/tests/test_utils/storage.py +266 -3
- deltacat/tests/utils/test_daft.py +3 -3
- deltacat/tests/utils/test_pyarrow.py +0 -432
- deltacat/types/partial_download.py +1 -1
- deltacat/types/tables.py +1 -1
- deltacat/utils/export.py +59 -0
- deltacat/utils/filesystem.py +320 -0
- deltacat/utils/metafile_locator.py +73 -0
- deltacat/utils/pyarrow.py +36 -183
- deltacat-2.0.dist-info/METADATA +65 -0
- deltacat-2.0.dist-info/RECORD +347 -0
- deltacat/aws/redshift/__init__.py +0 -19
- deltacat/catalog/default_catalog_impl/__init__.py +0 -369
- deltacat/io/dataset.py +0 -73
- deltacat/io/read_api.py +0 -143
- deltacat/storage/model/delete_parameters.py +0 -40
- deltacat/storage/model/partition_spec.py +0 -71
- deltacat/tests/compute/compactor_v2/utils/test_content_type_params.py +0 -253
- deltacat/tests/compute/compactor_v2/utils/test_primary_key_index.py +0 -45
- deltacat-1.1.35.dist-info/METADATA +0 -64
- deltacat-1.1.35.dist-info/RECORD +0 -219
- /deltacat/{aws/redshift/model → benchmarking/data}/__init__.py +0 -0
- /deltacat/{io/aws → catalog/main}/__init__.py +0 -0
- /deltacat/{io/aws/redshift → compute/converter}/__init__.py +0 -0
- /deltacat/{tests/io → compute/converter/model}/__init__.py +0 -0
- /deltacat/tests/{io → _io}/test_cloudpickle_bug_fix.py +0 -0
- /deltacat/tests/{io → _io}/test_file_object_store.py +0 -0
- /deltacat/tests/{io → _io}/test_memcached_object_store.py +0 -0
- /deltacat/tests/{io → _io}/test_ray_plasma_object_store.py +0 -0
- /deltacat/tests/{io → _io}/test_redis_object_store.py +0 -0
- /deltacat/tests/{io → _io}/test_s3_object_store.py +0 -0
- {deltacat-1.1.35.dist-info → deltacat-2.0.dist-info}/LICENSE +0 -0
- {deltacat-1.1.35.dist-info → deltacat-2.0.dist-info}/WHEEL +0 -0
- {deltacat-1.1.35.dist-info → deltacat-2.0.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,53 @@
|
|
1
1
|
from typing import Optional, Dict
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
import pyarrow as pa
|
4
|
+
|
5
|
+
from deltacat import (
|
6
|
+
ContentEncoding,
|
7
|
+
ContentType,
|
8
|
+
)
|
9
|
+
from deltacat.storage import (
|
10
|
+
BucketTransform,
|
11
|
+
BucketTransformParameters,
|
12
|
+
BucketingStrategy,
|
13
|
+
CommitState,
|
14
|
+
Delta,
|
15
|
+
DeltaLocator,
|
16
|
+
DeltaType,
|
17
|
+
EntryParams,
|
18
|
+
EntryType,
|
19
|
+
Field,
|
20
|
+
LifecycleState,
|
21
|
+
ManifestAuthor,
|
22
|
+
ManifestEntry,
|
23
|
+
Namespace,
|
24
|
+
NamespaceLocator,
|
25
|
+
NullOrder,
|
26
|
+
Partition,
|
27
|
+
PartitionKey,
|
28
|
+
PartitionLocator,
|
29
|
+
PartitionScheme,
|
30
|
+
Schema,
|
31
|
+
SchemaList,
|
32
|
+
SortScheme,
|
33
|
+
SortKey,
|
34
|
+
SortOrder,
|
35
|
+
StreamLocator,
|
36
|
+
StreamFormat,
|
37
|
+
Stream,
|
38
|
+
Table,
|
39
|
+
TableLocator,
|
40
|
+
TableVersionLocator,
|
41
|
+
TableVersion,
|
42
|
+
TruncateTransform,
|
43
|
+
TruncateTransformParameters,
|
44
|
+
)
|
45
|
+
|
46
|
+
from deltacat.storage.model.manifest import (
|
47
|
+
Manifest,
|
48
|
+
ManifestMeta,
|
49
|
+
ManifestEntryList,
|
50
|
+
)
|
5
51
|
from deltacat.utils.common import current_time_ms
|
6
52
|
|
7
53
|
|
@@ -17,7 +63,7 @@ def create_empty_delta(
|
|
17
63
|
|
18
64
|
if manifest_entry_id:
|
19
65
|
manifest = Manifest.of(
|
20
|
-
entries=[],
|
66
|
+
entries=ManifestEntryList.of([]),
|
21
67
|
author=author,
|
22
68
|
uuid=manifest_entry_id,
|
23
69
|
)
|
@@ -32,3 +78,220 @@ def create_empty_delta(
|
|
32
78
|
manifest=manifest,
|
33
79
|
previous_stream_position=partition.stream_position,
|
34
80
|
)
|
81
|
+
|
82
|
+
|
83
|
+
def create_test_namespace():
|
84
|
+
namespace_locator = NamespaceLocator.of(namespace="test_namespace")
|
85
|
+
return Namespace.of(locator=namespace_locator)
|
86
|
+
|
87
|
+
|
88
|
+
def create_test_table():
|
89
|
+
table_locator = TableLocator.at(
|
90
|
+
namespace="test_namespace",
|
91
|
+
table_name="test_table",
|
92
|
+
)
|
93
|
+
return Table.of(
|
94
|
+
locator=table_locator,
|
95
|
+
description="test table description",
|
96
|
+
)
|
97
|
+
|
98
|
+
|
99
|
+
def create_test_table_version():
|
100
|
+
table_version_locator = TableVersionLocator.at(
|
101
|
+
namespace="test_namespace",
|
102
|
+
table_name="test_table",
|
103
|
+
table_version="v.1",
|
104
|
+
)
|
105
|
+
schema = Schema.of(
|
106
|
+
[
|
107
|
+
Field.of(
|
108
|
+
field=pa.field("some_string", pa.string(), nullable=False),
|
109
|
+
field_id=1,
|
110
|
+
is_merge_key=True,
|
111
|
+
),
|
112
|
+
Field.of(
|
113
|
+
field=pa.field("some_int32", pa.int32(), nullable=False),
|
114
|
+
field_id=2,
|
115
|
+
is_merge_key=True,
|
116
|
+
),
|
117
|
+
Field.of(
|
118
|
+
field=pa.field("some_float64", pa.float64()),
|
119
|
+
field_id=3,
|
120
|
+
is_merge_key=False,
|
121
|
+
),
|
122
|
+
]
|
123
|
+
)
|
124
|
+
bucket_transform = BucketTransform.of(
|
125
|
+
BucketTransformParameters.of(
|
126
|
+
num_buckets=2,
|
127
|
+
bucketing_strategy=BucketingStrategy.DEFAULT,
|
128
|
+
)
|
129
|
+
)
|
130
|
+
partition_keys = [
|
131
|
+
PartitionKey.of(
|
132
|
+
key=["some_string", "some_int32"],
|
133
|
+
name="test_partition_key",
|
134
|
+
field_id="test_field_id",
|
135
|
+
transform=bucket_transform,
|
136
|
+
)
|
137
|
+
]
|
138
|
+
partition_scheme = PartitionScheme.of(
|
139
|
+
keys=partition_keys,
|
140
|
+
name="test_partition_scheme",
|
141
|
+
scheme_id="test_partition_scheme_id",
|
142
|
+
)
|
143
|
+
sort_keys = [
|
144
|
+
SortKey.of(
|
145
|
+
key=["some_int32"],
|
146
|
+
sort_order=SortOrder.DESCENDING,
|
147
|
+
null_order=NullOrder.AT_START,
|
148
|
+
transform=TruncateTransform.of(
|
149
|
+
TruncateTransformParameters.of(width=3),
|
150
|
+
),
|
151
|
+
)
|
152
|
+
]
|
153
|
+
sort_scheme = SortScheme.of(
|
154
|
+
keys=sort_keys,
|
155
|
+
name="test_sort_scheme",
|
156
|
+
scheme_id="test_sort_scheme_id",
|
157
|
+
)
|
158
|
+
return TableVersion.of(
|
159
|
+
locator=table_version_locator,
|
160
|
+
schema=schema,
|
161
|
+
partition_scheme=partition_scheme,
|
162
|
+
description="test table version description",
|
163
|
+
properties={"test_property_key": "test_property_value"},
|
164
|
+
content_types=[ContentType.PARQUET],
|
165
|
+
sort_scheme=sort_scheme,
|
166
|
+
watermark=None,
|
167
|
+
lifecycle_state=LifecycleState.CREATED,
|
168
|
+
schemas=SchemaList.of([schema]),
|
169
|
+
partition_schemes=[partition_scheme],
|
170
|
+
sort_schemes=[sort_scheme],
|
171
|
+
)
|
172
|
+
|
173
|
+
|
174
|
+
def create_test_stream():
|
175
|
+
stream_locator = StreamLocator.at(
|
176
|
+
namespace="test_namespace",
|
177
|
+
table_name="test_table",
|
178
|
+
table_version="v.1",
|
179
|
+
stream_id="test_stream_id",
|
180
|
+
stream_format=StreamFormat.DELTACAT,
|
181
|
+
)
|
182
|
+
bucket_transform = BucketTransform.of(
|
183
|
+
BucketTransformParameters.of(
|
184
|
+
num_buckets=2,
|
185
|
+
bucketing_strategy=BucketingStrategy.DEFAULT,
|
186
|
+
)
|
187
|
+
)
|
188
|
+
partition_keys = [
|
189
|
+
PartitionKey.of(
|
190
|
+
key=["some_string", "some_int32"],
|
191
|
+
name="test_partition_key",
|
192
|
+
field_id="test_field_id",
|
193
|
+
transform=bucket_transform,
|
194
|
+
)
|
195
|
+
]
|
196
|
+
partition_scheme = PartitionScheme.of(
|
197
|
+
keys=partition_keys,
|
198
|
+
name="test_partition_scheme",
|
199
|
+
scheme_id="test_partition_scheme_id",
|
200
|
+
)
|
201
|
+
return Stream.of(
|
202
|
+
locator=stream_locator,
|
203
|
+
partition_scheme=partition_scheme,
|
204
|
+
state=CommitState.STAGED,
|
205
|
+
previous_stream_id="test_previous_stream_id",
|
206
|
+
watermark=1,
|
207
|
+
)
|
208
|
+
|
209
|
+
|
210
|
+
def create_test_partition():
|
211
|
+
partition_locator = PartitionLocator.at(
|
212
|
+
namespace="test_namespace",
|
213
|
+
table_name="test_table",
|
214
|
+
table_version="v.1",
|
215
|
+
stream_id="test_stream_id",
|
216
|
+
stream_format=StreamFormat.DELTACAT,
|
217
|
+
partition_values=["a", 1],
|
218
|
+
partition_id="test_partition_id",
|
219
|
+
)
|
220
|
+
schema = Schema.of(
|
221
|
+
[
|
222
|
+
Field.of(
|
223
|
+
field=pa.field("some_string", pa.string(), nullable=False),
|
224
|
+
field_id=1,
|
225
|
+
is_merge_key=True,
|
226
|
+
),
|
227
|
+
Field.of(
|
228
|
+
field=pa.field("some_int32", pa.int32(), nullable=False),
|
229
|
+
field_id=2,
|
230
|
+
is_merge_key=True,
|
231
|
+
),
|
232
|
+
Field.of(
|
233
|
+
field=pa.field("some_float64", pa.float64()),
|
234
|
+
field_id=3,
|
235
|
+
is_merge_key=False,
|
236
|
+
),
|
237
|
+
]
|
238
|
+
)
|
239
|
+
return Partition.of(
|
240
|
+
locator=partition_locator,
|
241
|
+
schema=schema,
|
242
|
+
content_types=[ContentType.PARQUET],
|
243
|
+
state=CommitState.STAGED,
|
244
|
+
previous_stream_position=0,
|
245
|
+
previous_partition_id="test_previous_partition_id",
|
246
|
+
stream_position=1,
|
247
|
+
partition_scheme_id="test_partition_scheme_id",
|
248
|
+
)
|
249
|
+
|
250
|
+
|
251
|
+
def create_test_delta():
|
252
|
+
delta_locator = DeltaLocator.at(
|
253
|
+
namespace="test_namespace",
|
254
|
+
table_name="test_table",
|
255
|
+
table_version="v.1",
|
256
|
+
stream_id="test_stream_id",
|
257
|
+
stream_format=StreamFormat.DELTACAT,
|
258
|
+
partition_values=["a", 1],
|
259
|
+
partition_id="test_partition_id",
|
260
|
+
stream_position=1,
|
261
|
+
)
|
262
|
+
manifest_entry_params = EntryParams.of(
|
263
|
+
equality_field_locators=["some_string", "some_int32"],
|
264
|
+
)
|
265
|
+
manifest_meta = ManifestMeta.of(
|
266
|
+
record_count=1,
|
267
|
+
content_length=10,
|
268
|
+
content_type=ContentType.PARQUET.value,
|
269
|
+
content_encoding=ContentEncoding.IDENTITY.value,
|
270
|
+
source_content_length=100,
|
271
|
+
credentials={"foo": "bar"},
|
272
|
+
content_type_parameters=[{"param1": "value1"}],
|
273
|
+
entry_type=EntryType.EQUALITY_DELETE,
|
274
|
+
entry_params=manifest_entry_params,
|
275
|
+
)
|
276
|
+
manifest = Manifest.of(
|
277
|
+
entries=[
|
278
|
+
ManifestEntry.of(
|
279
|
+
url="s3://test/url",
|
280
|
+
meta=manifest_meta,
|
281
|
+
)
|
282
|
+
],
|
283
|
+
author=ManifestAuthor.of(
|
284
|
+
name="deltacat",
|
285
|
+
version="2.0",
|
286
|
+
),
|
287
|
+
entry_type=EntryType.EQUALITY_DELETE,
|
288
|
+
entry_params=manifest_entry_params,
|
289
|
+
)
|
290
|
+
return Delta.of(
|
291
|
+
locator=delta_locator,
|
292
|
+
delta_type=DeltaType.APPEND,
|
293
|
+
meta=manifest_meta,
|
294
|
+
properties={"property1": "value1"},
|
295
|
+
manifest=manifest,
|
296
|
+
previous_stream_position=0,
|
297
|
+
)
|
@@ -166,7 +166,7 @@ class TestDaftS3FilesToDataFrame(unittest.TestCase):
|
|
166
166
|
uris=[self.MVP_PATH],
|
167
167
|
content_encoding=ContentEncoding.IDENTITY.value,
|
168
168
|
content_type=ContentType.PARQUET.value,
|
169
|
-
ray_init_options={"local_mode": True},
|
169
|
+
ray_init_options={"local_mode": True, "ignore_reinit_error": True},
|
170
170
|
)
|
171
171
|
|
172
172
|
table = df.to_arrow()
|
@@ -178,7 +178,7 @@ class TestDaftS3FilesToDataFrame(unittest.TestCase):
|
|
178
178
|
uris=[self.MVP_PATH],
|
179
179
|
content_encoding=ContentEncoding.IDENTITY.value,
|
180
180
|
content_type=ContentType.PARQUET.value,
|
181
|
-
ray_init_options={"local_mode": True},
|
181
|
+
ray_init_options={"local_mode": True, "ignore_reinit_error": True},
|
182
182
|
)
|
183
183
|
|
184
184
|
self.assertRaises(RuntimeError, lambda: len(df))
|
@@ -193,7 +193,7 @@ class TestDaftS3FilesToDataFrame(unittest.TestCase):
|
|
193
193
|
uris=[self.MVP_PATH],
|
194
194
|
content_encoding=ContentEncoding.IDENTITY.value,
|
195
195
|
content_type=ContentType.UNESCAPED_TSV.value,
|
196
|
-
ray_init_options={"local_mode": True},
|
196
|
+
ray_init_options={"local_mode": True, "ignore_reinit_error": True},
|
197
197
|
),
|
198
198
|
)
|
199
199
|
|