[jira] [Updated] (AVRO-2209) Default value type validation over-zealous

2018-08-11 Thread Darryl Green (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Darryl Green updated AVRO-2209:
---
Description: 
>From the Avro specification re default values (and hence JSON encoding in 
>general):

 
|field default values|
||avro type||json type||example||
|null|null|null|
|boolean|boolean|true|
|int,long|integer|1|
|float,double|number|1.1|
|bytes|string|"\u00FF"|
|string|string|"foo"|
|record|object|{"a": 1}|
|enum|string|"FOO"|
|array|array|[1]|
|map|object|{"a": 1}|
|fixed|string|"\u00ff"|

 

Note that float and double have a "json type" of number (while int, long have a 
"json type" of integer. In JSON an integer is a number that is constrained to 
be an integer. There is no way to deduce from a JSON value that has no 
fractional part whether that value is a number or an integer - it is 
either/both.

I believe that the following schema is, on that basis, valid:

"{ \"name\":\"test\", \"type\": \"record\", \"fields\": [

{\"name\": \"double\",\"type\": \"double\",\"default\" : 2 }

]}",

 We have a substantial body of similar schema in use but have not attempted to 
use C++ to resolve them before - and now this is failing.

 

 

 

  was:
>From the Avro specification re default values (and hence JSON encoding in 
>general):

 
|field default values|
||avro type||json type||example||
|null|null|null|
|boolean|boolean|true|
|int,long|integer|1|
|float,double|number|1.1|
|bytes|string|"\u00FF"|
|string|string|"foo"|
|record|object|{"a": 1}|
|enum|string|"FOO"|
|array|array|[1]|
|map|object|{"a": 1}|
|fixed|string|"\u00ff"|

 

Note that float and double have a "json type" of number (while int, long have a 
"json type" of integer. In JSON an integer is a number that is constrained to 
be an integer. There is no way to deduce from a JSON value that has no 
fractional part whether that value is a number or an integer - it is 
either/both.

I believe that the following schema is, on that basis, valid:

"\{ \"name\":\"test\", \"type\": \"record\", \"fields\": [ {\"name\": 
\"double\",\"type\": \"double\",\"default\" : 2 }]}",

 We have a substantial body of similar schema in use but have not attempted to 
use C++ to resolve them before - and now this is failing.

I can provide a patch/PR that relaxes this rule...



 

 


> Default value type validation over-zealous
> --
>
> Key: AVRO-2209
> URL: https://issues.apache.org/jira/browse/AVRO-2209
> Project: Avro
>  Issue Type: Bug
>  Components: c++
>Affects Versions: 1.8.2
>Reporter: Darryl Green
>Priority: Major
>
> From the Avro specification re default values (and hence JSON encoding in 
> general):
>  
> |field default values|
> ||avro type||json type||example||
> |null|null|null|
> |boolean|boolean|true|
> |int,long|integer|1|
> |float,double|number|1.1|
> |bytes|string|"\u00FF"|
> |string|string|"foo"|
> |record|object|{"a": 1}|
> |enum|string|"FOO"|
> |array|array|[1]|
> |map|object|{"a": 1}|
> |fixed|string|"\u00ff"|
>  
> Note that float and double have a "json type" of number (while int, long have 
> a "json type" of integer. In JSON an integer is a number that is constrained 
> to be an integer. There is no way to deduce from a JSON value that has no 
> fractional part whether that value is a number or an integer - it is 
> either/both.
> I believe that the following schema is, on that basis, valid:
> "{ \"name\":\"test\", \"type\": \"record\", \"fields\": [
> {\"name\": \"double\",\"type\": \"double\",\"default\" : 2 }
> ]}",
>  We have a substantial body of similar schema in use but have not attempted 
> to use C++ to resolve them before - and now this is failing.
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (AVRO-2209) Default value type validation over-zealous

2018-08-11 Thread Darryl Green (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Darryl Green updated AVRO-2209:
---
Description: 
>From the Avro specification re default values (and hence JSON encoding in 
>general):

 
|field default values|
||avro type||json type||example||
|null|null|null|
|boolean|boolean|true|
|int,long|integer|1|
|float,double|number|1.1|
|bytes|string|"\u00FF"|
|string|string|"foo"|
|record|object|{"a": 1}|
|enum|string|"FOO"|
|array|array|[1]|
|map|object|{"a": 1}|
|fixed|string|"\u00ff"|

 

Note that float and double have a "json type" of number (while int, long have a 
"json type" of integer. In JSON an integer is a number that is constrained to 
be an integer. There is no way to deduce from a JSON value that has no 
fractional part whether that value is a number or an integer - it is 
either/both.

I believe that the following schema is, on that basis, valid:

"{ \"name\":\"test\", \"type\": \"record\", \"fields\": [

{\"name\": \"double\",\"type\": \"double\",\"default\" : 2 }

]}",

 We have a substantial body of similar schema in use but have not attempted to 
use C++ to resolve them before - and now this is failing.

 Fix is reasonably straight forward - PR with tests:

[https://github.com/apache/avro/pull/326]

 

 

 

  was:
>From the Avro specification re default values (and hence JSON encoding in 
>general):

 
|field default values|
||avro type||json type||example||
|null|null|null|
|boolean|boolean|true|
|int,long|integer|1|
|float,double|number|1.1|
|bytes|string|"\u00FF"|
|string|string|"foo"|
|record|object|{"a": 1}|
|enum|string|"FOO"|
|array|array|[1]|
|map|object|{"a": 1}|
|fixed|string|"\u00ff"|

 

Note that float and double have a "json type" of number (while int, long have a 
"json type" of integer. In JSON an integer is a number that is constrained to 
be an integer. There is no way to deduce from a JSON value that has no 
fractional part whether that value is a number or an integer - it is 
either/both.

I believe that the following schema is, on that basis, valid:

"{ \"name\":\"test\", \"type\": \"record\", \"fields\": [

{\"name\": \"double\",\"type\": \"double\",\"default\" : 2 }

]}",

 We have a substantial body of similar schema in use but have not attempted to 
use C++ to resolve them before - and now this is failing.

 

 

 


> Default value type validation over-zealous
> --
>
> Key: AVRO-2209
> URL: https://issues.apache.org/jira/browse/AVRO-2209
> Project: Avro
>  Issue Type: Bug
>  Components: c++
>Affects Versions: 1.8.2
>Reporter: Darryl Green
>Priority: Major
>
> From the Avro specification re default values (and hence JSON encoding in 
> general):
>  
> |field default values|
> ||avro type||json type||example||
> |null|null|null|
> |boolean|boolean|true|
> |int,long|integer|1|
> |float,double|number|1.1|
> |bytes|string|"\u00FF"|
> |string|string|"foo"|
> |record|object|{"a": 1}|
> |enum|string|"FOO"|
> |array|array|[1]|
> |map|object|{"a": 1}|
> |fixed|string|"\u00ff"|
>  
> Note that float and double have a "json type" of number (while int, long have 
> a "json type" of integer. In JSON an integer is a number that is constrained 
> to be an integer. There is no way to deduce from a JSON value that has no 
> fractional part whether that value is a number or an integer - it is 
> either/both.
> I believe that the following schema is, on that basis, valid:
> "{ \"name\":\"test\", \"type\": \"record\", \"fields\": [
> {\"name\": \"double\",\"type\": \"double\",\"default\" : 2 }
> ]}",
>  We have a substantial body of similar schema in use but have not attempted 
> to use C++ to resolve them before - and now this is failing.
>  Fix is reasonably straight forward - PR with tests:
> [https://github.com/apache/avro/pull/326]
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (AVRO-2209) Default value type validation over-zealous

2018-10-02 Thread Thiruvalluvan M. G. (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thiruvalluvan M. G. updated AVRO-2209:
--
Status: Patch Available  (was: Open)

> Default value type validation over-zealous
> --
>
> Key: AVRO-2209
> URL: https://issues.apache.org/jira/browse/AVRO-2209
> Project: Avro
>  Issue Type: Bug
>  Components: c++
>Affects Versions: 1.8.2
>Reporter: Darryl Green
>Priority: Major
>
> From the Avro specification re default values (and hence JSON encoding in 
> general):
>  
> |field default values|
> ||avro type||json type||example||
> |null|null|null|
> |boolean|boolean|true|
> |int,long|integer|1|
> |float,double|number|1.1|
> |bytes|string|"\u00FF"|
> |string|string|"foo"|
> |record|object|{"a": 1}|
> |enum|string|"FOO"|
> |array|array|[1]|
> |map|object|{"a": 1}|
> |fixed|string|"\u00ff"|
>  
> Note that float and double have a "json type" of number (while int, long have 
> a "json type" of integer. In JSON an integer is a number that is constrained 
> to be an integer. There is no way to deduce from a JSON value that has no 
> fractional part whether that value is a number or an integer - it is 
> either/both.
> I believe that the following schema is, on that basis, valid:
> "{ \"name\":\"test\", \"type\": \"record\", \"fields\": [
> {\"name\": \"double\",\"type\": \"double\",\"default\" : 2 }
> ]}",
>  We have a substantial body of similar schema in use but have not attempted 
> to use C++ to resolve them before - and now this is failing.
>  Fix is reasonably straight forward - PR with tests:
> [https://github.com/apache/avro/pull/326]
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (AVRO-2209) Default value type validation over-zealous

2018-10-03 Thread Thiruvalluvan M. G. (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thiruvalluvan M. G. updated AVRO-2209:
--
Resolution: Fixed
Status: Resolved  (was: Patch Available)

Pull request merged.

> Default value type validation over-zealous
> --
>
> Key: AVRO-2209
> URL: https://issues.apache.org/jira/browse/AVRO-2209
> Project: Avro
>  Issue Type: Bug
>  Components: c++
>Affects Versions: 1.8.2
>Reporter: Darryl Green
>Assignee: Darryl Green
>Priority: Major
>
> From the Avro specification re default values (and hence JSON encoding in 
> general):
>  
> |field default values|
> ||avro type||json type||example||
> |null|null|null|
> |boolean|boolean|true|
> |int,long|integer|1|
> |float,double|number|1.1|
> |bytes|string|"\u00FF"|
> |string|string|"foo"|
> |record|object|{"a": 1}|
> |enum|string|"FOO"|
> |array|array|[1]|
> |map|object|{"a": 1}|
> |fixed|string|"\u00ff"|
>  
> Note that float and double have a "json type" of number (while int, long have 
> a "json type" of integer. In JSON an integer is a number that is constrained 
> to be an integer. There is no way to deduce from a JSON value that has no 
> fractional part whether that value is a number or an integer - it is 
> either/both.
> I believe that the following schema is, on that basis, valid:
> "{ \"name\":\"test\", \"type\": \"record\", \"fields\": [
> {\"name\": \"double\",\"type\": \"double\",\"default\" : 2 }
> ]}",
>  We have a substantial body of similar schema in use but have not attempted 
> to use C++ to resolve them before - and now this is failing.
>  Fix is reasonably straight forward - PR with tests:
> [https://github.com/apache/avro/pull/326]
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (AVRO-2209) Default value type validation over-zealous

2018-12-28 Thread Thiruvalluvan M. G. (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thiruvalluvan M. G. updated AVRO-2209:
--
Fix Version/s: 1.9.0

> Default value type validation over-zealous
> --
>
> Key: AVRO-2209
> URL: https://issues.apache.org/jira/browse/AVRO-2209
> Project: Apache Avro
>  Issue Type: Bug
>  Components: c++
>Affects Versions: 1.8.2
>Reporter: Darryl Green
>Assignee: Darryl Green
>Priority: Major
> Fix For: 1.9.0
>
>
> From the Avro specification re default values (and hence JSON encoding in 
> general):
>  
> |field default values|
> ||avro type||json type||example||
> |null|null|null|
> |boolean|boolean|true|
> |int,long|integer|1|
> |float,double|number|1.1|
> |bytes|string|"\u00FF"|
> |string|string|"foo"|
> |record|object|{"a": 1}|
> |enum|string|"FOO"|
> |array|array|[1]|
> |map|object|{"a": 1}|
> |fixed|string|"\u00ff"|
>  
> Note that float and double have a "json type" of number (while int, long have 
> a "json type" of integer. In JSON an integer is a number that is constrained 
> to be an integer. There is no way to deduce from a JSON value that has no 
> fractional part whether that value is a number or an integer - it is 
> either/both.
> I believe that the following schema is, on that basis, valid:
> "{ \"name\":\"test\", \"type\": \"record\", \"fields\": [
> {\"name\": \"double\",\"type\": \"double\",\"default\" : 2 }
> ]}",
>  We have a substantial body of similar schema in use but have not attempted 
> to use C++ to resolve them before - and now this is failing.
>  Fix is reasonably straight forward - PR with tests:
> [https://github.com/apache/avro/pull/326]
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)