title: Hive: passing parameters
body: <p>@libjack:</p>
  
  <p>Hi,</p>
  
  <p>I wanted to pass parameters into the hql from ksh script.
  I went through Apache hive using variables document. The below worked fine where I set the values inside hql: </p>
  
  <pre><code>SET hivevar:parm1=valu1;
  CREATE SCHEMA IF NOT EXISTS ${parm1};
  </code></pre>
  
  <p>But I wanted to pass the parameters while invoking hive inside ksh. I have the variables and its value in a file as below:</p>
  
  <pre><code>--hiveconf:
  SET hivevar:parm1=valu1;
  
  --Inside .ksh:
  hive --hivevar "'cat ${hiveconf}`" -f hiveScript.hql
  
  --hiveScript.hql:
  CREATE SCHEMA IF NOT EXISTS ${parm1};
  </code></pre>
  
  <p>This fails. I tried with hiveconf as well. 
  How to pass the variable to hql?
  Is it possible to pass as a file?</p>
  
  <p>Thanks.</p>