Re: [protobuf] Maps and append-as-merge; expectation clarification please

2017-06-30 Thread 'Jisi Liu' via Protocol Buffers
Yes. It will replace the value with the same key.

On Sat, Jun 24, 2017 at 11:08 AM Marc Gravell 
wrote:

> Basically, if I have
>
> message Foo {
> int32 x = 1;
> int32 y = 2;
> }
> message Bar {
> map items = 1;
> }
>
> And I serialize 2 fragments appended:
>
> items = { 1: { x: 123 } }
>
> and (as the second appended chunk)
>
> items = { 1: { y: 456 } }
>
> And now I deserialize the entire chunk; is the map item with key 1:
>
> - { x: 123, y: 456 }, or
> - { y: 456 }, or
> - something else
>
> Or to put it another way: are message-based map items merged or strictly
> replaced?
>
> My understanding based on the docs is "replaced", so { y: 456 } - but: can
> I get a confirmation on this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Maps and append-as-merge; expectation clarification please

2017-06-24 Thread Marc Gravell
Basically, if I have

message Foo {
int32 x = 1;
int32 y = 2;
}
message Bar {
map items = 1;
}

And I serialize 2 fragments appended:

items = { 1: { x: 123 } }

and (as the second appended chunk)

items = { 1: { y: 456 } }

And now I deserialize the entire chunk; is the map item with key 1:

- { x: 123, y: 456 }, or
- { y: 456 }, or
- something else

Or to put it another way: are message-based map items merged or strictly
replaced?

My understanding based on the docs is "replaced", so { y: 456 } - but: can
I get a confirmation on this?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.