Skip to content

Commit

Permalink
fix commit info
Browse files Browse the repository at this point in the history
  • Loading branch information
zachschuermann committed Oct 2, 2024
1 parent e394127 commit c0b9a55
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
2 changes: 1 addition & 1 deletion kernel/src/actions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ pub(crate) const COMMIT_INFO_NAME: &str = "commitInfo";
lazy_static! {
static ref LOG_SCHEMA: StructType = StructType::new(
vec![
Option::<CommitInfo>::get_struct_field(COMMIT_INFO_NAME), // FIXME REORDER
Option::<Add>::get_struct_field(ADD_NAME),
Option::<Remove>::get_struct_field(REMOVE_NAME),
Option::<Metadata>::get_struct_field(METADATA_NAME),
Option::<Protocol>::get_struct_field(PROTOCOL_NAME),
Option::<Transaction>::get_struct_field(TRANSACTION_NAME),
Option::<CommitInfo>::get_struct_field(COMMIT_INFO_NAME),
// We don't support the following actions yet
//Option::<Cdc>::get_struct_field(CDC_NAME),
//Option::<DomainMetadata>::get_struct_field(DOMAIN_METADATA_NAME),
Expand Down
67 changes: 36 additions & 31 deletions kernel/src/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::sync::{Arc, LazyLock};
use std::sync::Arc;

use crate::actions::get_log_schema;
use crate::expressions::Scalar;
Expand Down Expand Up @@ -42,36 +42,41 @@ impl Transaction {
let actions = self.commit_info.into_iter().map(|commit_info| {
// expression to select all the columns
let commit_info_expr = Expression::Struct(vec![
//Expression::Literal(Scalar::Null(
// action_schema
// .project(&[crate::actions::ADD_NAME])
// .unwrap()
// .into(),
//)),
//Expression::Literal(Scalar::Null(
// action_schema
// .project(&[crate::actions::REMOVE_NAME])
// .unwrap()
// .into(),
//)),
//Expression::Literal(Scalar::Null(
// action_schema
// .project(&[crate::actions::METADATA_NAME])
// .unwrap()
// .into(),
//)),
//Expression::Literal(Scalar::Null(
// action_schema
// .project(&[crate::actions::PROTOCOL_NAME])
// .unwrap()
// .into(),
//)),
//Expression::Literal(Scalar::Null(
// action_schema
// .project(&[crate::actions::TRANSACTION_NAME])
// .unwrap()
// .into(),
//)),
Expression::Literal(Scalar::Null(
action_schema
.field(crate::actions::ADD_NAME)
.unwrap()
.data_type()
.clone(),
)),
Expression::Literal(Scalar::Null(
action_schema
.field(crate::actions::REMOVE_NAME)
.unwrap()
.data_type()
.clone(),
)),
Expression::Literal(Scalar::Null(
action_schema
.field(crate::actions::METADATA_NAME)
.unwrap()
.data_type()
.clone(),
)),
Expression::Literal(Scalar::Null(
action_schema
.field(crate::actions::PROTOCOL_NAME)
.unwrap()
.data_type()
.clone(),
)),
Expression::Literal(Scalar::Null(
action_schema
.field(crate::actions::TRANSACTION_NAME)
.unwrap()
.data_type()
.clone(),
)),
Expression::Struct(
commit_info
.schema
Expand Down

0 comments on commit c0b9a55

Please sign in to comment.