MCPcopy Create free account
hub / github.com/apache/arrow / MakeArrowDecimal

Function MakeArrowDecimal

cpp/src/parquet/arrow/schema_internal.cc:42–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40namespace {
41
42Result<std::shared_ptr<ArrowType>> MakeArrowDecimal(const LogicalType& logical_type,
43 bool smallest_decimal_enabled) {
44 const auto& decimal = checked_cast<const DecimalLogicalType&>(logical_type);
45 if (smallest_decimal_enabled) {
46 return ::arrow::smallest_decimal(decimal.precision(), decimal.scale());
47 }
48 if (decimal.precision() <= ::arrow::Decimal128Type::kMaxPrecision) {
49 return ::arrow::Decimal128Type::Make(decimal.precision(), decimal.scale());
50 }
51 return ::arrow::Decimal256Type::Make(decimal.precision(), decimal.scale());
52}
53
54Result<std::shared_ptr<ArrowType>> MakeArrowInt(const LogicalType& logical_type) {
55 const auto& integer = checked_cast<const IntLogicalType&>(logical_type);

Callers 4

FromByteArrayFunction · 0.85
FromFLBAFunction · 0.85
FromInt32Function · 0.85
FromInt64Function · 0.85

Calls 4

smallest_decimalFunction · 0.85
MakeFunction · 0.50
precisionMethod · 0.45
scaleMethod · 0.45

Tested by

no test coverage detected