[ 
https://issues.apache.org/jira/browse/AVRO-2903?focusedWorklogId=663824&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-663824
 ]

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 commented on pull request #935:
URL: https://github.com/apache/avro/pull/935#issuecomment-940558027


   I've opened a new PR #1364 with a test.


-- 
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: 663824)
    Time Spent: 20m  (was: 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
>              Labels: pull-request-available
>         Attachments: AVRO-2903.patch
>
>          Time Spent: 20m
>  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)

Reply via email to