cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

[314]: numeric overflow ?

Former Member
0 Likes
26,315

Hi,

I try to understand ...

I want to aggregate some values, but i've got this error message :

[314]: numeric overflow: search table error:  [6944] AttributeEngine: overflow in numeric calculation;JEAggregate pop1(setIndex('TEST:F_EXPORT','en'),setAttribute('MT_VALEUR'),setAggregationTypes(1))

SQL is :

SQL

select

cd_pays,sum(mt_valeur)

from

f_export

group

by cd_pays

I work with AWS

max() returns values..

View Entire Topic
Former Member
0 Likes

Hi Juergen, Ferry

You're right Ferry, it's ok with to_double()

The max value is 69 943 708 731 and column is integer.

But it looks strange, Juergen's example is ok too on my side

I share Juergen's point of view, it looks like a bug ...

My AWS's version is 1.00.28.361821

Thanks

Stéphane

Former Member
0 Likes

Hi Stéphane,

Obviously I used a stupid example - I'm quite sure that internally HANA will use a larger data type for tinyint, so the overflow doesn't happen. With integer, I get the numeric overflow. To keep data conversion as cheap as possible, I would cast to the next-bigger integer type which is bigint:

drop table foobar cascade;

create column table foobar(

  foo varchar(1),

  bar integer

);

insert into foobar values('A',2147483647);

insert into foobar values('A',200);

; does not work:

select foo,sum(bar) from foobar group by foo;

; works:

select foo,sum(to_bigint(bar)) from foobar group by foo;

--juergen