In some cases I've written rules like this:
@gc.rule(['location.id'], 'location.location_months.location.id')
def location_location_months_location_id(id):
return id
Because this transformation is opaque to graphcore (it sees it as a python function) and so can't optimize across that boundary as in this case:
location.location_months.location.date_of_first_email = <SQLQuery tables:locations; selects:locations.date_of_first_email; where:{} input_mapping:{'id': 'locations.id'}; limit:None; one_column:True; first:True>(location.location_months.location.id)
location.establishment_type.name, location.name, location.establishment_type.id, location.house_state, location.id = <SQLQuery tables:establishment_types, locations; selects:establishment_types.name, locations.name, locations.establishment_type_id, locations.house_state, locations.id; where:{'locations.house_state': 'release', 'establishment_types.id': 'locations.establishment_type_id'} input_mapping:{}; limit:None; one_column:False; first:False>() Cardinality.many
these SQLQueries should be mergable, but since there is this python function inbetween, it can't.
In some cases I've written rules like this:
Because this transformation is opaque to graphcore (it sees it as a python function) and so can't optimize across that boundary as in this case:
these SQLQueries should be mergable, but since there is this python function inbetween, it can't.