bkietz commented on code in PR #39192:
URL: https://github.com/apache/arrow/pull/39192#discussion_r1475152098


##########
cpp/src/arrow/scalar.cc:
##########
@@ -884,9 +997,11 @@ std::string Scalar::ToString() const {
     return dict_scalar->value.dictionary->ToString() + "[" +
            dict_scalar->value.index->ToString() + "]";
   }
-  auto maybe_repr = CastTo(utf8());
+
+  auto maybe_repr = Cast(CastToExplicitScalar(), utf8());

Review Comment:
   I'm not sure what the intent of CastToExplicitScalar is. I'm guessing that 
you only need it in order to pass a `shared_ptr<Scalar>` to `Cast`. Have you 
tried using `shared_from_this` instead?
   
   ```suggestion
     auto maybe_repr = Cast(shared_from_this(), utf8());
   ```
   
   As for the bad_cast exception, I don't think I have enough information to 
understand how that would be raised.



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