paleolimbot opened a new pull request, #15277:
URL: https://github.com/apache/arrow/pull/15277

   Before this PR, an attempt to print an ExtensionScalar would segfault:
   
   ```
   > arrow::Scalar$create(arrow::vctrs_extension_array(4))
   Scalar
   /Users/deweydunnington/Desktop/rscratch/arrow/cpp/src/arrow/result.cc:28: 
ValueOrDie called on an error: NotImplemented: construction from scalar of type 
numeric(0)
   
/Users/deweydunnington/Desktop/rscratch/arrow/cpp/src/arrow/array/util.cc:545  
VisitTypeInline(*scalar_.type, this)
   0   libarrow.1100.0.0.dylib             0x000000014d61dbec 
_ZN5arrow4util7CerrLog14PrintBackTraceEv + 52
   1   libarrow.1100.0.0.dylib             0x000000014d61db68 
_ZN5arrow4util7CerrLogD2Ev + 116
   2   libarrow.1100.0.0.dylib             0x000000014d61dab4 
_ZN5arrow4util7CerrLogD1Ev + 28
   3   libarrow.1100.0.0.dylib             0x000000014d61dae0 
_ZN5arrow4util7CerrLogD0Ev + 28
   4   libarrow.1100.0.0.dylib             0x000000014d61d9a8 
_ZN5arrow4util8ArrowLogD2Ev + 96
   5   libarrow.1100.0.0.dylib             0x000000014d61d9ec 
_ZN5arrow4util8ArrowLogD1Ev + 28
   6   libarrow.1100.0.0.dylib             0x000000014d30d888 
_ZN5arrow8internal14DieWithMessageERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
 + 68
   7   libarrow.1100.0.0.dylib             0x000000014d30d900 
_ZN5arrow8internal17InvalidValueOrDieERKNS_6StatusE + 76
   8   libparquet.1100.0.0.dylib           0x000000010bb250d0 
_ZNO5arrow6ResultINSt3__110shared_ptrINS_5ArrayEEEE10ValueOrDieEv + 52
   9   libarrow.1100.0.0.dylib             0x000000014d313ff0 
_ZNO5arrow6ResultINSt3__110shared_ptrINS_5ArrayEEEEdeEv + 40
   10  libarrow.1100.0.0.dylib             0x000000014d313880 
_ZNK5arrow6Scalar8ToStringEv + 692
   11  arrow.so                            0x0000000103c54fec 
_arrow_Scalar__ToString + 108
   ```
   
   After this PR, we get the result of `format(ext_scalar$as_vector())`:
   
   ``` r
   arrow::Scalar$create(arrow::vctrs_extension_array(4))
   #> Scalar
   #> 4
   ```
   
   This came up because the some relatively common (ish) R type POSIXlt is now 
transformed to an extension array by default:
   
   ``` r
   arrow::Scalar$create(as.POSIXlt(Sys.time()))
   #> Scalar
   #> 2023-01-09 14:55:53
   ```
   


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