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: Datafusion file sink #2155

Merged
merged 11 commits into from
Jan 31, 2025
Merged

feat: Datafusion file sink #2155

merged 11 commits into from
Jan 31, 2025

Conversation

AdamGS
Copy link
Contributor

@AdamGS AdamGS commented Jan 30, 2025

This writer is very simple compared to the built-in ones, it doesn't support as many features and generates one file per COPY/INSERT operation.

Closes #2148.

@AdamGS AdamGS changed the title [WIP] Datafusion writes [WIP] feat: Datafusion writes Jan 30, 2025
}
}

impl VortexWrite for ObjectStoreWriter {
async fn write_all<B: IoBuf>(&mut self, buffer: B) -> io::Result<B> {
self.multipart
.as_mut()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be problematic with Send, and anyway nothing here was actually used.

@AdamGS AdamGS marked this pull request as ready for review January 31, 2025 13:55
@AdamGS AdamGS changed the title [WIP] feat: Datafusion writes feat: Datafusion file sink Jan 31, 2025
@AdamGS AdamGS requested review from a10y and gatesn January 31, 2025 14:08
vortex-io/src/object_store.rs Outdated Show resolved Hide resolved
const CHUNKS_SIZE: usize = 25 * 1024 * 1204;

for (chunk_idx, chunk) in slice.chunks(25 * 1024 * 1204).enumerate() {
let payload = Bytes::copy_from_slice(&slice[chunk_idx * CHUNKS_SIZE..][..chunk.len()]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use chunk here instead of re-slicing the slice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had a lifetime issue, apparently I don't

@AdamGS AdamGS force-pushed the adamg/datafusion-vortex-write branch from c7c0165 to 9b090a2 Compare January 31, 2025 14:17
Copy link
Contributor

@a10y a10y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, we can follow up and figure out how to compress the chunks as they're written

@AdamGS AdamGS enabled auto-merge (squash) January 31, 2025 14:26
@AdamGS AdamGS merged commit f7b5d56 into develop Jan 31, 2025
20 checks passed
@AdamGS AdamGS deleted the adamg/datafusion-vortex-write branch January 31, 2025 14:27
AdamGS added a commit that referenced this pull request Jan 31, 2025
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.

Support writing to Datafusion tables
2 participants