diff --git a/superset/db_engine_specs/dremio.py b/superset/db_engine_specs/dremio.py index 1f4338830bb..39fe48be635 100644 --- a/superset/db_engine_specs/dremio.py +++ b/superset/db_engine_specs/dremio.py @@ -25,6 +25,7 @@ from sqlalchemy import types from superset.constants import TimeGrain from superset.db_engine_specs.base import BaseEngineSpec +from superset.utils.hashing import md5_sha_from_str if TYPE_CHECKING: from superset.models.core import Database @@ -93,3 +94,14 @@ class DremioEngineSpec(BaseEngineSpec): dttm_formatted = dttm.isoformat(sep=" ", timespec="milliseconds") return f"""TO_TIMESTAMP('{dttm_formatted}', 'YYYY-MM-DD HH24:MI:SS.FFF')""" return None + + @staticmethod + def _mutate_label(label: str) -> str: + """ + Suffix with the first six characters from the md5 of the label to avoid + collisions with original column names + + :param label: Expected expression label + :return: Conditionally mutated label + """ + return f"{label}_{md5_sha_from_str(label)[:6]}"