Table Name and Base Name
This section explains the difference between the table-related terms used in Fivetran HVR.
Name | Description |
---|---|
Table Name | The name of a table as defined in a HVR replication channel. In HVR channel, the Table Names are lowercase ASCII identifiers, e.g. 'customer1', 'customer2'. |
Base Name | The actual name of a table in a source or target database (without a schema name). In HVR, every table involved in replication will be assigned a Base Name and Table Name. For example, a sales schema contains a customers table. When added to a HVR channel, both the Base Name and Table Name in the channel will be 'customers'. For source and target locations, the Base Name can be overridden using action TableProperties with parameter BaseName. |
Name in Source | The actual name of a table in a source database (Base Name) including a schema name (if supported by a DBMS), e.g. 'sales.customers'. By default, the base table is assumed to be owned by the database username/schema that HVR uses to connect to the database. You can override the schema name using parameter Schema of action TableProperties. |
Name in Target | The actual name of a table in a target database (Base Name) including a schema name (if supported by a DBMS), e.g. 'product.customers'. By default, the base table is assumed to be owned by the database username/schema that HVR uses to connect to the database. You can override the schema name using parameter Schema of action TableProperties. |
Each database table added to a HVR channel is assigned its own unique Table Name and a Base Name (in columns tbl_name and tbl_base_name in the repository table hvr_table ). Typically, the Table Name is same as the Base Name in a source or target database and HVR automatically matches the tables between the source database and the target database. However, if the Table Name is different from the Base Name, then you need to manually map tables between the source and target databases using parameters BaseName and/or Schema of action TableProperties.
The following are the cases when the Table Name may differ from the Base Name:
Different table/schema names
The Base Name of a table is different in the source and target databases, different tables have the same Base Name but have different schemas, or when the same table is replicated into two or more target tables, etc.Table name length
The actual table name (Base Name) in a database may exceed the maximum length allowed by HVR for the Table Name. In this case, HVR will create a truncated Table Name in channel.Special characters in table name
The Base Name may contain special characters that are not supported in HVR. Another example is when a source table name may include various characters, such as Chinese characters, spaces, or special symbols, but a target database imposes certain restrictions for such characters (e.g. Kafka).If the Base Name begins with ii then HVR will prefix a t_ to the Table Name. For example, if the Base Name of a table is ii_mytable, HVR will update the Table Name as t_ii_mytable.
The concept of the Base Name applies also to columns (see BaseName in ColumnProperties).
Parameter BaseName can also be defined for file systems (to change the name of the table in XML tag) or for Salesforce databases (to match the Salesforce API name).
Examples
Table a in a source database is replicated to table b in a target database. In that case, to map the tables, the Table Name in the HVR channel should be the same as the Base Name in the source database, and action TableProperties with parameter BaseName needs to be defined on the target location, as shown below.
Channel | Location | Table | Action | Parameter |
---|---|---|---|---|
mychn | tgt | a | TableProperites | BaseName=b |
An alternative is to define the BaseName parameter on the capture database and have the Table Name the same as the Base Name in the target database.