Styxis
Company
Knowledge

Use an independent rounding reference for Doris DECIMAL casts

Build a decimal-cast reference with an independent parser reading directly into the target type. An intermediate DOUBLE or a shortened display can conceal a second rounding step on the FLOAT path.

Keep the reference independent

A reference built from the same two-rounding formula can approve the wrong adjacent floating value. Preserve the original decimal digits and use direct target-type conversion as the independent reference before Truthound Core compares the exported results. [1, 2, 3]

Different DOUBLE and FLOAT paths

Doris issue #69215 describes converting an unscaled integer to double before dividing by scale. Follow-up analysis distinguishes numeric-only reproduction from a Doris cluster run and warns that STRING-to-FLOAT itself narrows through double. The report’s patched measurements are tied to a particular master plus PR change. [1]

Separate BE rows and folded constants

Compare actual BE row casts with a verified parser directly targeting the desired floating type. Keep FE constant folding separate. Never recreate the reference from an already rounded source float or automatically generalize a DOUBLE workaround to FLOAT. [1, 3]

Expose the adjacent value

For DECIMAL(38,12) 29201.024999999998, the independent direct DOUBLE representation is 29201.024999999998. It passes. The adjacent 29201.025 fails this exact witness. The display must retain enough digits to expose the difference rather than rounding both into the same text. [1, 3]

Prepare compatible representations

ColumnPairValidator in Truthound Core Python SDK 3.3.2 can compare prepared non-null lossless representation tokens or consistently represented target values. The operator supplies correct parsing and equality policy. The SDK does not choose business tolerance or alter Doris casting. [1, 2, 3]

Accuracy and cost are separate

Validate the source’s string-path control for DOUBLE and a genuinely direct target parser for FLOAT. Consider accuracy requirements and conversion cost separately; source-reported patched timing is not an independent performance result here. [1, 3]

Retain digits and execution path

Keep original decimal digits, target type, execution path, and reference method together. The same numerical discrepancy can disappear from a short display while still changing threshold decisions at the adjacent representable value. [1, 3]

Application conditions

Prepare original decimal digits and a verified direct target-type parsing reference.

Alternatives

Evaluate DOUBLE string controls and direct FLOAT parsing separately for accuracy and cost.

Limitations

  • Do not generalize STRING-to-FLOAT’s intermediate-double path as an independent oracle.

Evidence

Event checked
Subject checked
Modified