Skip to content

Commit 78c2bb6

Browse files
committed
fix
1 parent e2b7987 commit 78c2bb6

File tree

4 files changed

+14
-31
lines changed

4 files changed

+14
-31
lines changed

kernel/src/actions/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
//! specification](https://github.com/delta-io/delta/blob/master/PROTOCOL.md)
33
44
use std::collections::HashMap;
5-
use std::fmt::{Debug, Display};
6-
use std::hash::Hash;
5+
use std::fmt::Debug;
76
use std::str::FromStr;
87
use std::sync::{Arc, LazyLock};
98

@@ -24,7 +23,6 @@ use url::Url;
2423
use visitors::{MetadataVisitor, ProtocolVisitor};
2524

2625
use delta_kernel_derive::{internal_api, IntoEngineData, ToSchema};
27-
use itertools::Itertools;
2826
use serde::{Deserialize, Serialize};
2927

3028
const KERNEL_VERSION: &str = env!("CARGO_PKG_VERSION");

kernel/src/table_changes/log_replay.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use crate::scan::state::DvInfo;
1818
use crate::schema::{
1919
ColumnNamesAndTypes, DataType, SchemaRef, StructField, StructType, ToSchema as _,
2020
};
21-
use crate::table_changes::check_cdf_table_properties;
2221
use crate::table_changes::scan_file::{cdf_scan_row_expression, cdf_scan_row_schema};
2322
use crate::table_configuration::TableConfiguration;
23+
use crate::table_features::Operation;
2424
use crate::utils::require;
2525
use crate::{DeltaResult, Engine, EngineData, Error, PredicateRef, RowVisitor};
2626

@@ -197,9 +197,6 @@ impl LogReplayScanner {
197197
table_schema.as_ref() == &schema,
198198
Error::change_data_feed_incompatible_schema(table_schema, &schema)
199199
);
200-
let table_properties = metadata.parse_table_properties();
201-
check_cdf_table_properties(&table_properties)
202-
.map_err(|_| Error::change_data_feed_unsupported(commit_file.version))?;
203200
}
204201

205202
// Update table configuration with any new Protocol or Metadata from this commit
@@ -214,8 +211,7 @@ impl LogReplayScanner {
214211
// If protocol or metadata is updated, check if Change Data Feed is supported
215212
table_configuration
216213
.ensure_operation_supported(Operation::Cdf)
217-
.then_some(())
218-
.ok_or_else(|| Error::change_data_feed_unsupported(commit_file.version))?;
214+
.map_err(|_| Error::change_data_feed_unsupported(commit_file.version))?;
219215
}
220216
}
221217
// We resolve the remove deletion vector map after visiting the entire commit.

kernel/src/table_changes/log_replay/tests.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,14 @@ async fn unsupported_reader_feature() {
230230
Protocol::try_new(
231231
3,
232232
7,
233-
Some([TableFeature::DeletionVectors, TableFeature::TypeWidening]),
234-
Some([TableFeature::DeletionVectors, TableFeature::TypeWidening]),
233+
Some([
234+
TableFeature::DeletionVectors,
235+
TableFeature::unknown("unsupportedReaderFeature"),
236+
]),
237+
Some([
238+
TableFeature::DeletionVectors,
239+
TableFeature::unknown("unsupportedReaderFeature"),
240+
]),
235241
)
236242
.unwrap(),
237243
)])
@@ -328,20 +334,19 @@ async fn unsupported_protocol_feature_midstream() {
328334
])
329335
.await;
330336

331-
// Second commit: Protocol update with unsupported feature (TypeWidening)
337+
// Second commit: Protocol update with unsupported feature
332338
mock_table
333339
.commit([protocol_action(
334340
3,
335341
7,
336-
Some(vec![TableFeature::TypeWidening]),
337-
Some(vec![TableFeature::TypeWidening]),
342+
Some(vec![TableFeature::unknown("unsupportedFeature")]),
343+
Some(vec![TableFeature::unknown("unsupportedFeature")]),
338344
)])
339345
.await;
340346

341347
assert_midstream_failure(engine, &mock_table);
342348
}
343349

344-
// Note: This should be removed once type widening support is added for CDF
345350
#[tokio::test]
346351
async fn incompatible_schemas_fail() {
347352
async fn assert_incompatible_schema(commit_schema: StructType, cdf_schema: StructType) {

kernel/src/table_changes/mod.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ use crate::snapshot::{Snapshot, SnapshotRef};
4343
use crate::table_configuration::TableConfiguration;
4444
use crate::table_features::Operation;
4545
use crate::table_features::TableFeature;
46-
use crate::table_properties::TableProperties;
47-
use crate::utils::require;
4846
use crate::{DeltaResult, Engine, Error, Version};
4947

5048
mod log_replay;
@@ -169,9 +167,6 @@ impl TableChanges {
169167
// [`check_cdf_table_properties`] to fail early. This also ensures that column mapping is
170168
// disabled.
171169
//
172-
// We also check the [`Protocol`] using [`ensure_cdf_read_supported`] to verify that
173-
// we support CDF with those features enabled.
174-
//
175170
// Note: We must still check each metadata and protocol action in the CDF range.
176171
let check_table_config = |snapshot: &Snapshot| {
177172
if snapshot
@@ -244,17 +239,6 @@ impl TableChanges {
244239
}
245240
}
246241

247-
/// Ensures that change data feed is enabled in `table_properties`. See the documentation
248-
/// of [`TableChanges`] for more details.
249-
// TODO: move to TableProperties and normalize with the check in TableConfiguration
250-
fn check_cdf_table_properties(table_properties: &TableProperties) -> DeltaResult<()> {
251-
require!(
252-
table_properties.enable_change_data_feed.unwrap_or(false),
253-
Error::unsupported("Change data feed is not enabled")
254-
);
255-
Ok(())
256-
}
257-
258242
#[cfg(test)]
259243
mod tests {
260244
use super::*;

0 commit comments

Comments
 (0)