KalleOlaviNiemitalo commented on code in PR #1826:
URL: https://github.com/apache/avro/pull/1826#discussion_r945464410
##########
lang/c++/test/unittest.cc:
##########
@@ -452,7 +457,14 @@ struct TestSchema {
customAttributes);
std::string expectedJsonWithCustomAttribute =
"{\"type\": \"record\", \"name\": \"Test\",\"fields\": "
- "[{\"name\": \"f1\", \"type\": \"long\",\"extra field\": \"1\"}]}";
+ "[{\"name\": \"f1\", \"type\": \"long\", "
+ "\"arrayField\": \"[1]\", "
+ "\"booleanField\": \"true\", "
+ "\"mapField\": \"{\\\"key1\\\":\\\"value1\\\",
\\\"key2\\\":\\\"value2\\\"}\", "
+ "\"nullField\": \"null\", "
+ "\"numberField\": \"1.23\", "
+ "\"stringField\": \"\\\"field value with \\\"double quotes\\\"\\\"\""
Review Comment:
I think, minimally, the library should be able to read a schema that
contains custom attributes with arbitrary value types, but not necessarily able
to preserve the values in memory and write them out again. That would help
compatibility with future versions of Avro, e.g. new standard logical types.
If CustomAttributes::attributes returns a reference to a map that contains
the string values, then that makes it harder for a future version of the
library to add support for other types without a breaking change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]