sql/src/main/java/com/github/sadikovi/hadoop/riff/RiffOutputCommitter.java
/**
   * Write Riff metadata file.
   * @param conf hadoop configuration
   * @param outputPath root path for output
   * @throws IOException
   */
Write Riff metadata file.
@param conf hadoop configuration
@param outputPath root path for output
@throws IOException
Write Riff metadata file . @param conf hadoop configuration @param outputPath root path for output @throws IOException
private static void writeMetadataFile(Configuration conf, Path outputPath) throws IOException {
    FileSystem fs = outputPath.getFileSystem(conf);
    FileStatus status = fs.getFileStatus(outputPath);
    List<FileStatus> partFiles = listFiles(fs, status, true);
    if (partFiles.isEmpty()) {
      LOG.warn("Could not find any part files for path {}, metadata is ignored", outputPath);
    } else {
      Metadata.MetadataWriter writer = Riff.metadataWriter(fs, conf, partFiles.get(0).getPath());
      writer.writeMetadataFile(outputPath);
      LOG.info("Finished writing metadata file for {}", outputPath);
    }
  }
private static void writeMetadataFile ( Configuration conf , Path outputPath ) throws IOException { FileSystem fs = outputPath . getFileSystem ( conf ) ; FileStatus status = fs . getFileStatus ( outputPath ) ; List < FileStatus > partFiles = listFiles ( fs , status , true ) ; if ( partFiles . isEmpty ( ) ) { LOG . warn ( "Could not find any part files for path {}, metadata is ignored" , outputPath ) ; } else { Metadata . MetadataWriter writer = Riff . metadataWriter ( fs , conf , partFiles . get ( 0 ) . getPath ( ) ) ; writer . writeMetadataFile ( outputPath ) ; LOG . info ( "Finished writing metadata file for {}" , outputPath ) ; } }
Write Riff metadata file.
Write Riff metadata file .
// Right now, merging of the schema is not supported as we do not support schema evolution or // merge. At this point, just find the first file of riff format and write metadata for it.