You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spot.apache.org by na...@apache.org on 2018/03/19 19:09:18 UTC

[07/15] incubator-spot git commit: Handle Kerberos with impala shell

Handle Kerberos with impala shell

- Set a common impala shell configuration that can be shared during the execution of CREATE DATABASE and CREATE TABLE commands.
- Check if Kerberos is enabled, and if so modify the common impala shell configuration to include the -k flag


Project: http://git-wip-us.apache.org/repos/asf/incubator-spot/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spot/commit/aa09bfb3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spot/tree/aa09bfb3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spot/diff/aa09bfb3

Branch: refs/heads/SPOT-181_ODM
Commit: aa09bfb36e6c22e1092508b0408254eb16bad9ef
Parents: 4998b22
Author: Tadd Wood <ta...@arcadiadata.com>
Authored: Mon Feb 12 10:33:49 2018 -0800
Committer: Tadd Wood <ta...@arcadiadata.com>
Committed: Mon Feb 12 10:49:00 2018 -0800

----------------------------------------------------------------------
 spot-setup/odm/odm_setup.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/aa09bfb3/spot-setup/odm/odm_setup.sh
----------------------------------------------------------------------
diff --git a/spot-setup/odm/odm_setup.sh b/spot-setup/odm/odm_setup.sh
index ce87f29..100e3bb 100755
--- a/spot-setup/odm/odm_setup.sh
+++ b/spot-setup/odm/odm_setup.sh
@@ -134,8 +134,22 @@ do
 	${hdfs_cmd} dfs -setfacl -R -m user:${USER}:rwx ${HUSER}/$d
 done
 
+# Check if Kerberos is enabled, and create the proper impala-shell configuration and arguments to be used when creating the ODM tables
+
+log "Using Impala as execution engine."
+impala_db_shell="impala-shell -i ${IMPALA_DEM}"
+log "${impala_db_shell}"
+
+if [[ ${KERBEROS} == "true" ]]; then
+    log "Kerberos enabled. Modifying Impala Shell arguments"
+    impala_db_shell="${impala_db_shell} -k"
+    log "${impala_db_shell}"
+fi
+
 # Creating Spot Database
-impala-shell -i ${IMPALA_DEM} -q "CREATE DATABASE IF NOT EXISTS ${DBNAME};"
+
+log "CREATE DATABASE IF NOT EXISTS ${DBNAME};"
+${impala_db_shell} "CREATE DATABASE IF NOT EXISTS ${DBNAME}";
 
 # Creating ODM Impala tables
 for d in "${DSOURCES[@]}"