Skip to content

Commit

Permalink
[COST-3373] - drop openshift_pod_usage_line_items_daily table (projec…
Browse files Browse the repository at this point in the history
  • Loading branch information
maskarb authored Jan 12, 2023
1 parent 770c250 commit af3e9db
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions scripts/cji_scripts/migrate_trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,29 +111,25 @@ def drop_table_by_partition(table, partition_column, conn_params):


def main():
logging.info("Running the hive migration for OCP/GCP additional cost fields")

logging.info("fetching schemas")
schemas = get_schemas()
logging.info("Running against the following schemas")
logging.info(schemas)

# tables_to_drop = [
# "reporting_ocpazurecostlineitem_project_daily_summary_temp",
# "reporting_ocpawscostlineitem_project_daily_summary_temp",
# "reporting_ocpgcpcostlineitem_project_daily_summary_temp",
# ]
tables_to_drop = [
"openshift_pod_usage_line_items_daily",
]
# columns_to_drop = ["ocp_matched"]
columns_to_add = {
"node_role": "varchar",
}
# columns_to_add = {
# "node_role": "varchar",
# }

for schema in schemas:
CONNECT_PARAMS["schema"] = schema
logging.info(f"*** Adding column to tables for schema {schema} ***")
add_columns_to_table(columns_to_add, "openshift_pod_usage_line_items_daily", CONNECT_PARAMS)
# logging.info(f"*** Dropping tables {tables_to_drop} for schema {schema} ***")
# drop_tables(tables_to_drop, CONNECT_PARAMS)
# logging.info(f"*** Adding column to tables for schema {schema} ***")
# add_columns_to_table(columns_to_add, "openshift_pod_usage_line_items_daily", CONNECT_PARAMS)
logging.info(f"*** Dropping tables {tables_to_drop} for schema {schema} ***")
drop_tables(tables_to_drop, CONNECT_PARAMS)


if __name__ == "__main__":
Expand Down

0 comments on commit af3e9db

Please sign in to comment.