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

Function MakeArrowInt

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

Source from the content-addressed store, hash-verified

52}
53
54Result<std::shared_ptr<ArrowType>> MakeArrowInt(const LogicalType& logical_type) {
55 const auto& integer = checked_cast<const IntLogicalType&>(logical_type);
56 switch (integer.bit_width()) {
57 case 8:
58 return integer.is_signed() ? ::arrow::int8() : ::arrow::uint8();
59 case 16:
60 return integer.is_signed() ? ::arrow::int16() : ::arrow::uint16();
61 case 32:
62 return integer.is_signed() ? ::arrow::int32() : ::arrow::uint32();
63 default:
64 return Status::TypeError(logical_type.ToString(),
65 " cannot annotate physical type Int32");
66 }
67}
68
69Result<std::shared_ptr<ArrowType>> MakeArrowInt64(const LogicalType& logical_type) {
70 const auto& integer = checked_cast<const IntLogicalType&>(logical_type);

Callers 1

FromInt32Function · 0.85

Calls 4

TypeErrorFunction · 0.50
bit_widthMethod · 0.45
is_signedMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected