You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2009/06/03 23:20:36 UTC

svn commit: r781554 - in /hadoop/hive/trunk: CHANGES.txt ql/src/java/org/apache/hadoop/hive/ql/io/RCFileOutputFormat.java

Author: zshao
Date: Wed Jun  3 21:20:36 2009
New Revision: 781554

URL: http://svn.apache.org/viewvc?rev=781554&view=rev
Log:
HIVE-479. Change RCFileOutputFormat's generic signatute. (Yongqiang He via zshao)

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFileOutputFormat.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=781554&r1=781553&r2=781554&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Wed Jun  3 21:20:36 2009
@@ -212,6 +212,9 @@
     HIVE-443. Remove deprecated functions from metastore.
     (Prasad Chaaka via athusoo)
 
+    HIVE-479. Change RCFileOutputFormat's generic signatute.
+    (Yongqiang He via zshao)
+
 Release 0.3.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFileOutputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFileOutputFormat.java?rev=781554&r1=781553&r2=781554&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFileOutputFormat.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFileOutputFormat.java Wed Jun  3 21:20:36 2009
@@ -39,7 +39,7 @@
 import org.apache.hadoop.util.ReflectionUtils;
 
 public class RCFileOutputFormat extends
-    FileOutputFormat<Void, BytesRefArrayWritable> implements
+    FileOutputFormat<WritableComparable, BytesRefArrayWritable> implements
     HiveOutputFormat<WritableComparable, Writable> {
 
   /**
@@ -67,14 +67,14 @@
   }
 
   /** {@inheritDoc} */
-  public RecordWriter<Void, BytesRefArrayWritable> getRecordWriter(
+  public RecordWriter<WritableComparable, BytesRefArrayWritable> getRecordWriter(
       FileSystem ignored, JobConf job, String name, Progressable progress)
       throws IOException {
 
     Path outputPath = getWorkOutputPath(job);
     FileSystem fs = outputPath.getFileSystem(job);
     if (!fs.exists(outputPath)) {
-      throw new IOException("Output directory doesnt exist");
+      fs.mkdirs(outputPath);
     }
     Path file = new Path(outputPath, name);
     CompressionCodec codec = null;
@@ -84,7 +84,7 @@
     }
     final RCFile.Writer out = new RCFile.Writer(fs, job, file, progress, codec);
 
-    return new RecordWriter<Void, BytesRefArrayWritable>() {
+    return new RecordWriter<WritableComparable, BytesRefArrayWritable>() {
 
       @Override
       public void close(Reporter reporter) throws IOException {
@@ -92,7 +92,7 @@
       }
 
       @Override
-      public void write(Void key, BytesRefArrayWritable value)
+      public void write(WritableComparable key, BytesRefArrayWritable value)
           throws IOException {
         out.append(value);
       }