Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avro1363 C# union schema can now contain multiple entries with the same name and different namespace #131

Merged
merged 11 commits into from
Dec 3, 2018

Conversation

Simon24601
Copy link
Contributor

When processing a UnionSchema, we store a list of all the names that have already been processed. In Java, the fully-resolved names are used (including namespaces), while in C# only the simple name was used. This means that a UnionSchema cannot contain multiple entries with the same name and different namespaces.

I've fixed this by making the code more like the Java, i.e. adding a Fullname method to the base Schema class, and using this when processing the UnionSchema.

I have not checked for the same issue in other languages.

@Simon24601
Copy link
Contributor Author

Is there anyone in the Avro C# community who can review (and accept) this pull request?

@rdblue
Copy link
Contributor

rdblue commented Oct 31, 2016

This looks reasonable to me. @jcustenborder, what do you think?

Copy link

@jcustenborder jcustenborder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdblue I'll look at it. I only see one nit.

@@ -52,7 +52,7 @@ public string Namespace
/// <summary>
/// Namespace.Name of the schema
/// </summary>
public string Fullname
public override string Fullname

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the override?

@Simon24601
Copy link
Contributor Author

@jcustenborder: I've added a virtual Fullname method in the base Schema.cs
class, and wanted to be explicit that it is being overridden to provide
different behaviour. Schema doesn't really have a namespace and can't
distinguish between a Fullname and a Name, while NamedSchema can
distinguish these, so the implementation is richer.

In the UnionSchema parser that I was trying to fix, I needed to make use of
the Fullname to make sure different namespaces are properly separated.
Since we just have a base class Schema in the parser, I needed a virtual
function to make sure the appropriate code was used.

On Fri, Nov 4, 2016 at 8:19 PM, Jeremy Custenborder <
[email protected]> wrote:

@jcustenborder commented on this pull request.

@rdblue https://github.com/rdblue I'll look at it. I only see one nit.

In lang/csharp/src/apache/main/Schema/NamedSchema.cs
#131 (review):

@@ -52,7 +52,7 @@ public string Namespace
///

     /// Namespace.Name of the schema
     /// </summary>
  •    public string Fullname
    
  •    public override string Fullname
    

Why the override?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#131 (review), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AIUPmo7FVyZ0QpGHwa6e-P0uesmu7AAnks5q65NSgaJpZM4KHGnD
.

@rdblue
Copy link
Contributor

rdblue commented Nov 5, 2016

This doesn't apply cleanly to master (I checked out and tried to rebase). @Simon24601, could you please rebase on master and squash these commits? Thanks!

@jcustenborder, does this look about ready to go in? It sounds like your concern was addressed.

@jcustenborder
Copy link

@rdblue Looks good to me.

@Simon24601 Simon24601 mentioned this pull request Nov 11, 2016
@iemejia iemejia added the C# label Nov 29, 2018
@dkulp dkulp merged commit b5bec5c into apache:master Dec 3, 2018
iemejia pushed a commit that referenced this pull request Jun 11, 2021
By bringing in `cargo-readme` the canonical source for README.md documentation
will be the library documentation, also shown in docs.rs.

This commit moves some documentation only in the README into `src/lib.rs` and
therefore docs.rs also gets a good update.

The downside to this is that there's yet another tool being depended upon and a
new template file `README.tpl`. All in all a minor downside I think.
SingingBush pushed a commit to SingingBush/avro that referenced this pull request Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants