Skip to content

Commit 0163c63

Browse files
add tmp ict fixup for writes
1 parent ef206a4 commit 0163c63

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

kernel/src/actions/mod.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::sync::LazyLock;
1010

1111
use self::deletion_vector::DeletionVectorDescriptor;
1212
use crate::actions::schemas::GetStructField;
13-
use crate::schema::{SchemaRef, StructType};
13+
use crate::schema::{DataType, SchemaRef, StructField, StructType};
1414
use crate::table_features::{
1515
ReaderFeatures, WriterFeatures, SUPPORTED_READER_FEATURES, SUPPORTED_WRITER_FEATURES,
1616
};
@@ -84,6 +84,13 @@ pub(crate) fn get_log_commit_info_schema() -> &'static SchemaRef {
8484
&LOG_COMMIT_INFO_SCHEMA
8585
}
8686

87+
pub(crate) fn get_log_commit_info_schema_no_ict() -> &'static SchemaRef {
88+
StructType::new([
89+
StructField::new("timestamp", DataType::LONG, true),
90+
StructField::new("operation", DataType::STRING, true),
91+
])
92+
}
93+
8794
#[derive(Debug, Clone, PartialEq, Eq, Schema)]
8895
#[cfg_attr(test, derive(Serialize), serde(rename_all = "camelCase"))]
8996
pub struct Format {
@@ -331,8 +338,10 @@ where
331338
struct CommitInfo {
332339
/// The time this logical file was created, as milliseconds since the epoch.
333340
/// Read: optional, write: required (that is, kernel always writes).
334-
/// If in-commit timestamps are enabled, this is always required.
335341
pub(crate) timestamp: Option<i64>,
342+
/// The time this logical file was created, as milliseconds since the epoch. Unlike
343+
/// `timestamp`, this field is guaranteed to be monotonically increase with each commit.
344+
/// If in-commit timestamps are enabled, this is always required.
336345
pub(crate) in_commit_timestamp: Option<i64>,
337346
/// An arbitrary string that identifies the operation associated with this commit. This is
338347
/// specified by the engine. Read: optional, write: required (that is, kernel alwarys writes).
@@ -695,6 +704,7 @@ mod tests {
695704
"commitInfo",
696705
StructType::new(vec![
697706
StructField::new("timestamp", DataType::LONG, true),
707+
StructField::new("inCommitTimestamp", DataType::LONG, true),
698708
StructField::new("operation", DataType::STRING, true),
699709
StructField::new(
700710
"operationParameters",

kernel/src/table_changes/log_replay/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ async fn table_changes_in_commit_timestamp() {
615615
mock_table
616616
.commit([
617617
Action::CommitInfo(CommitInfo {
618-
timestamp: Some(timestamp),
618+
in_commit_timestamp: Some(timestamp),
619619
..Default::default()
620620
}),
621621
Action::Add(Add {

kernel/src/table_changes/scan_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ mod tests {
320320

321321
let cdc_timestamp = 12345678;
322322
let commit_info = CommitInfo {
323-
timestamp: Some(cdc_timestamp),
323+
in_commit_timestamp: Some(cdc_timestamp),
324324
..Default::default()
325325
};
326326

kernel/src/transaction.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ mod tests {
590590
serde_json::json!({
591591
"commitInfo": {
592592
"timestamp": 0,
593+
"inCommitTimestamp": 0,
593594
"operation": "test operation",
594595
"kernelVersion": format!("v{}", env!("CARGO_PKG_VERSION")),
595596
"operationParameters": {},
@@ -600,6 +601,7 @@ mod tests {
600601
serde_json::json!({
601602
"commitInfo": {
602603
"timestamp": 0,
604+
"inCommitTimestamp": 0,
603605
"operation": "test operation",
604606
"kernelVersion": format!("v{}", env!("CARGO_PKG_VERSION")),
605607
"operationParameters": {},

0 commit comments

Comments
 (0)