[storm] error on ResultSet.count( ) after group_by( )

Eduardo Willians edujurista at gmail.com
Thu Jan 22 17:02:28 GMT 2009


Ok, if this is project decision is ok for me, I thought something was
wrong, and actually I see no reason for that, even with the point you
exposed, but I'm not a geek.

> You later try to group on one column (Ctb.op_id) which I assume is not
> the primary key.  If you have two rows with the same value for op_id
> but different primary keys, then it is ambiguous as to what should be
> returned.

By the way, let me ask. I used group_by( ) because I saw that I would
get the result I want, but reading your explanation seems that
group_by( ) doesn't work for my purpose. Here is the thing:

class Ctb(object):
    __storm_table__ = 'credtb'
    __storm_primary__ = ("op_id", "sequent")
    op_id = Int( )
    sequent = Int( )
    nominal = Float( )
    expiration = Date( )
    spc = Bool( )

result = store.find(Ctb).order_by(Ctb.expiration)

The result has many reapted 'op_id' values. I want filter result to
remain only one value for each 'op_id' and this row must be the lowest
'expiration' by each op_id value.

Is there a technical way to do it?



More information about the storm mailing list