Return-Path: X-Original-To: apmail-avro-user-archive@www.apache.org Delivered-To: apmail-avro-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 77DD31022F for ; Sat, 15 Feb 2014 23:22:33 +0000 (UTC) Received: (qmail 18788 invoked by uid 500); 15 Feb 2014 23:22:32 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 18645 invoked by uid 500); 15 Feb 2014 23:22:31 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 18637 invoked by uid 99); 15 Feb 2014 23:22:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Feb 2014 23:22:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of svarovsky.tomas@gmail.com designates 209.85.192.177 as permitted sender) Received: from [209.85.192.177] (HELO mail-pd0-f177.google.com) (209.85.192.177) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Feb 2014 23:22:25 +0000 Received: by mail-pd0-f177.google.com with SMTP id x10so13239094pdj.8 for ; Sat, 15 Feb 2014 15:22:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=CGjkZufOcagDy5Dbrh5hAUqZgMe8WovnLiqPypLuEuo=; b=0ZFsXWo97pCHMFPPuNeKYVhNg9X8EAJFgVIf7Zn38TvjSAuPtG52/BO6QQZiL9Gd+x rDZvdfEiP4gUVxB0q7LQjXKFCj0woZAXQhgI05GaQ4u7Ww6Vfco6scXv5W+7G8kCYjsy 2VaN/XJoGMqabVj/dWaB5rPt9blQEvKW8kDJ4pAW12pWGLVNOs/LAZDBTcHUqUUKttdw lhOYWGnSEesBxdm/z6c0uSVMsItsbTYRZ2/cBLDenXrQgI9049YLTG67UOi2rfHb462r +T62RF9Nn1SbOL2G+YKU8PxSEd0iZR+AqQGti7RrB274awMtdakVUB2FhbKwuUrrME/V FNyw== MIME-Version: 1.0 X-Received: by 10.66.149.7 with SMTP id tw7mr17690764pab.72.1392506523853; Sat, 15 Feb 2014 15:22:03 -0800 (PST) Received: by 10.70.17.196 with HTTP; Sat, 15 Feb 2014 15:22:03 -0800 (PST) Date: Sat, 15 Feb 2014 15:22:03 -0800 Message-ID: Subject: Avro schema in Ruby API From: Tomas Svarovsky To: user@avro.apache.org Content-Type: multipart/alternative; boundary=047d7b6d8a44b3a99604f27a3011 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6d8a44b3a99604f27a3011 Content-Type: text/plain; charset=ISO-8859-1 Hey, I wanted to ask couple of questions. 1) Let's assume I have 2 avro files. I would like to grab schemas of both. Compare them and decide what to do. The only way I found to get to the schema in a reader is through dr = Avro::DataFile::Reader.new(file, Avro::IO::DatumReader.new) dr.meta and that is still stringified JSON. Is this the only way or even is this use case something supported or should I do it differently? 2) Also is ti possible to read just the schema? Sometimes it is useful to look at a file without actually reading the whole file let's say from s3. Regards Tomas --047d7b6d8a44b3a99604f27a3011 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hey,

I wanted to ask couple of qu= estions.

1) Let's assume I have 2 = avro files. I would like to grab schemas of both. Compare them and decide w= hat to do. The only way I found to get to the schema in a reader is through=

dr =3D Avro::DataFile::Reader.new(file= , Avro::IO::DatumReader.new)
dr.meta

and that is still stringified JSON. Is this the only way or even i= s this use case something supported or should I do it differently?

2) Also is ti possible to read just the sch= ema? Sometimes it is useful to look at a file without actually reading the = whole file let's say from s3.

Regards Tomas
--047d7b6d8a44b3a99604f27a3011--