-
Notifications
You must be signed in to change notification settings - Fork 414
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
feat: Upgrade to arrow/parquet 15 and datafusion 9 #652
Conversation
…ding to localfilesystem
… datafusion tableprovider
Co-authored-by: Christian Williams <[email protected]>
Co-authored-by: Christian Williams <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Personally I would use the opportunity to get rid of the new_underlying_writer
function, but I'll leave that up to you.
fn new_underlying_writer( | ||
cursor: InMemoryWriteableCursor, | ||
buffer: ShareableBuffer, | ||
arrow_schema: Arc<ArrowSchema>, | ||
writer_properties: WriterProperties, | ||
) -> Result<ArrowWriter<InMemoryWriteableCursor>, ParquetError> { | ||
ArrowWriter::try_new(cursor, arrow_schema, Some(writer_properties)) | ||
) -> Result<ArrowWriter<ShareableBuffer>, ParquetError> { | ||
ArrowWriter::try_new(buffer, arrow_schema, Some(writer_properties)) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do remember stumbling across this before and not introduced in this PR, but wrapping this one-liner in a function does not seem to add convenience :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I almost changed this and a few other things in this PR, but I decided to save it for the followup. I agree it isn't useful in its current state, but I'd still like to address it next time.
let cursor = InMemoryWriteableCursor::default(); | ||
let mut writer = ArrowWriter::try_new(cursor.clone(), arrow_schema.clone(), None)?; | ||
let buffer = ShareableBuffer::default(); | ||
let mut writer = ArrowWriter::try_new(buffer.clone(), arrow_schema.clone(), None)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... particularly since we are not using that function from before here :).
Description
This PR upgrades arrow and parquet to 15 and datafusion to 9.
The parquet crate has deprecated and removed the InMemoryWriteableCursor from the public API. We still need a struct like this for streaming writes though so we can check the parquet buffer size and finalize file writes based on buffer size. For now, we need this in kafka-delta-ingest, but the delta-rs writer has a similar implementation and we want to begin using that writer soon.
The
ShareableBuffer
struct I've added in this PR is similar to theInMemoryWriteableCursor
but doesn't include aCursor
since we don't currently have a need to seek. Also it uses anRwLock
instead of aMutex
.In a separate PR, I plan to make some additional changes to remove obstacles for using the delta-rs writer within kafka-delta-ingest.
Related Issue(s)