diff --git a/src/chronify/time_series_mapper_base.py b/src/chronify/time_series_mapper_base.py index 127d9db..b43a32d 100644 --- a/src/chronify/time_series_mapper_base.py +++ b/src/chronify/time_series_mapper_base.py @@ -146,7 +146,10 @@ def apply_mapping( to_schema.name, ) if output_file is None: - conn.execute(text(f"DROP TABLE {to_schema.name}")) + if engine.name == "hive": + conn.execute(text(f"DROP VIEW {to_schema.name}")) + else: + conn.execute(text(f"DROP TABLE {to_schema.name}")) raise finally: with engine.begin() as conn: