bkietz commented on a change in pull request #9294: URL: https://github.com/apache/arrow/pull/9294#discussion_r566363820
########## File path: cpp/src/arrow/type_traits.h ########## @@ -929,6 +929,46 @@ static inline bool is_fixed_width(Type::type type_id) { return is_primitive(type_id) || is_dictionary(type_id) || is_fixed_size_binary(type_id); } +static inline int bit_width(Type::type type_id) { + switch (type_id) { + case Type::BOOL: + return 1; + case Type::UINT8: + case Type::INT8: + return 8; + case Type::UINT16: + case Type::INT16: + return 16; + case Type::UINT32: + case Type::INT32: + case Type::DATE32: + case Type::TIME32: + return 32; + case Type::UINT64: + case Type::INT64: + case Type::DATE64: + case Type::TIME64: + case Type::TIMESTAMP: + case Type::DURATION: + return 64; + + case Type::HALF_FLOAT: + return 16; + case Type::FLOAT: + return 32; + case Type::DOUBLE: + return 64; + + case Type::INTERVAL_MONTHS: + return 32; + case Type::INTERVAL_DAY_TIME: + return 64; + default: Review comment: Alright, will do ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org