NVIDIA / NVIDIA/cudf

[FEA] Add LTO transform example for per-row-exponent decimal arithmetic

Open
#23,891 1 comment 0 reactions 0 assignees View on GitHub
? - Needs Triage feature request
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
Downstream engines may require engine-specific semantics that are not native cuDF operations. For example, cuDF decimal scale is column-wide, while some decimal types require a per-row exponent.

A recommended integration pattern is to represent such values as a struct—for example, `(decimal128 coefficient, int16 exponent)` - pass the struct’s children through a multi-output LTO transform, and reconstruct the result struct.

**Describe the solution you'd like**
Add an example to libcudf to document and validate this extension mechanism.

POC available here: https://github.com/GregoryKimball/cudf/pull/5

**Describe alternatives you've considered**
* Add a first-class Oracle-compatible type to cuDF. This expands the global type-dispatch space, template instantiations, binary size, and maintenance burden, and regresses device-side dispatch paths used by relational operations.
* Map values to an existing fixed-scale DECIMAL128. This cannot represent a per-row exponent or the required dynamic range.
* Implement engine-owned CUDA kernels. This works but duplicates cuDF’s null handling, allocation, launch, and integration machinery.

**Additional context**
[NUMBER data type](https://docs.oracle.com/en/database/oracle/oracle-database/26/sqlrf/Data-Types.html) — precision, scale, range, and overflow behavior.
[NUMBER datatype limits](https://docs.oracle.com/en/database/oracle/oracle-database/26/refrn/datatype-limits.html) — 38-digit precision and range limits.
[Arithmetic operators](https://docs.oracle.com/en/database/oracle/oracle-database/26/sqlrf/Arithmetic-Operators.html) — SQL + and * semantics and type precedence.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked POC and the libcudf LTO transform interfaces to understand the multi-output path. Add an example that passes the coefficient and exponent children through the transform and reconstructs the struct, then validate that the extension mechanism handles per-row-exponent decimal arithmetic.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.