CQL implementation doesn't handle large numbers

Description

Hi Russell,

We are currently using the geotools library to parse queries to our geological unit web service. We use the CQL libraries shipped with Geotools for this.

We came across an issue with the CQL classes when we try to parse a query with a number which has 16 digits. For example if we try to parse something like

Gmlid = 123456789012345

Using CQL.toFilter () it fails with the following exception. I assume this is happening because geotools library is trying to store this large number as an integer. This is a very critical issue for our system as we use these large number every where in our systems as ids.

Exception in thread "main" java.lang.NumberFormatException: For input string: "123456789012345"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at org.geotools.filter.text.commons.AbstractFilterBuilder.buildLiteralInteger(AbstractFilterBuilder.java:369)
at

Regards

Anuruddha

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Russell,

it looks to me like an implementation limitation in the CQL parser. Much
of this is autogenerated so it should be straightforward to fix.

The database drivers and filter implementation support Java Long. There
is no reason of which I am aware for the CQL implementation to not
support at least Long. BigInteger will cause more trouble, but Long will
give you 18 digits.

The XSD spec requires a minimum of 18 digit support.
http://www.w3.org/TR/xmlschema-2/#decimal - http://www.w3.org/TR/xmlschema-2/#decimal

Kind regards,
Ben.

------------------------------------------------------------------------------------------------------------------------------------------------ Could the code please be changed to handle at least Longs? This would be big enough for Anuruddha.

Environment

None

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Fix versions

Affects versions

Priority

Medium
Configure