title: Write to Hive in Java MapReduce Job
body: <p>I am currently working on a Java MapReduce job, which should output data to a bucketed Hive table. </p>
  
  <p>I think of two approaches: </p>
  
  <p>First directly write to Hive via HCatalog. The problem is, that this approach does not support writing to a bucketed Hive table. Hence, when using a bucketed Hive table, I need to first write to a non-bucketed table and then copy it to the bucketed one.</p>
  
  <p>The second option is to write the output to a text file and load this data into Hive afterwards.</p>
  
  <p>What is the best practice here?</p>
  
  <p>Which approach is more performant with a huge amount of data (with respect to memory and time taken)?</p>
  
  <p>Which approach would be the better one, if I could also use non-bucketed Hive tables?</p>
  
  <p>Thanks a lot!</p>