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

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   For `PlainEncoder<BooleanType>`:
   
   1. For Encoding without arrow:
   
   ```c++
     void PutSpaced(const bool* src, int num_values, const uint8_t* valid_bits,
                    int64_t valid_bits_offset) override {
       if (valid_bits != NULLPTR) {
         PARQUET_ASSIGN_OR_THROW(auto buffer, 
::arrow::AllocateBuffer(num_values * sizeof(T),
                                                                      
this->memory_pool()));
         T* data = reinterpret_cast<T*>(buffer->mutable_data());
         int num_valid_values = ::arrow::util::internal::SpacedCompress<T>(
             src, num_values, valid_bits, valid_bits_offset, data);
         Put(data, num_valid_values);
       } else {
         Put(src, num_values);
       }
     }
   ```
   
   If values contains null, this only puts length for `valid_bits`.
   
   2. For Array
   
   ```c++
     void Put(const ::arrow::Array& values) override {
       if (values.type_id() != ::arrow::Type::BOOL) {
         throw ParquetException("direct put to boolean from " + 
values.type()->ToString() +
                                " not supported");
       }
       ...
       sink_.UnsafeAdvance(data.length());
     }
   ```
   
   This will always output the length with null. These two implement is 
inconsistent.
   
   ### Component(s)
   
   C++, Parquet


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