Pārlūkot izejas kodu

HUE-3228 [dashboard] Add other engine that does not support backticks

Romain 6 gadi atpakaļ
vecāks
revīzija
4fd345cef1

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py

@@ -96,7 +96,7 @@ class SqlAlchemyApi(Api):
   def __init__(self, user, interpreter):
     self.user = user
     self.options = interpreter['options']
-    self.backticks = '"' if self.options['url'].startswith('postgresql://') else '`'
+    self.backticks = '"' if self.options['url'].startswith('postgresql://') or self.options['url'].startswith('awsathena') else '`'
 
   def _create_engine(self):
     if '${' in self.options['url']: # URL parameters substitution

+ 1 - 1
desktop/libs/notebook/src/notebook/dashboard_api.py

@@ -52,7 +52,7 @@ class SQLDashboardApi(DashboardApi):
     self.engine = engine
     self.source = source
     self.async = engine == 'hive' or engine == 'impala'
-    self.backticks = '"' if engine == 'postgresql' else '`'
+    self.backticks = '"' if engine in ['postgresql', 'athena'] else '`'
 
 
   def query(self, dashboard, query, facet=None):