on 2012 Sep 26 3:18 PM
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..
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.