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 EEB67100C3 for ; Mon, 7 Oct 2013 21:05:32 +0000 (UTC) Received: (qmail 37665 invoked by uid 500); 7 Oct 2013 21:05:32 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 37129 invoked by uid 500); 7 Oct 2013 21:05:27 -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 37069 invoked by uid 99); 7 Oct 2013 21:05:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Oct 2013 21:05:20 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of vitalip@gmail.com designates 209.85.215.50 as permitted sender) Received: from [209.85.215.50] (HELO mail-la0-f50.google.com) (209.85.215.50) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Oct 2013 21:05:15 +0000 Received: by mail-la0-f50.google.com with SMTP id gx14so6244141lab.9 for ; Mon, 07 Oct 2013 14:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=B1qZjKjaiiqZsCqvFk5HmIDUy/GHbl9oA3amVpHGmoY=; b=n/XIXk3YEsqq3Tp9MZsgHimyF1kRy6dA75EZyVd8jyk+PMkpptv4c0hLDa0dCfr0AY oiI0kkzvm+ab1mdc27+4OExZikk5lJ2XCRx3EPDd9mPR2NQr4Vw7mrytnoYamtx2WUtD 45VMPk1T87lv8dkDl/9/aYDGbxLzJUbZv93w4XDeYGsyjs117z6Ud1dwP+bZrEa4gMT1 Uhpx6WP8/DCP53VgRwDoMnQqKdYQEUisEedfagttV+U0bEwXdGihrslgv9SeZ3OIZdWh vDW4aM497/iHJoWTYyLMzm4b4v/MXxTfOFXzhWT75GyUwtnl282XzjhqJ3kxZm8zwxEt 4pHQ== MIME-Version: 1.0 X-Received: by 10.152.2.74 with SMTP id 10mr3369242las.36.1381179894107; Mon, 07 Oct 2013 14:04:54 -0700 (PDT) Received: by 10.112.56.209 with HTTP; Mon, 7 Oct 2013 14:04:53 -0700 (PDT) In-Reply-To: References: Date: Mon, 7 Oct 2013 14:04:53 -0700 Message-ID: Subject: Re: Unable to compile a namespace-less schema From: Vitaly Gordon To: user@avro.apache.org Content-Type: multipart/mixed; boundary=089e01228e5af5aaab04e82d00b8 X-Virus-Checked: Checked by ClamAV on apache.org --089e01228e5af5aaab04e82d00b8 Content-Type: multipart/alternative; boundary=089e01228e5af5aaa704e82d00b6 --089e01228e5af5aaa704e82d00b6 Content-Type: text/plain; charset=ISO-8859-1 Hi Sean, Here is a file that contains a single record that I cannot read using a specific reader. It's hard for me to add code because the problem is a compilation problem with the generated Java files. So to recreate the problem: 1. Extract the schema from the record 2. Generate the code from the schema 3. Compile Is there another way that I can describe the issue? On Mon, Oct 7, 2013 at 10:58 AM, Sean Busbey wrote: > Hi Vitay! > > Can you give us a minimal schema and test program that illustrates the > problem you're describing? > > -- > Sean > On Oct 7, 2013 12:27 PM, "Vitaly Gordon" wrote: > >> Hi All, >> I am trying to read Avro data that its schema does not have a namespace. >> The problem is that I cannot compile the classes, because the generated >> Java code does not have a package. On the other hand, if I do add some >> arbitrary namespace to the schema, the record is resolved as a generic one, >> which then fails on ClassCastException to the specific record. >> >> Any ideas on how I can resolve this issue? >> >> Thanks, >> Vitay >> > --089e01228e5af5aaa704e82d00b6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Sean,
Here is a file that contains a single r= ecord that I cannot read using a specific reader.

It's hard for me to add code because the problem is a compi= lation problem with the generated Java files.

So to recreate the problem:
1. Extract the schema from the record
2. Generate the code= from the schema
3. Compile

Is there another way that I can describe the issue?



On M= on, Oct 7, 2013 at 10:58 AM, Sean Busbey <busbey@cloudera.com> wrote:

Hi Vitay!

Can you give us a minimal schema and test program that illus= trates the problem you're describing?

--
Sean

On Oct 7, 2013 12:27 PM, "Vitaly Gordon&quo= t; <vitalip@gmail= .com> wrote:
Hi All,
I am trying to read Avro data that its schema = does not have a namespace. The problem is that I cannot compile the classes= , because the generated Java code does not have a package. On the other han= d, if I do add some arbitrary namespace to the schema, the record is resolv= ed as a generic one, which then fails on ClassCastException to the specific= record.

Any ideas on how I can resolve this issue?
Thanks,
Vitay

--089e01228e5af5aaa704e82d00b6-- --089e01228e5af5aaab04e82d00b8 Content-Type: application/octet-stream; name="record.avro" Content-Disposition: attachment; filename="record.avro" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hmi6ud9t0 T2JqAQIWYXZyby5zY2hlbWGwNHsidHlwZSI6InJlY29yZCIsIm5hbWUiOiJUVVBMRV8yMCIsImZp ZWxkcyI6W3sibmFtZSI6ImZpZWxkMSIsInR5cGUiOlsibnVsbCIseyJ0eXBlIjoiYXJyYXkiLCJp dGVtcyI6WyJudWxsIiwiaW50Il19XSwiZG9jIjoiYXV0b2dlbmVyYXRlZCBmcm9tIFBpZyBGaWVs ZCBTY2hlbWEifSx7Im5hbWUiOiJmaWVsZDIiLCJ0eXBlIjpbIm51bGwiLCJpbnQiXSwiZG9jIjoi YXV0b2dlbmVyYXRlZCBmcm9tIFBpZyBGaWVsZCBTY2hlbWEifSx7Im5hbWUiOiJmaWVsZDMiLCJ0 eXBlIjpbIm51bGwiLCJzdHJpbmciXSwiZG9jIjoiYXV0b2dlbmVyYXRlZCBmcm9tIFBpZyBGaWVs ZCBTY2hlbWEifSx7Im5hbWUiOiJmaWVsZDQiLCJ0eXBlIjpbIm51bGw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