Add nodes to convert between csp structs and arrow record batches#680
Open
arhamchopra wants to merge 1 commit intomainfrom
Open
Add nodes to convert between csp structs and arrow record batches#680arhamchopra wants to merge 1 commit intomainfrom
arhamchopra wants to merge 1 commit intomainfrom
Conversation
Signed-off-by: Arham Chopra <arham.chopra@cubistsystematic.com>
7341648 to
78acf28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
record_batches_to_structandstruct_to_record_batchesnodesTwo new C++-backed nodes for bidirectional conversion between
csp.Structand ArrowRecordBatch:struct_to_record_batches—ts[List[T]]→ts[List[pa.RecordBatch]]record_batches_to_struct—ts[List[pa.RecordBatch]]→ts[List[T]]Both use the Arrow C Data Interface (PyCapsule protocol) to cross the Python/C++ boundary without serialization overhead. Scalar and temporal fields are read/written entirely in C++. Numpy array fields use bulk memory transfers rather than per-element iteration.
Supported types
bool,int8/16/32/64,uint8/16/32/64,double,str,bytes,datetime,timedelta,date,time,csp.Enum, nestedcsp.Struct,Numpy1DArray[T], andNumpyNDArray[T].Usage