Just a guess, but I would assume that the schema object only stores fields that
it cares about. This would exclude your docs. If you want to know for sure, the
source code is here: https://github.com/apache/avro/tree/trunk/lang/c%2B%2B
Sam
On Tuesday, May 19, 2015 1:13 PM, Check Peck <[email protected]>
wrote:
Can anyone help me with this?
On Mon, May 18, 2015 at 2:04 PM, Check Peck <[email protected]> wrote:
Does anyone have any idea on this why it is behaving like this?
On Mon, May 18, 2015 at 1:03 PM, Check Peck <[email protected]> wrote:
And this is my to_string method I forgot to provide.
std::string DataSchema::to_string() const
{
ostringstream os;
if (valid())
{
os << "JSON data: ";
m_schema.toJson(os);
}
return os.str();
}
On Mon, May 18, 2015 at 12:54 PM, Check Peck <[email protected]> wrote:
I am working with Apache Avro in C++ and I am trying to load avro schema by
using Avro C++ library. Everything works fine without any issues, only problem
is - I have few "doc" in my Avro schema which is not getting shown at all in my
AvroSchema when I try to load it and also print it out.
DataSchema_ptr schema_data(new DataSchema());
schema_data->m_schema = load(avro_schema_file_name.c_str());
const avro::NodePtr node_data_ptr = schema_data->m_schema.root();
if (node_data_ptr && node_data_ptr->hasName())
{
// is there any problem with this node_data_ptr usage here?
schema_data->m_name = node_data_ptr->name().fullname().c_str();
// this line prints out whole AVRO but it doesn't have doc which is
there in my AVRO
cout<<"File String : " << schema_data->to_string() << endl;
}
Here "m_schema" is "avro::ValidSchema m_schema;"
Can anyone help me with this. In general I don't see my doc which I have in
Avro Schema getting shown when I print it out.