title: Copy file to hadoop hdfs using scala?
body: <p>I'm trying to copy a file on my local machine to my hdfs. However, I'm not sure how to do this in scala since the script I'm writing currently writes to a local CSV file. How can I move this file to HDFS using scala?</p>
  
  <p>edit: 
  what I have done now: </p>
  
  <pre><code>val hiveServer = new HiveJDBC
      val file =  new File(TMP_DIR, fileName)
      val firstRow = getFirstRow(tableName, hiveServer)
      val restData = getRestData(tableName, hiveServer)
      withPrintWriter(file) { printWriter =&gt; 
        printWriter.write(firstRow) 
        printWriter.write("\n")
        printWriter.write(restData)} 
  </code></pre>
  
  <p>I now want to store "file" in the HDFS</p>