title: about how to run impala-shell within a shell script
body: <p>i have a problem when trying to execute this bash code:</p>
  
  <pre><code>function createImpalaPartition() {
  
  period_id=$1;
  database=$2
  node=$3
  
  actual_full=$(date -d@"$period_id" +%Y/%m/%d/%H/%M/)
  template="use c2d;create EXTERNAL TABLE exptopology_$period_id (child_id bigint,parent_id bigint,level INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' WITH SERDEPROPERTIES ('serialization.format'=',', 'field.delim'=',') STORED AS TEXTFILE LOCATION '/hfc/sip/service/topology/$actual_full'"
  
  echo "template is $template";
  #impala-shell -V -i $node -d $database -q $template
  impala-shell -V -i $node -q $template
  }
  </code></pre>
  
  <p>This is how i invoke it:</p>
  
  <pre><code>createImpalaPartition $actual $impalaDatabase $impalaNode
  </code></pre>
  
  <p>where </p>
  
  <pre><code>actual=$(date +'%s')
  impalaDatabase="dbName"
  impalaNode="name_of_the_node"
  </code></pre>
  
  <p>the execution of the script returns:</p>
  
  <pre><code>[core@dub-vcd-vms170 ~]$ createImpalaPartition $actual $impalaDatabase $impalaNode
  template is use c2d;create EXTERNAL TABLE exptopology_1428326587 (child_id bigint,parent_id bigint,level INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' WITH SERDEPROPERTIES ('serialization.format'=',', 'field.delim'=',') STORED AS TEXTFILE LOCATION '/hfc/sip/service/topology/2015/04/06/14/23/'
  Error, could not parse arguments "c2d;create EXTERNAL TABLE exptopology_1428326587 (child_id bigint,parent_id bigint,level INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' WITH SERDEPROPERTIES ('serialization.format'=',', 'field.delim'=',') STORED AS TEXTFILE LOCATION '/hfc/sip/service/topology/2015/04/06/14/23/'"
   Usage: impala_shell.py [options]
  </code></pre>
  
  <p>As you can see, i have to create tables using a shell script.</p>
  
  <p>UPDATE:</p>
  
  <p>following this <a href="https://stackoverflow.com/questions/28419361/is-there-any-way-to-run-impala-shell-with-sql-script-with-parameters">link</a>, i can see that impala-shell can be used that way, but i am not using the correct params.</p>
  
  <p>I have used -f instead of -q, the same error remains. Can anybody help me, please?</p>