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: add visitor SidecarVisitor and Sidecar action struct #673

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sebastiantia
Copy link
Collaborator

What changes are proposed in this pull request?

This PR introduces the Sidecar action and its associated SidecarVisitor.

This action and visitor is used for the V2 checkpoints Reader/Writer table feature.

resolves #668

Note: PR also simplifies some conditional flags detailed in issue: #672

How was this change tested?

  • Ensure schema projection to Sidecar works
  • Ensure that the visitor correctly extracts Sidecar actions

#[cfg_attr(test, derive(Serialize, Default), serde(rename_all = "camelCase"))]
struct Sidecar {
/// A path to the sidecar file. Because sidecar files must always reside in the table's own
/// _delta_log/_sidecars directory, implementations are encouraged to store only the file's name.
Copy link
Collaborator Author

@sebastiantia sebastiantia Feb 1, 2025

Choose a reason for hiding this comment

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

This comment is quoted from the protocol linked here.

I am assuming this means we will need to handle both cases where the path is:

  1. just the file name of the sidecar files
  2. the absolute path (including parent directories)

Or can we assume that implementations are not only encouraged, but DO simply store the file name of the sidecar files as the path?

Delta spark assumes that path is just the file name:
https://github.com/delta-io/delta/blob/990c8e8aedb69a1660e7780ab1d1a19f5c95615f/kernel/kernel-api/src/main/java/io/delta/kernel/internal/replay/ActionsIterator.java#L274

Can I get a 👍 to do the same?

Copy link

codecov bot commented Feb 1, 2025

Codecov Report

Attention: Patch coverage is 84.72222% with 11 lines in your changes missing coverage. Please review.

Project coverage is 84.14%. Comparing base (06d8dbb) to head (5e31858).

Files with missing lines Patch % Lines
kernel/src/actions/visitors.rs 79.62% 4 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #673      +/-   ##
==========================================
- Coverage   84.14%   84.14%   -0.01%     
==========================================
  Files          77       77              
  Lines       17710    17777      +67     
  Branches    17710    17777      +67     
==========================================
+ Hits        14902    14958      +56     
- Misses       2096     2100       +4     
- Partials      712      719       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sebastiantia sebastiantia marked this pull request as ready for review February 1, 2025 01:04
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.

New visitor SidecarVisitor and Sidecar action struct
1 participant