Opened 6 years ago

Closed 6 years ago

#1967 closed defect (fixed)

Rasql_Support parsing NaN as nodata

Reported by: Bang Pham Huu Owned by: Dimitar Misev
Priority: major Milestone: 10.0
Component: rasql Version:
Keywords: Cc: Vlad Merticariu
Complexity: Medium

Description

test_float_4d comes from wcst_import system test and it has 'NaN' as null values:

variables:
	float value(i, j, k, m) ;
		value:missing_value = "NaNf" ;

However, 'NaN' cannot be parsed in rasql "nodata" as number.

[INFO] - 2019-01-21 13:13:43,333: Request: 'SELECT encode(SCALE(c[0,0,0:39,-20:19], [0:10,-2:-1]), "csv" , "{\"nodata\": [NaN]}") from test_float_4d as c'... parsing... checking semantics... evaluating... [ERROR] - 2019-01-21 13:13:43,334, conversion/formatparams.cc:66: failed parsing the JSON format options: * Line 1, Column 13
  Syntax error: value, object or array expected.

[ERROR] - 2019-01-21 13:13:43,334, conversion/formatparams.cc:67: original options string: '{\"nodata\": [NaN]}'. 

Change History (3)

comment:1 by Dimitar Misev, 6 years ago

Problem is that the json parser used in rasdaman can't parse this.

comment:2 by Dimitar Misev, 6 years ago

It's possible to parse it actually by setting an allowSpecialFloats setting. So these are be possible:

Constant Type
NaN double
NaNf float
Infinity double
-Infinity double

Important: they are case-sensitive, e.g. nan will not work, only NaN.

comment:3 by Dimitar Misev, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.