@Override
    public void close(TaskAttemptContext context)
        throws IOException, InterruptedException {
      if (writer == null) {
        // a row with no columns
        ObjectInspector inspector = ObjectInspectorFactory.
            getStandardStructObjectInspector(new ArrayList<String>(),
                new ArrayList<ObjectInspector>());
        options.inspector(inspector);
        writer = OrcFile.createWriter(path, options);
      }
      writer.close();
    }
An OutputFormat that writes ORC files.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcNewOutputFormat.java