title: How to solve no space left on device when running hive query on aws emr
body: <p>I have aws emr setup with me on which I run my hive queries.
  As of now the hardware setup is as follows.</p>
  
  <p>One Master - m3.xlarge
  8 vCPU, 15 GiB memory, 80 SSD GB storage
  EBS Storage:none</p>
  
  <p>Fifteen Core Node - m3.xlarge
  8 vCPU, 15 GiB memory, 80 SSD GB storage
  EBS Storage:none</p>
  
  <p>My query deal with around 500 million record and they become part of internal hive table.
  I perform merge query on these internal table.</p>
  
  <p>Now i know one solution where if I increase the number of core nodes, the problem will be gone.
  But I need help in understanding why this error actually happened and how to debug and solve it. I there any reference material to refer to.</p>
  
  <p>Here is the stacktrace.</p>
  
  <pre><code>For Reason - org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Map 1, vertexId=vertex_1507712059631_0734_1_01, diagnostics=[Task failed, taskId=task_1507712059631_0734_1_01_000066, diagnostics=[TaskAttempt 0 failed, info=[Container container_1507712059631_0734_01_000056 finished with diagnostics set to [Container failed, exitCode=-100. Container released on a *lost* node]], TaskAttempt 1 failed, info=[Container container_1507712059631_0734_01_000038 finished with diagnostics set to [Container failed, exitCode=-100. Container released on a *lost* node]], TaskAttempt 2 failed, info=[Error: Encountered an FSError while executing task: attempt_1507712059631_0734_1_01_000066_2:org.apache.hadoop.fs.FSError: java.io.IOException: No space left on device
  at org.apache.hadoop.fs.RawLocalFileSystem$LocalFSFileOutputStream.write(RawLocalFileSystem.java:253)
  at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
  at org.apache.hadoop.fs.FSDataOutputStream$PositionCache.write(FSDataOutputStream.java:60)
  at java.io.DataOutputStream.write(DataOutputStream.java:107)
  at org.apache.tez.runtime.library.common.sort.impl.IFileOutputStream.write(IFileOutputStream.java:120)
  at
  </code></pre>