Table and Column Name Compression
ON THIS PAGE
Some of the popular Destination systems impose the following limits on the length of table and column names:
|Destination||Table Name Character Limit||Column Name Character Limit|
This means that if the field or object name exceeds the limit set by the Destination, the extra characters are truncated during replication. This can lead to duplicate Destination tables and column names getting created, finally resulting in a replication error.
For example, consider the following nested JSON objects ingested from a MongoDB Source with parsing methods as Flatten structs and split arrays to new events:
For a Postgres Destination, the tables created for these objects would end up having the same name due to the 63 character limit:
To prevent such situations, Hevo uses name compression strategies to derive unique names for the tables and columns.
Name Compression Strategies
The following strategies take into account the different ways in which the Source fields and objects may have been named and try to retain the most relevant information within the specified character limit.
For the sample values below, a limit of 40 characters is assumed to derive the compressed names.
|Name Compression Strategy
(in order of priority)
|Original Name||Compressed Name||Notes|
|Keep the last n characters||
||Useful when words are not separated and the name is a continuous string. This method counts only characters and does not recognize words|
|Abbreviate using first 2 letters only until necessary||
||Useful when words are separated by an _ or a delimiter.|
|Remove words from the beginning||
||Whole words are removed till necessary.|
Scenarios that Trigger Name Compression
The Destination prefix is long. Hevo imposes a limit of 32 characters on the prefix length. As the Destination prefix is not compressed while creating the Destination table, it can lead to the Truncate strategy being applied on the table name.
You have not enabled Merge Tables option. As a result, the Event Type name =
database_name.table_name. This may lead to the character limit getting exceeded.
The Source has JSON data, and the strategy selected for parsing of JSON Events results in generating long table and column names.
The Source supports longer table and column names than the Destination. For example, Source is Amazon Redshift (127 char) and Destination is Postgres (63 char).
Note: Your selection of the Name Sanitization feature may affect the compression strategy being applied to the table name.
Example: Destination Schema with Table Compression
Let us consider:
- Source Type: Amazon Redshift
- Source Database Name:
- Destination Prefix:
- Destination Type: Postgres
- Destination Database Name:
- Sanitize Tables: True
In this scenario, the Destination schema created after table name compression is as follows: