You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/01/13 06:50:08 UTC

[GitHub] [avro] opwvhk commented on a change in pull request #1263: AVRO-2123: Duration logical type Java conversion

opwvhk commented on a change in pull request #1263:
URL: https://github.com/apache/avro/pull/1263#discussion_r783670909



##########
File path: lang/java/avro/src/main/java/org/apache/avro/Conversions.java
##########
@@ -146,6 +149,111 @@ private static BigDecimal validate(final LogicalTypes.Decimal decimal, BigDecima
     }
   }
 
+  public static class DurationConversion extends Conversion<Duration> {
+
+      private static final int MONTH_DAYS = 30;

Review comment:
       A month has 28, 29, 30 or 31 days. Hardcoding a single value (31 days/month occurs more often) is basically a bug. Note that this cannot be fixed if we choose to support all possible duration values (see the conversation comments for more info).




-- 
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-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org