-
- # Since we are querying a table (not a view) ensure that timestamps
- # are converted to ints in the db before being returned
- timestamps = ['time']
- for col in self.columns:
- if col in timestamps:
- if isinstance(self.columns, (list, tuple, set)):
- index = self.columns.index(col)
- self.columns[index] = "CAST(date_part('epoch', events.time) AS bigint) AS time"
- elif isinstance(self.columns, dict):
- type = self.columns.pop(col)
- self.columns["CAST(date_part('epoch', events.time) AS bigint) AS time"] = type
- elif col in [EventObject.primary_key]:
- if isinstance(self.columns, (list, tuple, set)):
- index = self.columns.index(col)
- self.columns[index] = EventObject.table_name+"."+EventObject.primary_key
- elif isinstance(self.columns, dict):
- type = self.columns.pop(col)
- self.columns[EventObject.table_name+"."+EventObject.primary_key] = type
-
- sql = "SELECT %s FROM event_object, events WHERE True" % \