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 2A036172E6 for ; Fri, 10 Apr 2015 12:21:51 +0000 (UTC) Received: (qmail 1843 invoked by uid 500); 10 Apr 2015 12:21:50 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 1761 invoked by uid 500); 10 Apr 2015 12:21:50 -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 1751 invoked by uid 99); 10 Apr 2015 12:21:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Apr 2015 12:21:50 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [128.176.192.5] (HELO zivm-wwu2.uni-muenster.de) (128.176.192.5) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Apr 2015 12:21:45 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C/BQDdvidV/43AsIBcgkVHUlyzDgUBe5IjhgkCgTtMAQEBAQEBfoQgAQEEeBEsFg8JAwIBAgFFEwgBAYgmzxyGEIoeFoQXBYkWiHOCcoIrhQY6WIRmAyGNLCKBRQyCIG2CQwEBAQ X-IPAS-Result: A2C/BQDdvidV/43AsIBcgkVHUlyzDgUBe5IjhgkCgTtMAQEBAQEBfoQgAQEEeBEsFg8JAwIBAgFFEwgBAYgmzxyGEIoeFoQXBYkWiHOCcoIrhQY6WIRmAyGNLCKBRQyCIG2CQwEBAQ X-IronPort-AV: E=Sophos;i="5.11,556,1422918000"; d="scan'208,217";a="74492205" Received: from secmail.uni-muenster.de ([128.176.192.141]) by zivm-relay2.uni-muenster.de with ESMTP; 10 Apr 2015 14:21:23 +0200 Received: from [10.66.39.176] (WL-POOL1-ONT-104.UNI-MUENSTER.DE [128.176.12.231]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTP id EDBB1BF402 for ; Fri, 10 Apr 2015 14:21:22 +0200 (CEST) Message-ID: <5527C042.8010006@uni-muenster.de> Date: Fri, 10 Apr 2015 14:21:22 +0200 From: Marius User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: user@avro.apache.org Subject: Silent error while writing file, Python References: <1428667539.50808.ezmlm@avro.apache.org> In-Reply-To: <1428667539.50808.ezmlm@avro.apache.org> Content-Type: multipart/alternative; boundary="------------070808060601000202080406" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------070808060601000202080406 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Hello, i want to store data from an XML file in avro. In order to test my scheme, i wanted to write a small amount of data to it. The program finished without an error, however the file is empty so no data was appended. ===avro_test.py=== importavro.schema fromavro.datafileimportDataFileReader, DataFileWriter fromavro.ioimportDatumReader, DatumWriter schema = avro.schema.Parse(open("user.avsc").read()) test1 = {"id":5} test = {"count":3,"cvList": test1} writer = DataFileWriter(open("users.avro","wb"), DatumWriter(), schema) writer.append({"count":5,"cvList": {"id":5}}) writer.close ===user.avsc=== { "name":"cv", "type":"record", "fields": [ {"name":"count","type":"int"}, {"name":"cvList", "type": { "name":"cvData", "type":"record", "fields": [ {"name":"id","type":"int"} ] } } ] } ==end== I'm sorry if something obvious is wrong, i'm new to avro and json. What's bothering me is that there was no error while executing. Gr��e Marius --------------070808060601000202080406 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit Hello,

i want to store data from an XML file in avro. In order to test my scheme, i wanted to write a small amount of data to it. The program finished without an error, however the file is empty so no data was appended.

===avro_test.py===
import avro.schema
from avro.datafile import DataFileReader, DataFileWriter
from avro.io import DatumReader, DatumWriter

schema = avro.schema.Parse(open("user.avsc").read())


test1 = {"id" : 5}
test = {"count" : 3, "cvList" : test1}



writer = DataFileWriter(open("users.avro", "wb"), DatumWriter(), schema)
writer.append({"count" : 5, "cvList" : {"id" : 5}})
writer.close


===user.avsc===
{
  "name" : "cv",
  "type" : "record",
  "fields" : [
    {"name" : "count", "type" : "int"},
    {"name" : "cvList",
      "type": {
        "name" : "cvData",
        "type" : "record",
        "fields" : [
          {"name" : "id", "type" : "int"}
        ]
      }
    }
  ]
}
==end==

I'm sorry if something obvious is wrong, i'm new to avro and json. What's bothering me is that there was no error while executing.

Gr��e

Marius
--------------070808060601000202080406--