fix(dremio): apply same fix as for drill to solve alias ambiguity (#33939)

This commit is contained in:
Maxime Beauchemin
2025-06-27 00:22:29 -07:00
committed by GitHub
parent ede3de0ca0
commit b7ad8dba89

View File

@@ -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]}"