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

Function MakeArrowInt

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

Source from the content-addressed store, hash-verified

66}
67
68Result<std::shared_ptr<ArrowType>> MakeArrowInt(const LogicalType& logical_type) {
69 const auto& integer = checked_cast<const IntLogicalType&>(logical_type);
70 switch (integer.bit_width()) {
71 case 8:
72 return integer.is_signed() ? ::arrow::int8() : ::arrow::uint8();
73 case 16:
74 return integer.is_signed() ? ::arrow::int16() : ::arrow::uint16();
75 case 32:
76 return integer.is_signed() ? ::arrow::int32() : ::arrow::uint32();
77 default:
78 return Status::TypeError(logical_type.ToString(),
79 " cannot annotate physical type Int32");
80 }
81}
82
83Result<std::shared_ptr<ArrowType>> MakeArrowInt64(const LogicalType& logical_type) {
84 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