You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "mparry (via GitHub)" <gi...@apache.org> on 2023/06/05 17:11:33 UTC

[GitHub] [avro] mparry commented on a diff in pull request #2270: AVRO-2397: [c++] Added support for type and field aliases

mparry commented on code in PR #2270:
URL: https://github.com/apache/avro/pull/2270#discussion_r1218359413


##########
lang/c++/impl/Compiler.cc:
##########
@@ -263,7 +266,7 @@ static GenericDatum makeGenericDatum(NodePtr n,
 static const std::unordered_set<std::string>& getKnownFields() {
     // return known fields
     static const std::unordered_set<std::string> kKnownFields =
-        {"name", "type", "default", "doc", "size", "logicalType",
+        {"name", "type", "aliases", "default", "doc", "size", "logicalType",

Review Comment:
   As well as being necessary for this change, adding `"aliases"` to this list fixes what is - I would argue - a regression in `master` vs `1.11` where any type or field aliases would now result in an error. This is because the custom attribute handling would not recognise it as a known field and would then try and read a string value. This fails because the `aliases` value is, of course, an array of strings. I don't know if there are any other features in the specification that are currently unsupported and would be affected similarly. I think that you should make this change even if you don't accept the rest of the PR.



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org