Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.11.2
Description
The exception is:
Avro.AvroTypeException
HResult=0x80131500
Message=Incorrect number of items written. 1 more required.
Source=Avro
StackTrace:
at Avro.IO.ParsingEncoder.Pop() in C:\code\avro\lang\csharp\src\apache\main\IO\ParsingEncoder.cs:line 135
at Avro.IO.JsonEncoder.WriteArrayEnd() in C:\code\avro\lang\csharp\src\apache\main\IO\JsonEncoder.cs:line 259
at Avro.Generic.PreresolvingDatumWriter`1.WriteArray(WriteItem itemWriter, Object array, Encoder encoder) in C:\code\avro\lang\csharp\src\apache\main\Generic\PreresolvingDatumWriter.cs:line 235
at Avro.Generic.PreresolvingDatumWriter`1.<>c_DisplayClass20_0.<ResolveArray>b_0(Object d, Encoder e) in C:\code\avro\lang\csharp\src\apache\main\Generic\PreresolvingDatumWriter.cs:line 225
at Avro.Specific.SpecificDatumWriter`1.WriteRecordFields(Object recordObj, RecordFieldWriter[] writers, Encoder encoder) in C:\code\avro\lang\csharp\src\apache\main\Specific\SpecificDatumWriter.cs:line 46
at Avro.Generic.PreresolvingDatumWriter`1.<>c_DisplayClass14_0.<ResolveRecord>b_0(Object v, Encoder e) in C:\code\avro\lang\csharp\src\apache\main\Generic\PreresolvingDatumWriter.cs:line 147
at Avro.Generic.PreresolvingDatumWriter`1.Write(T datum, Encoder encoder) in C:\code\avro\lang\csharp\src\apache\main\Generic\PreresolvingDatumWriter.cs:line 52
at Program.<Main>$(String[] args) in C:\code\ips-sales-replication\producer\AvroConsoleApp\Program.cs:line 210
I have cloned the GitHub repo and built the C# solution (Avro.dll) since 1.11.2 with the JsonEncoder has not yet been released as a Nuget package.
A schema with a nested record works fine.
A schema with a nested array of record throws the above exception.
The BinaryEncoder however is able to produce the binary Avro with the same schema.
I have attached the schema.
My code is a simple C# .NET console application.
Program.cs is also attached along with the schema data model that was generated using CodeGen.
Attachments
Attachments
Issue Links
- links to