mapleFU opened a new issue, #45431:
URL: https://github.com/apache/arrow/issues/45431

   ### Describe the enhancement requested
   
   Describe the enhancement requested
   ```c++
     random::RandomArrayGenerator gen(/*seed=*/42);
     auto test_identity_cast_for_type =
         [&gen](const std::shared_ptr<arrow::DataType>& data_type) {
           auto tmp_array = gen.ArrayOf(data_type, /*size=*/1, 
/*null_probability=*/0.0);
           ARROW_SCOPED_TRACE("data type = ", data_type->ToString());
           ASSERT_OK_AND_ASSIGN(auto scalar, tmp_array->GetScalar(0));
           ASSERT_OK_AND_ASSIGN(auto casted_scalar, scalar->CastTo(data_type));
           ASSERT_TRUE(casted_scalar->Equals(*scalar));
           ASSERT_TRUE(scalar->Equals(*casted_scalar));
         };
     for (auto& complex_type: {
   arrow::map(arrow::binary(), arrow::int32()),
              struct_({field("float", arrow::float32())}),
     }) {
       test_identity_cast_for_type(complex_typee);
     }
   ```
   This would report an error when casting the type to the same type.
   
   This might not a problem since it would likely to be deprecated 
https://github.com/apache/arrow/issues/39182 , and Cast works well in this 
scenerio.
   
   ### Component(s)
   
   C++


-- 
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: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to