Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Imran
Partner - Contributor
Partner - Contributor

Calling Stored procedure from Impala using shell script or bat file

Hello All,

I am looking to run stored procedure script(DB Impala) from Qlik Sense On-Prem environment using Shell Script or Bat file or any other mode and post that show the data in Qlik Sense UI. 

Is there any way or solution to achieve this? 

 

#!/bin/bash

# -----------------------------

# Impala Connection Details

# -----------------------------

#IMPALA_HOST="impala-hostname"

#IMPALA_PORT="21000"

DATABASE="kan_adhoc"

impala_cli="impala-shell -i kancdhdatap6.kanhadoopprd.net -d default -k --ssl"

 

# -----------------------------

# Impala CREATE TABLE

# -----------------------------

 

SQL_QUERY1="DROP TABLE IF EXISTS ${DATABASE}.aca_type;"

 

SQL_QUERY="CREATE TABLE IF NOT EXISTS ${DATABASE}.aca_type as select * from kan_ref.aca_type ;"

 

# -----------------------------

# Execute Query

# -----------------------------

#impala-shell \  -i ${IMPALA_HOST}:${IMPALA_PORT} \  -q "${SQL_QUERY}"

 

  $impala_cli -q "${SQL_QUERY1}"

 

  $impala_cli -q "${SQL_QUERY}"

 

# -----------------------------

# Status Check

# -----------------------------

if [ $? -eq 0 ]; then

  echo " Table created successfully in Impala."

else

  echo " Failed to create table in Impala."

  exit 1

fi

Labels (2)
0 Replies