You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Guruprasad Nagaraj <gp...@gmail.com> on 2013/09/12 16:44:30 UTC

Clarification required on Avro

Hi,
I read through the documentation on Avro C but couldn't get a definitive answer to whether this is possible.

The goal is to convert a stream of raw data to JSON using a JSON schema.
For e.g.
- A Syslog message format from a linux sub-system is represented in a JSON Schema
- The JSON schema is loaded into Avro C
- The actual message when arrives should be passed into a function that converts the message into JSON formatted output using the JSON schema which was loaded into Avro C earlier.

I searched through the message archives and couldn't get this. I haven't looked into all the APIs provided by Avro C, yet.
Can anybody help?

Thanks and Best Regards,
GPN
--
Guruprasad Nagaraj

RE: Clarification required on Avro

Posted by Sam Groth <sg...@yahoo-inc.com>.
See the avro_value_to_json method in http://svn.apache.org/viewvc/avro/trunk/lang/c/src/avro/value.h?revision=1331812&view=markup

If you follow the steps that you mention, this method will give a JSON string of the data.

Hope this helps,
Sam

________________________________________
From: Guruprasad Nagaraj [gpn.devnull@gmail.com]
Sent: Thursday, September 12, 2013 09:44
To: user@avro.apache.org
Subject: Clarification required on Avro

Hi,
I read through the documentation on Avro C but couldn't get a definitive answer to whether this is possible.

The goal is to convert a stream of raw data to JSON using a JSON schema.
For e.g.
- A Syslog message format from a linux sub-system is represented in a JSON Schema
- The JSON schema is loaded into Avro C
- The actual message when arrives should be passed into a function that converts the message into JSON formatted output using the JSON schema which was loaded into Avro C earlier.

I searched through the message archives and couldn't get this. I haven't looked into all the APIs provided by Avro C, yet.
Can anybody help?

Thanks and Best Regards,
GPN
--
Guruprasad Nagaraj