Refresh and Compare Contexts
A Context is a toggle which can turn an action on or off during Refresh and Compare.
For example, in the source location, a table has separate columns for the street name and the house number. You want the target table to have a single address field. Combining columns would be efficient during Integrate, but very slow during Refresh or Compare. To solve this, add the address column to the table definition in Fivetran HVR, and then define the following actions:
Table | Action | Parameter(s) |
---|---|---|
Source Table | ColumnProperties | Name="address"Absent |
Source Table | ColumnProperties | Name="address"CaptureExpression="{house_number} || ' ' || {street_name}" Context="bulk" |
Target Table | ColumnProperties | Name="address" IntegrateExpression="{house_number} || ' ' || {street_name}" Context="!bulk" |
Now run Refresh or Compare with Context.
- In UI, click Refresh Data or Compare Data, scroll down to the Contexts section and select bulk from the list.
- In CLI, run the hvrrefresh or hvrcompare command with option
-Cbulk
.
When the Refresh or Compare job runs, the target table will include two address columns (one with house number, one with street name). And when you run Integrate, the target table will contain a single address column.
Make sure to add a separate action with the Absent parameter selected. In this way, Absent lets HVR know that the address column does not exist in the source table when Context is both on and off.
Context Naming Rules
The following restrictions are applied to context names:
Context name cannot exceed 12 characters.
Context name can only start with an alphabetic character or underscore, followed by an alphanumeric character or underscore.
Only lowercase is permitted. If Caps Lock is on, it will not allow you to type in this field.
Context name must not begin with a number.
Examples of valid context names: _1234abcd, _abcd1234, abcd_1234, abcd1234_, _abcd1234_
Actions with Context
Following are the actions that support the Context parameter: