[ https://issues.apache.org/jira/browse/AVRO-3468?focusedWorklogId=747872&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-747872 ]
ASF GitHub Bot logged work on AVRO-3468: ---------------------------------------- Author: ASF GitHub Bot Created on: 25/Mar/22 16:59 Start Date: 25/Mar/22 16:59 Worklog Time Spent: 10m Work Description: anekdoti commented on a change in pull request #1622: URL: https://github.com/apache/avro/pull/1622#discussion_r835454906 ########## File path: lang/csharp/src/apache/test/Generic/GenericTests.cs ########## @@ -17,28 +17,64 @@ */ using System; using System.IO; -using System.Linq; using Avro.IO; using System.Collections.Generic; +using System.Text; using Avro.Generic; using NUnit.Framework; +using Decoder = Avro.IO.Decoder; +using Encoder = Avro.IO.Encoder; namespace Avro.Test.Generic { class GenericTests { - private static void test<T>(string s, T value) + private static string intToUtf8(int value) { - Stream ms; - Schema ws; - serialize(s, value, out ms, out ws); - Schema rs = Schema.Parse(s); - T output = deserialize<T>(ms, ws, rs); - Assert.AreEqual(value, output); + var decimalLogicalType = new Avro.Util.Decimal(); + var logicalSchema = (LogicalSchema) + Schema.Parse(@"{ ""type"": ""bytes"", ""logicalType"": ""decimal"", ""precision"": 4 }"); + + byte[] byteArray = (byte[])decimalLogicalType.ConvertToBaseValue(new AvroDecimal(value), logicalSchema); Review comment: Thank you for your support! -- 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-unsubscr...@avro.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 747872) Time Spent: 5h 20m (was: 5h 10m) > Default values for logical types not supported > ---------------------------------------------- > > Key: AVRO-3468 > URL: https://issues.apache.org/jira/browse/AVRO-3468 > Project: Apache Avro > Issue Type: Bug > Components: csharp > Affects Versions: 1.11.0 > Reporter: Lucas Heimberg > Priority: Major > Labels: pull-request-available > Time Spent: 5h 20m > Remaining Estimate: 0h > > The C# implementation of Avro does not support default values for logical > types on deserialization. It seems that the method EncodeDefaultValue in > Avro.IO.Resolver is lacking a case for logical types that resorts to the base > schema. -- This message was sent by Atlassian Jira (v8.20.1#820001)