cancel
Showing results for 
Search instead for 
Did you mean: 

Cap Java: Scientific notation on average request

08-31-2021 10:48 AM
fjcv Explorer
783 views 0 comments
SAP Managed Tags
Subscribe

Hello all.

We are working on a java cap service, with several entity and fields. Between them, a decimal one called totalValue.

As a resume:

entity item: managed{
	totalValue: Decimal;
	symbol: String(10);
	group: String(512);
	groupDescription: String(512);
	key fatherID: UUID;
	...
}

As long as we request the element by key, or by filter, everything seems to work fine, even if it is the failing Id, so, data seems to be ok

item?$filter=fatherID eq failingId

{"value": [ { 
	"createdAt": "2021-08-23T09:40:14.161Z", 
	"createdBy": "anonymous",
	"totalValue": 15200, 
	... 
	}, 
	{...} 
	] 
}

When doing a group by, using another id, query work fine, so query seems to be also ok.

item?$filter=fatherID eq value&$apply=groupby((group,groupDescription,fatherID,symbol), aggregate(totalValue with sum as TotalValue))

{ "value": [ { 
	"group": "AE51", 
	"groupDescription": "Baterías", 
	"symbol": "€", 
	"fatherID": "value", 
	"TotalValue": 3170.03 
	},
	 {...} 
	] 
}

But it have a problem with sumatory when grouping by in some cases

item?$filter=fatherID eq failingId&$apply=groupby((group,groupDescription,fatherID,symbol), aggregate(totalValue with sum as TotalValue))

{
 "error": {
 "code": "50008002",
 "message": "Failed to serialize response payload"
 }
}

This is an extract from error log:

2021-08-31T07:41:01.970+0000 [APP/PROC/WEB/0] OUT Caused by: org.apache.olingo.server.api.serializer.SerializerException: Wrong value for property ''!

...

2021-08-31T07:41:01.970+0000 [APP/PROC/WEB/0] OUT Caused by: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The value '1.52E+4' does not match the facets' constraints.

'1.52E+4' -> 15200

After changing this value in database to 15200,01 everything start to work.

I researched that this is a failure solved around olingo 4.3, but no matter how much i change dependency versions, failure remains.

Part of maven i've changed to try, both of them failed

<properties>
  <revision>1.0.0-SNAPSHOT</revision>
  <jdk.version>1.8</jdk.version>
  <cds.services.version>1.17.0</cds.services.version>
  <spring.boot.version>2.3.4.RELEASE</spring.boot.version>
  <node.url>https://nodejs.org/dist/</node.url>
</properties>
<properties>
  <revision>1.0.0-SNAPSHOT</revision>
  <jdk.version>1.8</jdk.version>
  <cds.services.version>1.17.0</cds.services.version>
  <spring.boot.version>2.3.4.RELEASE</spring.boot.version>
  <cdsdk.version>^4</cdsdk.version>
  <node.version>v12.20.0</node.version>
  <node.url>https://nodejs.org/dist/</node.url>
</properties>

So, why there is a scientific notation number failure?

Why it gives this format?

There is something misconfigured?

Thanks in advance.

Best regards

Accepted Solutions (0)

Answers (0)