Skip to content

Instantly share code, notes, and snippets.

@heapxor
Created January 20, 2016 16:38
Show Gist options
  • Select an option

  • Save heapxor/569336e8351b402f9bc3 to your computer and use it in GitHub Desktop.

Select an option

Save heapxor/569336e8351b402f9bc3 to your computer and use it in GitHub Desktop.
sample
main () {
schema1 = readAvroSchema(source1);
}
public static String readAvroSchema(String source) {
DataFileStream reader = null;
Schema avSchema ;
File f = new File(source);
try {
reader = new DataFileReader(f, new GenericDatumReader());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
avSchema = reader.getSchema();
//System.out.println(avSchema.toString());
return avSchema.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment