Depend on whether max(trans_at) is a measure of cube or not, the problem and the answer will be different.
On Wed, Apr 29, 2015 at 10:43 AM, hongbin ma <[email protected]> wrote: > can you share your cube's definition? you can go to cubes tab, click on the > cube, and get json tab. > > we'd like to help check the definition of your cube > > On Tue, Apr 28, 2015 at 8:01 PM, Huang Hua <[email protected]> > wrote: > > > Hi there, > > > > > > > > We are using kylin 0.6.6, and we found out the max function might not > work > > for negative values in double type. > > > > > > > > The fact table in Hive only has two columns: id and trans_at and contains > > six records as shown below: > > > > Id trans_at > > > > 1, -59.0 > > > > 2, -229.0 > > > > 3, -86.4 > > > > 4, -151.7 > > > > 5, -199.6 > > > > 6, -353.5 > > > > > > > > Then based on the fact table, we created and built a cube with 1 > dimension > > and 3 measures including the default _count_ one: > > > > Dimension: id > > > > Measures: max(trans_at), sum(trans_at), _count_ > > > > > > > > The sql used in query was: select id, MAX(trans_at), SUM(trans_at) from > > the_table group by id, which produced the following output: > > > > > > > > ID,EXPR$1,EXPR$2 > > > > 1, 4.9E-324, -59.0 > > > > 2, 4.9E-324, -229.0 > > > > 3, 4.9E-324, -86.4 > > > > 4, 4.9E-324, -151.7 > > > > 5, 4.9E-324, -199.6 > > > > 6, 4.9E-324, -353.5 > > > > > > > > As you can see, max(trans_at) produced 4.9E-324 for each row which is not > > what we expect to see. > > > > > > > > Best Regards. > > > > Hua > > > > > > > -- > Regards, > > *Bin Mahone | 马洪宾* > Apache Kylin: http://kylin.io > Github: https://github.com/binmahone >
