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

feat: Upgrade to arrow/parquet 15 and datafusion 9 #652

Merged
merged 12 commits into from
Jun 21, 2022

Conversation

xianwill
Copy link
Collaborator

@xianwill xianwill commented Jun 19, 2022

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 the InMemoryWriteableCursor but doesn't include a Cursor since we don't currently have a need to seek. Also it uses an RwLock instead of a Mutex.

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)

@xianwill xianwill marked this pull request as ready for review June 20, 2022 12:11
@xianwill xianwill requested review from roeap, houqp and mosyp June 20, 2022 12:11
@xianwill xianwill changed the title feat: Upgrade to Arrow/Parquet 15 feat: Upgrade to arrow/parquet 15 and datafusion 9 Jun 20, 2022
Copy link
Collaborator

@roeap roeap left a 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.

Comment on lines 168 to 175
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))
}
}
Copy link
Collaborator

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 :).

Copy link
Collaborator Author

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)?;
Copy link
Collaborator

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 :).

@xianwill xianwill merged commit fd0b2da into delta-io:main Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to arrow15 and datafusion9
4 participants