Skip to content

Commit

Permalink
Fix table id when columns updated (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass authored Oct 30, 2024
1 parent 55ed28e commit ec09e02
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions protobuf-delta-lake-sink/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
use std::{
collections::{HashMap, HashSet},
sync::Arc,
};

use anyhow::{anyhow, Context, Result};
use chrono::{NaiveDateTime, Utc};
use clap::Parser;
Expand All @@ -16,10 +21,6 @@ use file_store::Settings;
use futures::stream::{self, StreamExt};
use protobuf::CodedInputStream;
use serde_json::Value;
use std::{
collections::{HashMap, HashSet},
sync::Arc,
};
pub use store::*;

use crate::{
Expand Down Expand Up @@ -189,7 +190,8 @@ async fn main() -> Result<()> {
vec!["date".to_string()],
HashMap::new(),
);
let meta = action::MetaData::try_from(metadata)?;
let mut meta = action::MetaData::try_from(metadata)?;
meta.id = table.get_metadata()?.id.clone();
let actions = vec![Action::metaData(meta)];
let storage = table.object_store();
commit(storage.as_ref(), &actions, &table.state).await?;
Expand Down

0 comments on commit ec09e02

Please sign in to comment.