JAEJOON LEE created AVRO-2903:
---------------------------------

             Summary: 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


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