title: Hive trying to read current working directory when called in Python script
body: <p>I am attempting to execute a Hive script from a Python wrapper. Part of code looks like</p>
  
  <pre><code>print(HiveArgs)
  Hive = subprocess.Popen(HiveArgs, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
  HiveOutput = Hive.communicate()
  
  print("Out:" + HiveOutput[0])
  print("=================================")
  print("Err:" + HiveOutput[1])
  </code></pre>
  
  <p>The output of this is:</p>
  
  <pre><code>['hive', '-i ', '/edw/edwdev/tmp/spark.txn.init.tmp', '-f ', '/edw/edwdev/tmp/test.hql.tmp']
  Out:
  =================================
  Err:
  Logging initialized using configuration in file:/etc/hive/2.5.0.2-3/0/hive-log4j.properties
  Exception in thread "main" java.io.FileNotFoundException: File file:/data/edw/edwdev/  does not exist
          at org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:624)
          at org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:850)
          at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:614)
          at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:422)
          at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSInputChecker.&lt;init&gt;(ChecksumFileSystem.java:146)
          at org.apache.hadoop.fs.ChecksumFileSystem.open(ChecksumFileSystem.java:348)
          at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:782)
          at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:427)
          at org.apache.hadoop.hive.cli.CliDriver.processInitFiles(CliDriver.java:439)
          at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:708)
          at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:684)
          at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:624)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
          at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
  </code></pre>
  
  <p>where <code>/data/edw/edwdev/</code> (file that Hive thinks is missing) is my working directory on a Linux server.</p>
  
  <p>Changing working directory to script's location doesn't help. Using relative and absolute paths also makes no difference. If i copy values from the printed <code>HiveArgs</code> and execute the command from terminal (<code>hive -i /edw/edwdev/tmp/spark.txn.init.tmp -f /edw/edwdev/tmp/test.hql.tmp</code>), it works correctly. </p>
  
  <p>What am I missing here?</p>