MCPcopy Create free account
hub / github.com/apache/paimon-rust / Decimal

Struct Decimal

bindings/go/predicate.go:139–144  ·  view source on GitHub ↗

Decimal represents a fixed-precision decimal value up to DECIMAL(38, s). The unscaled value is stored as a little-endian i128 split into two int64 halves: Lo (low 64 bits, unsigned interpretation) and Hi (high 64 bits, sign-extended). For values that fit in int64, use [NewDecimal]. Usage: paimon

Source from the content-addressed store, hash-verified

137// paimon.NewDecimal(12345, 10, 2) // 123.45 as DECIMAL(10,2)
138// paimon.Decimal{Lo: lo, Hi: hi, ...} // full i128
139type Decimal struct {
140 Lo int64 // low 64 bits of unscaled i128 (unsigned interpretation)
141 Hi int64 // high 64 bits of unscaled i128 (sign extension)
142 Precision uint32
143 Scale uint32
144}
145
146// NewDecimal creates a Decimal from an int64 unscaled value.
147// For unscaled values that exceed int64 range, construct Decimal directly

Callers 9

test_sql_type_decimalFunction · 0.85
arrow_to_paimon_typeFunction · 0.85
test_decimal_roundtripFunction · 0.85
datum_to_vortex_litFunction · 0.85
copy_with_nullableMethod · 0.85
test_decimal_partitionFunction · 0.85

Calls

no outgoing calls

Tested by 6

test_sql_type_decimalFunction · 0.68
test_decimal_roundtripFunction · 0.68
copy_with_nullableMethod · 0.68
test_decimal_partitionFunction · 0.68