[
https://issues.apache.org/jira/browse/AVRO-2903?focusedWorklogId=663823&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-663823
]
ASF GitHub Bot logged work on AVRO-2903:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Oct/21 00:28
Start Date: 12/Oct/21 00:28
Worklog Time Spent: 10m
Work Description: tjwp opened a new pull request #1364:
URL: https://github.com/apache/avro/pull/1364
This picks up the commit from #935 and adds tests for it.
In addition to testing that a BigDecimal datum is valid for a float or
double, I thought it made sense to verify that the datum would be serialized
correctly.
### Jira
- [x] My PR addresses the following [Avro
Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them
in the PR title. For example, "AVRO-1234: My Avro PR"
- https://issues.apache.org/jira/browse/AVRO-2903
### Tests
- [x] My PR adds the following unit tests __OR__ does not need testing for
this extremely good reason:
### Commits
- [x] My commits all reference Jira issues in their subject lines. In
addition, my commits follow the guidelines from "[How to write a good git
commit message](https://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. Body explains "what" and "why", not "how"
### Documentation
- [x] In case of new functionality, my PR adds documentation that describes
how to use it.
- All the public functions and the classes in the PR contain Javadoc that
explain what it does
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 663823)
Remaining Estimate: 0h
Time Spent: 10m
> Validation error with a default double value
> --------------------------------------------
>
> Key: AVRO-2903
> URL: https://issues.apache.org/jira/browse/AVRO-2903
> Project: Apache Avro
> Issue Type: Bug
> Components: ruby
> Affects Versions: 1.9.2
> Reporter: JAEJOON LEE
> Priority: Major
> Attachments: AVRO-2903.patch
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Hi
> When I use _logstash-codec-avro_schema_registry_,
> the following schema always raises an error for validating default.
> {code:java}
> // json
> {
> "type": "record",
> "name": "RawLog",
> ...
> "fields": [
> {
> "name": "exchangeRate",
> "type": "double",
> "default": 1.0
> },
> ...{code}
>
> This is an error message.
> {code:java}
> Error: Error validating default for exchangeRate: at . expected type double,
> got BigDecimal with value 0.1e1
> Exception: Avro::SchemaParseError
> Stack:
> /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/avro-1.9.2/lib/avro/schema.rb:403:in
> `validate_default!'
> {code}
>
> It seems like the default value treated as BigDecimal, but it should be
> double.
> The plugin code - _logstash-codec-avro_schema_registry_ - ,
> they just simply use avro lib & schema registry,
> hard to find any proper reason why that make a validation error.
>
> If I put the BigDecimal as default value at validate_simple(),
> is it make a sense ?
> Please help me and reviews this patch.
>
> Thanks.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)