Browse Source

[hive] Quoting database in the SQL of the create table wizard

Romain Rigaux 10 years ago
parent
commit
299a5090e1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      apps/beeswax/src/beeswax/server/dbms.py

+ 3 - 1
apps/beeswax/src/beeswax/server/dbms.py

@@ -405,9 +405,11 @@ class HiveServer2Dbms(object):
     if result_meta.in_tablename:
     if result_meta.in_tablename:
       self.use(database)
       self.use(database)
       query = self._get_and_validate_select_query(design, query_history)
       query = self._get_and_validate_select_query(design, query_history)
-      hql = 'CREATE TABLE %s.%s AS %s' % (target_database, target_table, query)
+      hql = 'CREATE TABLE `%s`.`%s` AS %s' % (target_database, target_table, query)
       query_history = self.execute_statement(hql)
       query_history = self.execute_statement(hql)
     else:
     else:
+      # FYI: this path is dead since moving to HiveServer2
+      #
       # Case 2: The results are in some temporary location
       # Case 2: The results are in some temporary location
       # Beeswax backward compatibility and optimization
       # Beeswax backward compatibility and optimization
       # 1. Create table
       # 1. Create table