Skip to content

Commit 8ccccce

Browse files
fix(package): Remove archive_storage_type column from the datasets table since it should be a cluster-level setting. (#1029)
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
1 parent 04b44c5 commit 8ccccce

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

components/clp-py-utils/clp_py_utils/clp_metadata_db_utils.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
COLUMN_METADATA_TABLE_SUFFIX,
1010
DATASETS_TABLE_SUFFIX,
1111
FILES_TABLE_SUFFIX,
12-
StorageType,
1312
TAGS_TABLE_SUFFIX,
1413
)
1514

@@ -110,7 +109,6 @@ def create_datasets_table(db_cursor, table_prefix: str) -> None:
110109
f"""
111110
CREATE TABLE IF NOT EXISTS `{table_prefix}{DATASETS_TABLE_SUFFIX}` (
112111
`name` VARCHAR(255) NOT NULL,
113-
`archive_storage_type` VARCHAR(64) NOT NULL,
114112
`archive_storage_directory` VARCHAR(4096) NOT NULL,
115113
PRIMARY KEY (`name`)
116114
)
@@ -123,7 +121,6 @@ def add_dataset(
123121
db_cursor,
124122
table_prefix: str,
125123
dataset_name: str,
126-
archive_storage_type: StorageType,
127124
dataset_archive_storage_directory: Path,
128125
) -> None:
129126
"""
@@ -134,16 +131,13 @@ def add_dataset(
134131
:param db_cursor: The database cursor to execute the table row insertion.
135132
:param table_prefix: A string to prepend to the table name.
136133
:param dataset_name:
137-
:param archive_storage_type:
138134
:param dataset_archive_storage_directory:
139135
"""
140136
query = f"""INSERT INTO `{table_prefix}{DATASETS_TABLE_SUFFIX}`
141-
(name, archive_storage_type, archive_storage_directory)
142-
VALUES (%s, %s, %s)
137+
(name, archive_storage_directory)
138+
VALUES (%s, %s)
143139
"""
144-
db_cursor.execute(
145-
query, (dataset_name, archive_storage_type, str(dataset_archive_storage_directory))
146-
)
140+
db_cursor.execute(query, (dataset_name, str(dataset_archive_storage_directory)))
147141
create_metadata_db_tables(db_cursor, table_prefix, dataset_name)
148142
db_conn.commit()
149143

components/job-orchestration/job_orchestration/scheduler/compress/compression_scheduler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ def search_and_schedule_new_tasks(
200200
db_cursor,
201201
table_prefix,
202202
dataset_name,
203-
clp_archive_output.storage.type,
204203
archive_storage_directory,
205204
)
206205
existing_datasets.add(dataset_name)

docs/src/dev-guide/design-metadata-db.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ accommodate all expected values.
1414
(table-1)=
1515
:::{card}
1616

17-
| Column name | Type | Description |
18-
|---------------------------|---------------|--------------------------------------------------------------------------|
19-
| name | VARCHAR(255) | The *unique* name of the dataset. |
20-
| archive_storage_type | VARCHAR(64) | The storage type (e.g., `s3`) where archives are stored. |
21-
| archive_storage_directory | VARCHAR(4096) | The directory (on the `archive_storage_type`) where archives are stored. |
17+
| Column name | Type | Description |
18+
|---------------------------|---------------|-------------------------------------------------------------------------------------|
19+
| name | VARCHAR(255) | The *unique* name of the dataset. |
20+
| archive_storage_directory | VARCHAR(4096) | The directory (relative to the storage type, e.g., `s3`) where archives are stored. |
2221

2322
+++
2423
**Table 1**: The high-level schema of CLP's datasets table.

0 commit comments

Comments
 (0)