Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion quadfeather/tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1528,8 +1528,14 @@ def insert_table(self, table: pa.Table):
else:
for sidecar, tb in self.keyed_batches(table).items():
for tb in rebatch(tb.to_batches(), 50e6):
writer_schema = self.overflow_buffers[sidecar].schema
for batch in tb.to_batches():
self.overflow_buffers[sidecar].write_batch(batch)
# ensure the new batch has the exact schema instance from the writer
aligned_batch = pa.RecordBatch.from_arrays(
[batch[field.name] for field in writer_schema],
schema=writer_schema
)
self.overflow_buffers[sidecar].write_batch(aligned_batch)

def keyed_batches(self, table: pa.Table):
"""
Expand Down