def execute(self, cursor, state): table = self.table(state) timestamp = self.timestamp(state) entityselection = self.entityselection(state) trend_names = self.trend_names(state) actual_column_names = set(get_column_names(cursor, table)) required_column_names = schema.system_columns_set | set(trend_names) if required_column_names != actual_column_names: return drop_action() try: delete_by_entityselection(cursor, table, timestamp, entityselection) except NoSuchTable: return drop_action()
def execute(self, cursor, state): partition = self.partition(state) trend_names = self.trend_names(state) data_types = self.data_types(state) try: partition.create(cursor) except DuplicateTable: return drop_action() partition.check_columns_exist(trend_names, data_types)(cursor)