Learn R Programming

rolap (version 2.5.1)

incremental_refresh: Refresh a star database in a constellation

Description

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, ... )

Value

A star_database object.

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.

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.

See Also

star_database

Other star database refresh functions: get_existing_fact_instances(), get_lookup_tables(), get_new_dimension_instances(), get_star_database(), get_star_schema(), get_transformation_code(), get_transformation_file(), update_according_to()

Examples

Run this code

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)

Run the code above in your browser using DataLab