Skip to content

more structured types for log listing #778

@zachschuermann

Description

@zachschuermann

we have a handful of assumptions that float around which aren't well-encoded into the type system, e.g.

  1. ascending_commit_files (just a name tells you sorting)
  2. checkpoint_parts: Vec has all the same version
  3. etc.

we should encode some of these guarantees (e.g. in list_log_files_with_version output types):

// instead of
pub(crate) fn list_log_files_with_version(
    fs_client: &dyn FileSystemClient,
    log_root: &Url,
    start_version: Option<Version>,
    end_version: Option<Version>,
) -> DeltaResult<(Vec<ParsedLogPath>, Vec<ParsedLogPath>)> {
// ...
}

// replace with
pub(crate) fn list_log_files_with_version(
    fs_client: &dyn FileSystemClient,
    log_root: &Url,
    start_version: Option<Version>,
    end_version: Option<Version>,
) -> DeltaResult<(SortedCommitFiles, CheckpointParts)> {
// ...
}

struct SortedCommitFiles {
    commit_files: Vec<ParsedLogPath>,
    is_ascending: bool,
    end_version: Version
}

struct CheckpointParts {
    checkpoint_parts: Vec<ParsedLogPath>,
    checkpoint_version: Version
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions