E410 [Feature]: CommitData::new should respect "clientVersion" from app_metadata · Issue #4263 · delta-io/delta-rs · GitHub
[go: up one dir, main page]

Skip to content

[Feature]: CommitData::new should respect "clientVersion" from app_metadata #4263

@limenilbuz

Description

@limenilbuz

Is your feature request related to a problem?

When using the CreateBuilder interface, I'd have expected the commitProperties argument with the appropriate metadata to overwrite both "engineInfo" and "clientVersion" fields in the commitInfo action that gets published to the _delta_log.

    let commit_metadata = HashMap::from([
        ("engineInfo".to_owned(), json!("my_engine")),
        ("clientVersion".to_owned(), json!("my_client")),
    ]);

    let create_builder = CreateBuilder::default()
        .with_columns(...)
        .with_partition_columns(...)
        .with_location(table_url)
        .with_save_mode(...)
        .with_commit_properties(
            CommitProperties::default().with_metadata(commit_metadata),
        );
    
    create_builder.into_future().await?;

Resulting _delta_log entry:

{"protocol": ... }
{"metaData": ... }
{"commitInfo":{"timestamp": ... ,"operation":"CREATE TABLE","operationParameters": ..., "engineInfo":"my_engine","clientVersion":"delta-rs.0.30.0"}}

Describe the solution you'd like

I tracked this down to CommitData::new simply overwriting the entry for "clientVersion" in app_metadata, when there is no commitInfo action in the actions parameter.

Basically, I think this method could just use try_insert instead of insert when adding the "clientVersion" field.

Describe alternatives you've considered

I could work around this issue by synthesizing my own CommitInfo action in the instantiation of the CreateBuilder, but this seems like it could be better handled in CommitData::new.

Priority

Low - Nice to have

Additional context

No response

Contribution

  • I'm willing to submit a pull request for this feature
  • I can help with testing this feature
  • I can help with documentation for this feature

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0