You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2023/07/30 12:13:08 UTC

[GitHub] [arrow] mapleFU opened a new issue, #36939: [C++][Parquet] Boolean encoding has inconsistent implemention

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

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


[GitHub] [arrow] mapleFU commented on issue #36939: [C++][Parquet] Boolean encoding has inconsistent implemention

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on issue #36939:
URL: https://github.com/apache/arrow/issues/36939#issuecomment-1660170956

   By the way, actually, `sink_.UnsafeAdvance(data.length());` will allocate `sum-of-array-length-include-null` bytes. But finally, data should be encoded into `sum-of-array-length-not-include-null` bits.


-- 
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: github-unsubscribe@arrow.apache.org

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


[GitHub] [arrow] pitrou closed issue #36939: [C++][Parquet] Boolean encoding has inconsistent implemention

Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou closed issue #36939: [C++][Parquet] Boolean encoding has inconsistent implemention
URL: https://github.com/apache/arrow/issues/36939


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow] mapleFU commented on issue #36939: [C++][Parquet] Boolean encoding has inconsistent implemention

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on issue #36939:
URL: https://github.com/apache/arrow/issues/36939#issuecomment-1657124108

   cc @emkornfield @pitrou @wgtmac is this expected?


-- 
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: github-unsubscribe@arrow.apache.org

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