Explorar o código

HUE-8758 [editor] Replace notion of beeswax by hive in install examples

Romain %!s(int64=5) %!d(string=hai) anos
pai
achega
f341876611

+ 2 - 4
apps/beeswax/src/beeswax/management/commands/beeswax_install_examples.py

@@ -63,8 +63,6 @@ class Command(BaseCommand):
       user = options['user']
       request = options['request']
 
-    if dialect == 'beeswax':
-      dialect = 'hive'
     tables = 'tables_standard.json' if dialect not in ('hive', 'impala') else (
         'tables_transactional.json' if has_concurrency_support() else 'tables.json'
     )
@@ -111,8 +109,8 @@ class Command(BaseCommand):
     design_list = json.load(design_file)
     design_file.close()
 
-    # Filter design list to app-specific designs
-    app_type = HQL if dialect == 'beeswax' else IMPALA if dialect == 'impala' else RDBMS
+    # Filter query list to HiveServer2 vs other interfaces
+    app_type = HQL if dialect == 'hive' else IMPALA if dialect == 'impala' else RDBMS
     design_list = [d for d in design_list if int(d['type']) == app_type]
     if app_type == RDBMS:
       design_list = [d for d in design_list if dialect in d['dialects']]

+ 2 - 0
apps/beeswax/src/beeswax/views.py

@@ -613,6 +613,8 @@ def install_examples(request):
   if request.method == 'POST':
     try:
       dialect = get_app_name(request)
+      if dialect == 'beeswax':
+        dialect = 'hive'
       db_name = request.POST.get('db_name', 'default')
       connector_id = request.POST.get('connector_id')
       beeswax_install_examples.Command().handle(dialect=dialect, db_name=db_name, user=request.user)

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

@@ -397,7 +397,7 @@ def install_examples(request):
   try:
     connector = Connector.objects.get(id=request.POST.get('connector'))
     if connector:
-      dialect = 'beeswax' if connector.dialect == 'hive' else connector.dialect
+      dialect = connector.dialect
       db_name = request.POST.get('db_name', 'default')
       interpreter = get_interpreter(connector_type=connector.to_dict()['type'], user=request.user)