[
https://issues.apache.org/jira/browse/AVRO-2075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16717721#comment-16717721
]
ASF GitHub Bot commented on AVRO-2075:
--------------------------------------
epkanol commented on issue #246: AVRO-2075: Add option to report possible data
loss in SchemaCompatibi…
URL: https://github.com/apache/avro/pull/246#issuecomment-446309912
Ping @dkulp , thanks for pointing this out - I had forgotten about this PR,
I will take a look as soon as time permits (most likely this week, or at the
latest next). It was some time since I did Avro contributions, though, so there
will be some initial set-up (e.g. formatting issues - I have a new environment
now...)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Allow SchemaCompatibility to report possibly lossy conversions
> --------------------------------------------------------------
>
> Key: AVRO-2075
> URL: https://issues.apache.org/jira/browse/AVRO-2075
> Project: Apache Avro
> Issue Type: Improvement
> Affects Versions: 1.7.7, 1.8.2
> Environment: Java
> Reporter: Anders Sundelin
> Assignee: Anders Sundelin
> Priority: Minor
> Attachments:
> 0001-AVRO-2075-Add-option-to-report-possible-data-loss-in.patch
>
>
> It is stated in the Avro spec that int and long values are promotable to
> floats and doubles.
> However, numeric promotions to floats are lossy (losing precision), as is
> long promotion to double.
> It is suggested that the SchemaCompatibility class is updated to be able to
> flag conversions that have the possibility to be lossy as errors. The
> attached patch does just that, by adding a new boolean flag (allowDataLoss),
> preserving backwards compatibility by defaulting this flag to true.
> Testcases illustrating the problem has been added to the unit test class
> TestReadingWritingDataInEvolvedSchemas
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)