Hash Group Size (Model Object)
Applies to
Platform: Oracle
Architecture: Data Store · Data Vault · Data Mart
Hash Group Size (HashGroupSize) splits the row hash of an Oracle model object into group hashes, so that each hash input stays below the Oracle limit. Use it on wide objects whose load fails with ORA-01489.
Supported objects
Set it in Edit Model Object, Hashing group, on these model object types:
- Data Vault: Satellite, Link Satellite, Multi-Active Satellite, Business Satellite, Business Link Satellite, Reference Table
- Data Store: Store Entity
- Data Mart: Mart Dimension
Values and default
- Empty (default): no grouping.
- A whole number from 1: the terms per group.
Other values stop the generation of the object with the validation error Model object has non numeric hash group size configured. or Model object has hash group size smaller than 1 configured.
Effect on generated output
- Only the row hashes BG_RowHash, BG_RowHashScd1 and BG_RowHashScd2 are grouped. Key hashes such as Hub_HK are never grouped.
- The terms are split in term order into groups of the given size; the last group holds the rest.
- The row hash is
STANDARD_HASHover the group hashes, joined with the Hash Concatenation Separator. All hashes use the project Hash Algorithm. - A hash with no more terms than the group size has no groups. BG_RowHashScd1 and BG_RowHashScd2 are decided separately.
Term values are prepared as in How biGENIUS-X builds hash values.
Choose the group size
Oracle stops a hash with ORA-01489: result of string concatenation is too long when its input exceeds the maximum string length: 4,000 bytes with MAX_STRING_SIZE = STANDARD. A character of two bytes counts twice.
- The longest values of one group, with the separators, must fit.
- The group hashes must fit as well: each SHA1 group adds 40 characters plus the separator, so at most 97 groups fit.
Example
A Satellite with the terms CUSTOMER, CUSTOMER_TYPE and CUSTOMER_SINCE has Hash Group Size 2. Its Hashing view calculates two groups:
STANDARD_HASH(
STANDARD_HASH(NVL(CUSTOMER, '_NULL_') || '_'
|| NVL(CUSTOMER_TYPE, '_NULL_'), 'SHA1')
|| '_' || STANDARD_HASH(
NVL(TO_CHAR(CUSTOMER_SINCE, 'YYYYMMDDHH24MISS'), '_NULL_'),
'SHA1')
, 'SHA1') AS BG_ROWHASH
The row Contoso Ltd, Business, 2019-03-01 gives:
Hash Group Size BG_ROWHASH 2 BD00B21F51F3F506ADBF37B39F165EB1B906F8D2 empty B0F8890E411EF2C10CE48AB58D83605D21DA83F7
Changing the value on loaded objects
Changing Hash Group Size on a model object that already holds data changes its row hash when the object has more hashed terms than the old or the new value. The next load treats these rows as changed and writes a new version for each affected key. Set the value before the first load, or plan for these additional versions.
Available since Generator 2.3.
Related articles
- Reference: Hash Algorithm (Project), BG_RowHash, BG_RowHashScd1, BG_RowHashScd2
- See also: How biGENIUS-X builds hash values, Generators Release - 2.3.0