Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tool to check interop files can be opened

  • Loading branch information...
commit f77d7d0b187aa8045bd2699a19f43d0ce23ed2bb 1 parent ed4f490
@yannk authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 bin/avro-to-json
View
19 bin/avro-to-json
@@ -0,0 +1,19 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use Avro::DataFileReader;
+use Carp;
+use IO::File;
+use JSON::XS;
+
+my $j = JSON::XS->new->allow_nonref;
+
+my $fh = IO::File->new(shift || croak "specify a file");
+my $reader = Avro::DataFileReader->new(
+ fh => $fh,
+);
+for ($reader->all) {
+ print $j->encode($_);
+ print "\n";
+}
Please sign in to comment.
Something went wrong with that request. Please try again.