mirror of
https://github.com/apache/superset.git
synced 2026-04-17 23:25:05 +00:00
fix(dremio): apply same fix as for drill to solve alias ambiguity (#33939)
This commit is contained in:
committed by
GitHub
parent
ede3de0ca0
commit
b7ad8dba89
@@ -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]}"
|
||||
|
||||
Reference in New Issue
Block a user