Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed a stream of RecordBatches to a table (Python) #1812

Open
dennybritz opened this issue May 15, 2022 · 0 comments
Open

Feed a stream of RecordBatches to a table (Python) #1812

dennybritz opened this issue May 15, 2022 · 0 comments
Labels
enhancement Feature requests or improvements Python

Comments

@dennybritz
Copy link

dennybritz commented May 15, 2022

Feature Request

Description of Problem:

This is related to #1157 but not quite the same.

I have a real-time arrow IPC stream and would like update a perspective table batch by batch as data comes in. Currently it seems like I need to pass each batch through the following function and prepend the schema:

def to_arrow_bytes(schema, batch):
    stream = pa.BufferOutputStream()
    writer = pa.RecordBatchStreamWriter(stream, schema)
    writer.write_batch(batch)
    return stream.getvalue().to_pybytes()

That seems quite inefficient, especially when I'm already receiving the batch as a byte buffer on a socket. Is there any way to pass the received RecordBatch bytes directly? I guess this is not possible because the arrow schema may change between updates?

@timkpaine timkpaine added enhancement Feature requests or improvements Python labels May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements Python
Projects
None yet
Development

No branches or pull requests

2 participants