Re: how to configure not using Utf8 in avro-maven-plugin generate-sources

2021-06-23 Thread Martin Mucha
>> https://issues.apache.org/jira/browse/AVRO-2702 >> >> this should be solved in 1.10 (which it is not, incorrect code is still >> generated). And if someone (like myself) is bound to 1.9.2 because of >> confluent, there is no fix for this minor version branch

Re: how to configure not using Utf8 in avro-maven-plugin generate-sources

2021-06-21 Thread Martin Mucha
, which is just awesome. po 21. 6. 2021 v 11:17 odesílatel Martin Mucha napsal: > It seems, that transition 1.8.2->1.9.2 brings backwards incomatibility and > > > String > > which did work to change generation from CharSequence to String, does not > work any

how to configure not using Utf8 in avro-maven-plugin generate-sources

2021-06-21 Thread Martin Mucha
It seems, that transition 1.8.2->1.9.2 brings backwards incomatibility and String which did work to change generation from CharSequence to String, does not work any more. Within 15 minutes search I'm not unable to find literary any documentation of this plugin, so I don't know if

Re: Recomended naming of types to support for schema evolution

2020-01-01 Thread Martin Mucha
ve fields from the schemas without > having to coordinate deploys and juggle iron-clad contract interchange > formats. It's not meant for wild rewrites of the contract IDLs on active > running services! > > All the best for 2020, anyone else who happens to be reading mailing list > email

Re: Recomended naming of types to support for schema evolution

2019-12-30 Thread Martin Mucha
ley > http://lee.hambley.name/ > +49 (0) 170 298 5667 > > > On Mon, 30 Dec 2019 at 17:26, Martin Mucha wrote: > >> Hi, >> I'm relatively new to avro, and I'm still struggling with getting schema >> evolution and related issues. But today it should be simple

Recomended naming of types to support for schema evolution

2019-12-30 Thread Martin Mucha
Hi, I'm relatively new to avro, and I'm still struggling with getting schema evolution and related issues. But today it should be simple question. What is recommended naming of types if we want to use schema evolution? Should namespace contain some information about version of schema? Or should

schema evolution with top-level union.

2019-11-14 Thread Martin Mucha
Hi, I encounter weird behavior and have no idea how to fix that. Any suggestions welcomed. The issue revolves around union type on top level, which I personally dislike and consider to be hack, but I understand the motivation behind it: someone wanted to declare N types withing single avsc file

Re: AVRO schema evolution: adding optional column with default fails deserialization

2019-08-01 Thread Martin Mucha
ase (a kafka topic) if I remember right. Loose that database and you > cannot read your kafka topics. > > So you have to use some other encoder, homegrown or not that embeds either > the full schema in every message (expensive) of some id. Does this make > sense? > > /svante &

Re: AVRO schema evolution: adding optional column with default fails deserialization

2019-08-01 Thread Martin Mucha
byte) to the binary avro. Thus using the schema registry again > you can get the writer schema. > > /Svante > > On Thu, Aug 1, 2019, 15:30 Martin Mucha wrote: > >> Hi, >> >> just one more question, not strictly related to the subject. >> >> Initially

Re: AVRO schema evolution: adding optional column with default fails deserialization

2019-08-01 Thread Martin Mucha
the record. I really do not know how to do that, I'm pretty sure I never saw this anywhere, and I cannot find it anywhere. But in principle it must be possible, since reader need not necessarily have any control of which schema writer used. thanks a lot. M. út 30. 7. 2019 v 18:16 odesílatel Martin Mucha

Re: AVRO schema evolution: adding optional column with default fails deserialization

2019-07-30 Thread Martin Mucha
Reader<>(Simple.getClassSchema(), > SimpleV2.getClassSchema()); > Decoder decoder = DecoderFactory.get().binaryDecoder(v1AsBytes, null); > SimpleV2 v2 = datumReader.read(null, decoder); > > assertThat(v2.getId(), is(1)); > assertThat(v2.getName(), is(new U

Re: AVRO schema evolution: adding optional column with default fails deserialization

2019-07-30 Thread Martin Mucha
nput, just when a field > is known to be in the reader schema but missing from the original > writer. > > You may have more luck reading the GenericRecord with a > GenericDatumReader with both schemas, and using the > `convertToJson(record)`. > > I hope this is useful

Re: is it possible to deserialize JSON with optional field?

2019-04-16 Thread Martin Mucha
as napsal: > It is possible to do it with a custom JsonDecoder. > > I wrote one that does this at: > https://github.com/zolyfarkas/avro/blob/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ExtendedJsonDecoder.java > > > hope it helps. > > > —Z > > On

is it possible to deserialize JSON with optional field?

2019-04-13 Thread Martin Mucha
Hi, is it possible by design to deserialize JSON with schema having optional value? Schema: { "type" : "record", "name" : "UserSessionEvent", "namespace" : "events", "fields" : [ { "name" : "username", "type" : "string" }, { "name" : "errorData", "type" : [ "null", "string" ],

Re: how to do non-optional field in nested object?

2017-11-27 Thread Martin Mucha
ore.) > > So, right now, even the top level is failing the spec: > > IV) valid (0 ARecords): > { } > > V) valid (2 ARecords): > { > "id": "...", > "B": { > "C": "..." > } > } , > "id": ".

Re: how to do non-optional field in nested object?

2017-11-27 Thread Martin Mucha
quot;fields": [ > { "name": "B", "type": "string" }, > { "name": "C", "type": "string" } > ] > } > } > ] > } > > This gives me 0 or more ARecord

Re: how to do non-optional field in nested object?

2017-11-27 Thread Martin Mucha
ng" } ] } } ] } does not require C. And that's not what I want ... I'd like optional B, and once user provide B, then B.C is required. Martin. 2017-11-27 15:06 GMT+01:00 Dan Schmitt <dan.schm...@gmail.com>: > "name": "B", > &

how to do non-optional field in nested object?

2017-11-27 Thread Martin Mucha
Hi, I have this avro schema: { "name" : "ARecord", "type" : "record", "namespace" : "A", "fields" : [ {"name": "id", "type": "string" }, { "name": "B", "type": ["null", { "type": "record", "name": "BRecord", "fields": [ {