[
https://issues.apache.org/jira/browse/AVRO-3478?focusedWorklogId=787410&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-787410
]
ASF GitHub Bot logged work on AVRO-3478:
----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Jul/22 15:35
Start Date: 03/Jul/22 15:35
Worklog Time Spent: 10m
Work Description: KalleOlaviNiemitalo commented on code in PR #1630:
URL: https://github.com/apache/avro/pull/1630#discussion_r912503501
##########
lang/csharp/src/apache/test/Util/LogicalTypeTests.cs:
##########
@@ -405,6 +405,52 @@ public void TestTimeMicrosecond(string s, string e, bool
expectRangeError)
}
}
+ [TestCase(0, 0, 0)]
+ [TestCase(0, 0, 1)]
+ [TestCase(0, 1, 0)]
+ [TestCase(0, 1, 1)]
+ [TestCase(1, 0, 0)]
+ [TestCase(1, 0, 1)]
+ [TestCase(1, 1, 0)]
+ [TestCase(1, 1, 1)]
+ [TestCase(999, 9999, 99999)]
+ public void TestDuration(int months, int days, int milliseconds)
+ {
+ var durationSchema = (LogicalSchema)Schema.Parse("{\"type\":
{\"type\": \"fixed\", \"size\": 12, \"name\": \"n\"}, \"logicalType\":
\"duration\"}");
Review Comment:
C++, Java, Python, and Ruby tests for `"type":"fixed"` with `"logicalType"`
don't have nested objects as `"type"`:
<https://github.com/apache/avro/blob/797cec66c4d4b2d4eaf909bfc2a7d98922e2b128/lang/c%2B%2B/test/SchemaTests.cc#L207-L208>
<https://github.com/apache/avro/blob/797cec66c4d4b2d4eaf909bfc2a7d98922e2b128/lang/java/integration-test/codegen-test/src/test/resources/avro/nested_logical_types_union_fixed.avsc#L9-L15>
<https://github.com/apache/avro/blob/797cec66c4d4b2d4eaf909bfc2a7d98922e2b128/lang/py/avro/test/test_io.py#L528-L535>
<https://github.com/apache/avro/blob/797cec66c4d4b2d4eaf909bfc2a7d98922e2b128/lang/ruby/test/test_logical_types.rb#L97>
C# tests, Rust documentation, and Rust tests however have nested objects as
`"type"`:
<https://github.com/apache/avro/blob/797cec66c4d4b2d4eaf909bfc2a7d98922e2b128/lang/csharp/src/apache/test/AvroGen/AvroGenSchemaTests.cs#L162-L171>
<https://github.com/apache/avro/blob/797cec66c4d4b2d4eaf909bfc2a7d98922e2b128/lang/csharp/src/apache/test/AvroGen/AvroGenSchemaTests.cs#L706-L707>
<https://github.com/apache/avro/blob/797cec66c4d4b2d4eaf909bfc2a7d98922e2b128/lang/rust/avro/src/lib.rs#L585-L593>
<https://github.com/apache/avro/blob/797cec66c4d4b2d4eaf909bfc2a7d98922e2b128/lang/rust/avro/src/writer.rs#L692>
Issue Time Tracking
-------------------
Worklog Id: (was: 787410)
Remaining Estimate: 21.5h (was: 21h 40m)
Time Spent: 2.5h (was: 2h 20m)
> Support duration logical type in C#
> -----------------------------------
>
> Key: AVRO-3478
> URL: https://issues.apache.org/jira/browse/AVRO-3478
> Project: Apache Avro
> Issue Type: Improvement
> Components: csharp
> Reporter: Zoltan Csizmadia
> Priority: Minor
> Labels: pull-request-available
> Original Estimate: 24h
> Time Spent: 2.5h
> Remaining Estimate: 21.5h
>
> Support for "duration" logical type
--
This message was sent by Atlassian Jira
(v8.20.10#820010)