Commit 83a96fc
authored
Add nodes to convert between csp.Structs and Arrow RecordBatches (#698)
* Arrow foundation: type visitor, field reader/writer, and CMake
Add core Arrow adapter library with:
- ArrowTypeVisitor: visitArrowValueType maps arrow::Type to C++ types
- ArrowFieldReader: per-column value extraction from Arrow arrays
- ArrowFieldWriter: per-column value serialization to Arrow builders
- CMake build for csp_arrow_adapter static library
- Centralize Arrow link-target resolution in FindDepsArrowAdapter
Signed-off-by: Arham Chopra <arham.chopra@cubistsystematic.com>
* Arrow batch conversion: RecordBatch ↔ Struct
Add RecordBatchToStruct and StructToRecordBatch converters for
bulk-converting between Arrow RecordBatches and csp::Struct vectors.
Support pluggable custom field readers/writers for extension types.
Signed-off-by: Arham Chopra <arham.chopra@cubistsystematic.com>
* Arrow Python bindings for batch adapter (scalar types)
Add ArrowCppNodes with record_batches_to_struct and struct_to_record_batches
CppNode implementations. Make RecordBatchPullInputAdapter schema optional
(lazy extraction from first batch). Register graph functions in arrow.py.
Simplify arrowadapterimpl build to link against csp_arrow_adapter.
Signed-off-by: Arham Chopra <arham.chopra@cubistsystematic.com>
* Tests for Arrow batch adapter scalar type conversion
Add tests for record_batches_to_struct and struct_to_record_batches
covering all scalar types, nested structs, schema validation, and
round-trip conversion. Add RecordBatch pull input adapter tests.
Signed-off-by: Arham Chopra <arham.chopra@cubistsystematic.com>
* Address review feedback on CppNodes and arrow.py
- Remove unnecessary ticked() checks on single-input nodes
- Remove extra blank line in START()
- Use PyList_GET_ITEM for faster unchecked access in loop
- Use typed TS_INPUT(vector<StructPtr>) instead of Generic for struct_to_record_batches
- Use standard @csp.node decorator instead of _node_internal_use
Signed-off-by: Arham Chopra <arham.chopra@cubistsystematic.com>
---------
Signed-off-by: Arham Chopra <arham.chopra@cubistsystematic.com>1 parent f33f795 commit 83a96fc
18 files changed
Lines changed: 2979 additions & 28 deletions
File tree
- cpp
- cmake/modules
- csp
- adapters
- arrow
- python
- adapters
- csp
- adapters
- tests/adapters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
0 commit comments