Large IDs in Debezium asNumber: a Number object does not establish exact identity
Creating a numeric object does not establish preservation of an exact identifier.
Do not use an approximation as the oracle
Creating a numeric object does not establish preservation of an exact identifier. Compare the raw decimal string with an exact representation after conversion, and do not admit an approximation as an identity. A Truthound reference rebuilt from the same Float would conceal the lost digits by comparing one approximation with itself. [1, 2, 3]
The trap in a successful Float parse
Debezium #2953 reports Strings.asNumber trying Float after Long and before BigInteger, producing rounded large integers or Infinity. It is a utility report, not evidence of customer-row loss in a specific connector. A finite-value check alone also misses finite but incorrect identifiers. [1]
Retain the identifier text
Confirm the field purpose and retain its original decimal representation. Exclude identifiers converted to Float or Infinity from reference linking. Record returned Number type, raw text and exact reconstruction, retaining unknown states separately. An independent arbitrary-precision reference must not pass through floating point. [1, 3]
Two different identifiers
The illustrative identifier is defined directly as 12345678901234567890. Exact reconstruction of that string passes; the approximate 12345679000000000000 is a different identifier and fails. Derive the reference independently of parser output. Passing exact representation checks identity preservation, not every later arithmetic operation. [1, 3]
Compare exact decimal representations
Truthound Core Python SDK 3.3.2 can compare prepared raw_identifier_decimal and parsed_integer_decimal using ColumnPairValidator with relationship="==". The operator supplies lossless decimal strings and checks missingness separately. The SDK does not change Strings.asNumber dispatch or recover digits already lost. [1, 2, 3]
Let field purpose choose the representation
Keep non-arithmetic IDs as strings or test an explicit BigInteger path. A measurement with an approved tolerance may not need literal string equality. Choose the representation from the field’s role as a key or a quantity rather than its magnitude alone. [1, 3]
Application conditions
Preserve raw strings and build the arbitrary-precision reference without float conversion; isolate missing values and Infinity.
Alternatives
Keep identifiers as strings or test an explicit BigInteger conversion.
Limitations
The SDK does not change dispatch or recover lost digits; string equality does not prove all arithmetic correct.
Evidence
- Event checked
- Subject checked
- Modified
