You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Vivek Kumar (Jira)" <ji...@apache.org> on 2020/07/03 02:24:00 UTC

[jira] [Created] (AVRO-2880) Fix support for double and float default values as "NaN", "Infinity" and "-Infinity"

Vivek Kumar created AVRO-2880:
---------------------------------

             Summary: Fix support for double and float default values as "NaN", "Infinity" and "-Infinity"
                 Key: AVRO-2880
                 URL: https://issues.apache.org/jira/browse/AVRO-2880
             Project: Apache Avro
          Issue Type: Bug
          Components: c++
    Affects Versions: 1.9.2
            Reporter: Vivek Kumar


c++ avro implementation does not support default values of *NaN, Infinity and -Inifinity*. It throws the following exceptions which parsing/compiling the schemas with these default values.

 

When "*NaN"* is given as a default value:
{code:java}
{
    "name": "inval1",
    "type": "double",
    "default": "NaN"
} {code}
Following runtime exception is thrown:
{noformat}
Failed to parse or compile schema: Unexpected type for default value: Expected double, but found string in line 20
 
// corresponding test case
10/11 Testing: AvrogencppTests
10/11 Test: AvrogencppTests
Command: "avro/lang/c++/build/AvrogencppTests"
Directory: avro/lang/c++
"AvrogencppTests" start time: Jul 03 10:02 HKT
Output:
----------------------------------------------------------
Running 5 test cases...
unknown location(0): fatal error in "testEncoding": std::runtime_error: Unexpected type for default value: Expected double, but found string in line 20
unknown location(0): fatal error in "testResolution": std::runtime_error: Unexpected type for default value: Expected double, but found string in line 20  {noformat}
Previously, support has been added for encoding and decoding Nan, Infinity, -Infinity in c++ but not for default values.

https://issues.apache.org/jira/browse/AVRO-2858?focusedCommentId=17148235&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17148235

Related jiras are AVRO-1290, AVRO-972 and AVRO-2858

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)