views:

48

answers:

2

I'm trying to use Storm to create an ORM to an existing MySQL db. I'm trying to create a table Class for one of the tables but I'm getting this error:

storm.exceptions.ClassInfoError: <class 'statsstorm.Aggframe'> has no primary key information

This table has no primary key, or any combination of columns that produce a unique row. It functions more like a log.

How do I create a Storm table class with no primary key?

class Aggframe(Storm):
    """ Storm-based interface to the stats.aggframe table."""

    __storm_table__ = 'aggframe'

    user = Unicode()
    dept = Unicode()
    frame_avg = Float()
+1  A: 

I don't recommend that you create a table without a PK.

If anything, add an IDENTITY column in that table and use as PK.

Raj More
I would agree, but unfortunately, the table was created long ago and I likely won't be able to change it.
Brendan Abel