![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Provides static methods to convert Parquet column data into tensor form. More...
#include <tensor_bridge.hpp>
Static Public Member Functions | |
| static expected< TensorView > | wrap_column (const void *column_data, int64_t num_values, PhysicalType physical_type, int32_t type_length=-1) |
| Wrap a contiguous numeric Parquet column as a 1D TensorView. | |
| static expected< TensorView > | wrap_vectors (const void *column_data, int64_t num_vectors, uint32_t dimension) |
| Wrap a contiguous FLOAT32_VECTOR column as a 2D TensorView. | |
| static expected< OwnedTensor > | copy_column (const void *column_data, int64_t num_values, PhysicalType physical_type, TensorDataType target_dtype, int32_t type_length=-1) |
| Read column data and produce an OwnedTensor with the requested type. | |
| static expected< OwnedTensor > | cast (const TensorView &src, TensorDataType target_dtype) |
| Cast a tensor view to a different element type, producing an OwnedTensor. | |
| static expected< TensorDataType > | parquet_to_tensor_dtype (PhysicalType pt) |
| Map a Parquet physical type to the natural TensorDataType. | |
Provides static methods to convert Parquet column data into tensor form.
Two primary paths:
Definition at line 662 of file tensor_bridge.hpp.
|
inlinestatic |
Cast a tensor view to a different element type, producing an OwnedTensor.
Uses a type-dispatched inner loop. Supported source and target types: FLOAT32, FLOAT64, INT32, INT64, INT8, UINT8, INT16, BOOL. FLOAT16 as a source or target is not currently supported by cast().
| src | Source tensor view. |
| target_dtype | Desired output element type. |
Definition at line 885 of file tensor_bridge.hpp.
|
inlinestatic |
Read column data and produce an OwnedTensor with the requested type.
Supports all numeric Parquet physical types. BYTE_ARRAY (variable- length strings) cannot be represented as a dense tensor and returns an error.
| column_data | Source data pointer. |
| num_values | Number of values. |
| physical_type | Parquet physical type. |
| target_dtype | Desired tensor element type. |
| type_length | For FIXED_LEN_BYTE_ARRAY only. |
Definition at line 795 of file tensor_bridge.hpp.
|
inlinestatic |
Map a Parquet physical type to the natural TensorDataType.
Definition at line 923 of file tensor_bridge.hpp.
|
inlinestatic |
Wrap a contiguous numeric Parquet column as a 1D TensorView.
Supported physical types: INT32, INT64, FLOAT, DOUBLE, FIXED_LEN_BYTE_ARRAY (returned as a 2D view of raw bytes or typed data when type_length aligns to a primitive size).
No data is copied. The returned view points directly into column_data.
| column_data | Pointer to the column's contiguous value buffer. |
| num_values | Number of values in the column. |
| physical_type | Parquet physical type of the column. |
| type_length | Byte length per value (only for FIXED_LEN_BYTE_ARRAY). |
Definition at line 681 of file tensor_bridge.hpp.
|
inlinestatic |
Wrap a contiguous FLOAT32_VECTOR column as a 2D TensorView.
The data is assumed to be densely packed float32 vectors, each of the given dimension. The returned shape is {num_vectors, dimension}.
| column_data | Pointer to contiguous float data. |
| num_vectors | Number of vectors. |
| dimension | Elements per vector. |
Definition at line 760 of file tensor_bridge.hpp.