title: Unable to run hive command from another user on Ubuntu
body: <p>I have installed Apache Hive as hduser and am able to run that perfectly from my <code>hduser</code>.</p>
  
  <p>I want to run that as command <code>hive -f someScript.sql</code> but I want to do that from some other user, say root. I am trying a command like</p>
  
  <pre><code>sudo -u hduser '/usr/local/hive/bin/hive -f test.sql'
  </code></pre>
  
  <p>The output I am getting is</p>
  
  <pre><code>sudo: /usr/local/hive/bin/hive -f test.sql: command not found
  </code></pre>
  
  <p>I have my user <code>hduser</code> in the list of sudoers as well if that helps.  I don't understand why this could be happening since hive has been properly added to the path and when I go via <code>su hduser</code> and then run it, this all works fine.</p>