In [PDI-329|http://jira.pentaho.com/browse/PDI-3209] someone asked to provide an example how to use the Dimension Lookup/update step for inserting data into a satellite.
I'm sure it is not the performantest way to insert data into a satellite. So how did I use this step - here an example how to fill an address satellite (sorry, german field names):
* the transformation has access to a variable ${load_to} which contains the timestamp of the load process. This variable is global to the ETL. ${load_to} is used as stream field 'load_dts'.
* run the Dimension Lookup/Update step in "Update the dimension" mode
* the satellite has a technical key called 'id'. A sequence 'postadresse_id_seq' is used to generate values for the technical key.
* the hub id (postadresse_id) is used as lookup value
* we added a 'version' field to the satellite because it is needed by the Dimension Lookup/update step
* the stream field 'load_dts' is used as 'Stream Datefield', 'Date range start field' and as 'Use altenative start date' --> the first entry in the satellite will have the current 'load_dts' as 'load_dts' (not a value in the past like 1900-01-01)
* use 'load_end_dts'
Advantage using Dimensional Lookup/update step:
* reducing steps/complexity for a satellite
Disadvantage:
* Dimension Lookup/Update step inserts a 0 entry in the satellite (all NULL values). Which makes sense for a dimension, but not for a satellite --> NOT NULL constraints not possible
* It is not possible to create an unique index on 'hub id' and 'load_end_dts' because the insert of the new value is done in the following order
** insert new value (so we have 2 rows with the same 'hub id' and 'load_end_dts' = NULL)
** update load_end_dts of previous version
* 'version' field is just here because the Dim. Lookup/Step needs it.
To be honest i haven't looked into the source code of the Dim. Lookup/Update step. We probably have to tweak the index based on how the step works.
kind regards
Max
hmm - somehow i can't find a way to upload an attachment .. any hints how to attach a file?


Reply With Quote

