File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -742,6 +742,20 @@ int16_t carquet_schema_node_max_def_level(const carquet_schema_node_t* node);
742742CARQUET_API CARQUET_PURE CARQUET_NONNULL (1 )
743743int16_t carquet_schema_node_max_rep_level (const carquet_schema_node_t * node );
744744
745+ /**
746+ * @brief Get the type length for a FIXED_LEN_BYTE_ARRAY column.
747+ *
748+ * Returns the fixed byte length of each value. This is needed to allocate
749+ * correctly sized buffers for carquet_column_read_batch().
750+ *
751+ * @param[in] node Schema node (must be a leaf)
752+ * @return Type length in bytes, or 0 if not a FIXED_LEN_BYTE_ARRAY
753+ *
754+ * @note Thread-safe: Yes (read-only)
755+ */
756+ CARQUET_API CARQUET_PURE CARQUET_NONNULL (1 )
757+ int32_t carquet_schema_node_type_length (const carquet_schema_node_t * node );
758+
745759/* ============================================================================
746760 * Reader API
747761 * ============================================================================
Original file line number Diff line number Diff line change @@ -299,3 +299,9 @@ int16_t carquet_schema_node_max_rep_level(const carquet_schema_node_t* node) {
299299 const parquet_schema_element_t * elem = (const parquet_schema_element_t * )node ;
300300 return (elem -> repetition_type == CARQUET_REPETITION_REPEATED ) ? 1 : 0 ;
301301}
302+
303+ int32_t carquet_schema_node_type_length (const carquet_schema_node_t * node ) {
304+ /* node is nonnull per API contract */
305+ const parquet_schema_element_t * elem = (const parquet_schema_element_t * )node ;
306+ return elem -> type_length ;
307+ }
You can’t perform that action at this time.
0 commit comments