Bläddra i källkod

[hplsql] adding hplsql config to on and off the HPLSQL mode

ayush.goyal 4 år sedan
förälder
incheckning
66f654d24b

+ 6 - 0
apps/beeswax/src/beeswax/conf.py

@@ -123,6 +123,12 @@ HIVE_HTTP_THRIFT_PORT = Config(
   dynamic_default=get_hive_thrift_http_port,
   type=int)
 
+HPLSQL = Config(
+  key="hplsql",
+  default=False,
+  type=coerce_bool,
+  help=_t('Enable the HPLSQL mode.'))
+
 HIVE_METASTORE_HOST = Config(
   key="hive_metastore_host",
   help=_t("Host where Hive Metastore Server (HMS) is running. If Kerberos security is enabled, "

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

@@ -34,7 +34,7 @@ from desktop.conf import DEFAULT_USER, USE_THRIFT_HTTP_JWT
 
 from beeswax import conf as beeswax_conf, hive_site
 from beeswax.hive_site import hiveserver2_use_ssl
-from beeswax.conf import CONFIG_WHITELIST, LIST_PARTITIONS_LIMIT
+from beeswax.conf import CONFIG_WHITELIST, LIST_PARTITIONS_LIMIT, HPLSQL
 from beeswax.models import Session, HiveServerQueryHandle, HiveServerQueryHistory
 from beeswax.server.dbms import Table, DataTable, QueryServerException, InvalidSessionQueryServerException
 
@@ -674,6 +674,8 @@ class HiveServerClient(object):
 
     if self.query_server['server_name'] == 'beeswax': # All the time
       kwargs['configuration'].update({'hive.server2.proxy.user': user.username})
+      if HPLSQL.get():
+        kwargs['configuration'].update({'set:hivevar:mode': 'HPLSQL'})
 
     if self.query_server['server_name'] == 'llap': # All the time
       kwargs['configuration'].update({'hive.server2.proxy.user': user.username})

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -1383,6 +1383,9 @@ submit_to=True
 # Use SASL framework to establish connection to host.
 ## use_sasl=false
 
+# Enable the HPLSQL mode.
+## hplsql=false
+
 [[ssl]]
 # Path to Certificate Authority certificates.
 ## cacerts=/etc/hue/cacerts.pem

+ 3 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -1366,6 +1366,9 @@
   # Use SASL framework to establish connection to host.
   ## use_sasl=false
 
+  # Enable the HPLSQL mode.
+  ## hplsql=false
+
   [[ssl]]
     # Path to Certificate Authority certificates.
     ## cacerts=/etc/hue/cacerts.pem