rtpsw commented on code in PR #13783:
URL: https://github.com/apache/arrow/pull/13783#discussion_r936835716
##########
cpp/src/arrow/type.cc:
##########
@@ -2494,6 +2519,61 @@ const std::vector<std::shared_ptr<DataType>>&
PrimitiveTypes() {
return g_primitive_types;
}
+bool IsBaseBinaryType(std::shared_ptr<DataType> type) {
+ std::call_once(static_data_initialized, InitStaticData);
+ return g_base_binary_types_set.find(type) != g_base_binary_types_set.end();
Review Comment:
Agreed.
##########
cpp/src/arrow/type.h:
##########
@@ -2151,4 +2151,32 @@ const std::vector<std::shared_ptr<DataType>>&
IntervalTypes();
ARROW_EXPORT
const std::vector<std::shared_ptr<DataType>>& PrimitiveTypes();
+ARROW_EXPORT
+bool IsSignedIntType(std::shared_ptr<DataType>);
Review Comment:
It turns out the set of `*Type()` functions does not correspond to the set
of `is_*` ones. This can be really confusing to the user; for example, one
could easily incorrectly assume that `PrimtiveTypes()` corresponds to
`is_primitive`. So, I think some clean up is warranted around this code, while
considering backwards compatibility.
I'll soon add a commit here that shows the `is_*` functions I needed to add
to obtain correspondence. However, I don't like the mess this makes of the
function names, so I'd appreciate a suggestion here.
##########
cpp/src/arrow/type_traits.h:
##########
@@ -942,6 +991,42 @@ static inline bool is_primitive(Type::type type_id) {
return false;
}
+/// \brief Check for a primitive-like type
+///
+/// \param[in] type_id the type-id to check
+/// \return whether type-id is a primitive-like type one
+static inline bool is_primitive_like(Type::type type_id) {
Review Comment:
I forgot to remove this predicate and I'll do so soon. It was only added to
correspond to some `*Types()` function, all of which are going to be removed.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]