[
https://issues.apache.org/jira/browse/AVRO-2903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17428127#comment-17428127
]
Ryan Skraba commented on AVRO-2903:
-----------------------------------
Ooop – a mistake! I've cherry-picked this into
[branch-1.11|https://github.com/apache/avro/commit/85a49f28dcc292d88c35205a31774c80e8f99875]
which was my original intention. I'll leave it on branch-1.10 just in case
there is ever a 1.10.x release!
> 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
> Assignee: Tim Perkins
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.11.0
>
> Attachments: AVRO-2903.patch
>
> Time Spent: 40m
> 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)