Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
844 B
1
Indexable
Never
class hos_cart_details_by_status(db.Model):
    __keyspace__ = 'hobs_ods_staging'
    hoscd_status = db.columns.Text(primary_key=True)
    hoscd_event_date = db.columns.Date(primary_key=True)
    hoscd_businessid = db.columns.Text(primary_key=True)
    hoscd_key = db.columns.Text(primary_key=True)
    # ... other columns ...

    def __json__(self):
        results = serializetojson(self)
        return results





CREATE MATERIALIZED VIEW hobs_ods_staging.hos_cart_details_by_status AS
    SELECT *
    FROM hobs_ods_staging.hos_cart_details
    WHERE hoscd_status IS NOT NULL AND hoscd_event_date IS NOT NULL AND hoscd_businessid IS NOT NULL AND hoscd_key IS NOT NULL
    PRIMARY KEY (hoscd_status, hoscd_event_date, hoscd_businessid, hoscd_key)
    WITH CLUSTERING ORDER BY (hoscd_event_date ASC, hoscd_businessid ASC, hoscd_key ASC);