anjakefala commented on PR #13947:
URL: https://github.com/apache/arrow/pull/13947#issuecomment-1238582359

   If you run the `TestHalfFloatParquetIO` test, currently you get an 
`std::bad_cast` stacktrace:
   
   Result of stacktrace:
   
   ```
   /home/anja/git/arrow/cpp/src/parquet/arrow/arrow_reader_writer_test.cc:664: 
Failure
   Expected: for (::arrow::Status _st = 
::arrow::internal::GenericToStatus((WriteTable(*table, 
::arrow::default_memory_pool(), this->sink_, values->length(), 
default_writer_properties(), arrow_properties))); !_st.ok();) return 
::testing::internal::AssertHelper(::testing::TestPartResult::kFatalFailure, 
"/home/anja/git/arrow/cpp/src/parquet/arrow/arrow_reader_writer_test.cc", 664, 
"Failed") = ::testing::Message() << "'" "WriteTable(*table, 
::arrow::default_memory_pool(), this->sink_, values->length(), 
default_writer_properties(), arrow_properties)" "' failed with " << 
_st.ToString() doesn't throw an exception.
     Actual: it throws std::bad_cast with description "std::bad_cast".
   /home/anja/git/arrow/cpp/src/parquet/arrow/arrow_reader_writer_test.cc:664: 
Failure
   Expected: for (::arrow::Status _st = 
::arrow::internal::GenericToStatus((WriteTable(*table, 
::arrow::default_memory_pool(), this->sink_, values->length(), 
default_writer_properties(), arrow_properties))); !_st.ok();) return 
::testing::internal::AssertHelper(::testing::TestPartResult::kFatalFailure, 
"/home/anja/git/arrow/cpp/src/parquet/arrow/arrow_reader_writer_test.cc", 664, 
"Failed") = ::testing::Message() << "'" "WriteTable(*table, 
::arrow::default_memory_pool(), this->sink_, values->length(), 
default_writer_properties(), arrow_properties)" "' failed with " << 
_st.ToString() doesn't throw an exception.
     Actual: it throws std::bad_cast with description "std::bad_cast".
   ```
   
   I managed to narrow this stacktrace down to this call:
   
   ```
       WRITE_SERIALIZE_CASE(HALF_FLOAT, FixedSizeBinaryType, FLBAType)
    ```
   in `src/cpp/parquet/column_writer.cc`
   
   This will then call:                                                         
                                                                
             - `WriteArrowSerialize<FLBAType, FixedSizeBinaryType>()`           
                                                                                
                  
               With the `std::bad_cast` being thrown by -> 
`RETURN_NOT_OK(functor.Serialize(checked_cast<const ArrayType&>(array), ctx, 
buffer)); (l1569)                                                 
                   - it uses ArrayType -> typename 
::arrow::TypeTraits<FixedSizeBinaryType>::ArrayType;                            
                                               
                   - it uses SerializeFunctor<FLBAType, FixedSizeBinaryType>    
             
                   
   I am going to continue trying to understand this, but I am outside my 
comfort zone, and really welcome help!   In particular, my test might need 
adjustment, and perhaps my `ParquetType` and `ArrowType` should be changed. 
   


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