@@ -32,27 +32,22 @@ namespace sparrow_ipc::utils
3232 );
3333
3434 /* *
35- * @brief Extracts bitmap pointer and null count from a RecordBatch buffer.
36- *
37- * This function retrieves a bitmap buffer from the specified index in the RecordBatch's
38- * buffer list and calculates the number of null values represented by the bitmap.
35+ * @brief Extracts a buffer from a RecordBatch's body.
3936 *
40- * @param record_batch The Arrow RecordBatch containing buffer metadata
41- * @param body The raw buffer data as a byte span
42- * @param index The index of the bitmap buffer in the RecordBatch's buffer list
37+ * This function retrieves a buffer span from the specified index in the RecordBatch's
38+ * buffer list and increments the index.
4339 *
44- * @return A pair containing:
45- * - First: Pointer to the bitmap data (nullptr if buffer is empty)
46- * - Second: Count of null values in the bitmap (0 if buffer is empty)
40+ * @param record_batch The Arrow RecordBatch containing buffer metadata.
41+ * @param body The raw buffer data as a byte span.
42+ * @param buffer_index The index of the buffer to retrieve. This value is incremented by the function.
4743 *
48- * @note If the bitmap buffer has zero length, returns {nullptr, 0}
49- * @note The returned pointer is a non-const cast of the original const data
44+ * @return A `std::span<const uint8_t>` viewing the extracted buffer data.
45+ * @throws std::runtime_error if the buffer metadata indicates a buffer that exceeds the body size.
5046 */
51- // TODO to be removed when not used anymore (after adding compression to deserialize_fixedsizebinary_array)
52- [[nodiscard]] std::pair<std::uint8_t *, int64_t > get_bitmap_pointer_and_null_count (
47+ [[nodiscard]] std::span<const uint8_t > get_buffer (
5348 const org::apache::arrow::flatbuf::RecordBatch& record_batch,
5449 std::span<const uint8_t > body,
55- size_t index
50+ size_t & buffer_index
5651 );
5752
5853 /* *
@@ -72,23 +67,4 @@ namespace sparrow_ipc::utils
7267 std::span<const uint8_t > buffer_span,
7368 const org::apache::arrow::flatbuf::BodyCompression* compression
7469 );
75-
76- /* *
77- * @brief Extracts a buffer from a RecordBatch's body.
78- *
79- * This function retrieves a buffer span from the specified index in the RecordBatch's
80- * buffer list and increments the index.
81- *
82- * @param record_batch The Arrow RecordBatch containing buffer metadata.
83- * @param body The raw buffer data as a byte span.
84- * @param buffer_index The index of the buffer to retrieve. This value is incremented by the function.
85- *
86- * @return A `std::span<const uint8_t>` viewing the extracted buffer data.
87- * @throws std::runtime_error if the buffer metadata indicates a buffer that exceeds the body size.
88- */
89- [[nodiscard]] std::span<const uint8_t > get_buffer (
90- const org::apache::arrow::flatbuf::RecordBatch& record_batch,
91- std::span<const uint8_t > body,
92- size_t & buffer_index
93- );
9470}
0 commit comments