harshkumar-2005 commented on code in PR #47922:
URL: https://github.com/apache/arrow/pull/47922#discussion_r2759845987


##########
cpp/src/arrow/type.cc:
##########
@@ -3552,4 +3553,26 @@ const std::vector<Type::type>& DecimalTypeIds() {
   return type_ids;
 }
 
+Result<std::shared_ptr<DataType>> type_singleton(Type::type id) {
+  struct Visitor {
+    Result<std::shared_ptr<DataType>> result;
+
+    template <typename T>
+    Status Visit(const T* type) {
+      if constexpr (TypeTraits<T>::is_parameter_free) {
+        result = TypeTraits<T>::type_singleton();
+        return Status::OK();
+      }
+      return Status::Invalid("Type ", T::type_id, " is not a parameter-free 
singleton type.");

Review Comment:
   return Status::TypeError("Type ", T::type_id, " is not a parameter-free 
singleton type.");
   this would work right ?



-- 
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]

Reply via email to