![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Append-only writer for a single feature group. More...
#include <feature_writer.hpp>
Public Types | |
| using | Options = FeatureWriterOptions |
| Alias for the options struct. | |
Public Member Functions | |
| FeatureWriter ()=default | |
| Default-construct an empty writer (use create() factory instead). | |
| FeatureWriter (FeatureWriter &&) noexcept=default | |
| FeatureWriter & | operator= (FeatureWriter &&) noexcept=default |
| FeatureWriter (const FeatureWriter &)=delete | |
| FeatureWriter & | operator= (const FeatureWriter &)=delete |
| ~FeatureWriter () | |
| expected< void > | write (const FeatureVector &fv) |
| Write a single feature vector to the store. | |
| expected< void > | write_batch (const FeatureVector *fvs, size_t count) |
| Write a contiguous array of feature vectors. | |
| expected< void > | write_batch (const std::vector< FeatureVector > &fvs) |
| Write a vector of feature vectors. | |
| expected< void > | flush () |
| Flush all buffered rows to the current Parquet file as a new row group. | |
| expected< void > | close () |
| Close the writer: flush remaining data, write Parquet footer, and finalize the file. | |
| const FeatureGroupDef & | group_def () const |
| Return the feature group definition used by this writer. | |
| int64_t | rows_written () const |
| Total number of rows written (including flushed and pending). | |
| std::vector< std::string > | output_files () const |
| Return a copy of all finalized output file paths (excludes the active file). | |
| bool | is_open () const |
| Check whether the writer currently has an open Parquet file. | |
Static Public Member Functions | |
| static expected< FeatureWriter > | create (Options opts) |
| Create a new FeatureWriter for the given options. | |
Append-only writer for a single feature group.
Writes typed, versioned feature vectors keyed by entity_id and timestamp_ns into Parquet files. Schema layout per file: col 0 = entity_id (STRING), col 1 = timestamp_ns (INT64), col 2 = version (INT32), col 3..N = feature columns (DOUBLE).
Files are append-only and automatically rolled when max_file_rows is reached. The writer flushes pending rows to a row group when the buffer reaches row_group_size.
Definition at line 102 of file feature_writer.hpp.
Alias for the options struct.
Definition at line 105 of file feature_writer.hpp.
|
default |
Default-construct an empty writer (use create() factory instead).
|
defaultnoexcept |
|
delete |
|
inline |
Definition at line 177 of file feature_writer.hpp.
|
inline |
Close the writer: flush remaining data, write Parquet footer, and finalize the file.
Definition at line 303 of file feature_writer.hpp.
|
inlinestatic |
Create a new FeatureWriter for the given options.
Creates the output directory if it does not exist. Validates that the output_dir does not contain path traversal components.
| opts | Writer configuration (output directory, group schema, etc.). |
Definition at line 118 of file feature_writer.hpp.
|
inline |
Flush all buffered rows to the current Parquet file as a new row group.
Opens a new file if none is currently open. Automatically rolls to a new file when max_file_rows is exceeded.
Definition at line 250 of file feature_writer.hpp.
|
inline |
Return the feature group definition used by this writer.
Definition at line 324 of file feature_writer.hpp.
|
inline |
Check whether the writer currently has an open Parquet file.
Definition at line 330 of file feature_writer.hpp.
|
delete |
|
defaultnoexcept |
|
inline |
Return a copy of all finalized output file paths (excludes the active file).
Definition at line 328 of file feature_writer.hpp.
|
inline |
Total number of rows written (including flushed and pending).
Definition at line 326 of file feature_writer.hpp.
|
inline |
Write a single feature vector to the store.
Buffers internally; flushes a row group when the buffer reaches row_group_size.
| fv | The feature vector to write. Its values.size() must match the number of feature names in the group definition. |
Definition at line 193 of file feature_writer.hpp.
|
inline |
Write a contiguous array of feature vectors.
| fvs | Pointer to the first FeatureVector. |
| count | Number of vectors to write. |
Definition at line 225 of file feature_writer.hpp.
|
inline |
Write a vector of feature vectors.
| fvs | The feature vectors to write. |
Definition at line 236 of file feature_writer.hpp.