apache / apache/arrow-rs

Construct decimal from i32

Open
#5,325 10 comments 0 reactions 0 assignees View on GitHub
parquet
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 14h
Merged PRs (30d)
167

Description

I think it would be clearer to use the constructors instead: https://docs.rs/parquet/latest/parquet/data_type/enum.Decimal.html#method.from_i32

```suggestion
let decimal = Decimal::from_i32(* v as i32, *p as i32, *s as i32)'
sbbf.check(&decimal)
```

(the same applies to the other types here as well)

_Originally posted by @alamb in https://github.com/apache/arrow-datafusion/pull/8930#discussion_r1462422283_

Contributor guide

Open the contributing guide

Research direction

Start with the Decimal::from_i32 documentation linked in the issue and the code discussed in Arrow DataFusion PR #8930. Replace the current decimal construction with the constructor approach shown, apply the same treatment to the other types, and run the relevant checks or tests for the changed code.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.