title: Passing Variables to Query via Beeline
body: <p>I need assistance with understanding why my hivevar is not being set in my query?</p>
  
  <p><strong><em>This is my beeline statement in a shell script:</em></strong></p>
  
  <pre><code>Start_Date="20180423"
  End_Date="20180424"
  
  beeline -u 'jdbc:hive2://#####/default;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;principal=######;' -f ${my_queries}/Count_Query --showHeader=false --outputformat=csv2 --silent=false --hivevar start_date=$Start_Date --hivevar end_date=$End_Date  1&gt;${my_data}/Data_File 2&gt;${my_log}/Log_File
  </code></pre>
  
  <p><strong><em>The Query</em></strong></p>
  
  <pre><code>use sample_db;
  select count(*) from sample_table where data_dt&gt;=${start_date} and data_dt&lt;${end_date};
  </code></pre>
  
  <p><strong><em>When I look at the data file, which provides a dump of the query, the variables are not properly set to the values.</em></strong></p>
  
  <pre><code>0: jdbc:hive2://####&gt; use sample_db;
  0: jdbc:hive2://####&gt; select count(*) from sample_table where data_dt&gt;=${start_date} and data_dt&lt;${end_date};
  </code></pre>