Skip to contents

Incremental update of a star database from the star database generated with the new data.

Usage

incremental_refresh(db, sdbu, existing_instances, replace_transformations, ...)

# S3 method for star_database
incremental_refresh(
  db,
  sdbu,
  existing_instances = "ignore",
  replace_transformations = FALSE,
  ...
)

Arguments

db

A star_database object.

sdbu

A star_database_update object.

existing_instances

A string, operation to be carried out on the instances of already existing facts. The possible values are: "ignore", "replace", "group" and "delete".

replace_transformations

A boolean, replace the star_database transformation code with the star_database_update one.

...

internal test parameters.

Value

A star_database object.

Details

There may be data in the update that already exists in the facts: it is indicated what to do with it, replace it, group it, delete it or ignore it in the update.

If to obtain the update data we have had to perform new transformations (which were not necessary to obtain the star database), we can indicate that these are the new transformation operations for the star database. These operations are not applied to the star database, they will only be applied to new periodic updates.

Examples


db <-
  flat_table('ft_num', ft_cause_rpd[ft_cause_rpd$City != 'Cambridge' &
                                      ft_cause_rpd$WEEK != '4',]) |>
  as_star_database(mrs_cause_schema_rpd) |>
  role_playing_dimension(rpd = "When",
                         roles = c("When Available", "When Received"))
f2 <- flat_table('ft_num2', ft_cause_rpd[ft_cause_rpd$City != 'Bridgeport' &
                                           ft_cause_rpd$WEEK != '2',])
f2 <- f2 |>
  update_according_to(db)

db <- db |>
  incremental_refresh(f2)