|
31 | 31 | //! let table_change_batches = table_changes_scan.execute(engine.clone())?;
|
32 | 32 | //! # Ok::<(), Error>(())
|
33 | 33 | //! ```
|
34 |
| -use std::collections::HashSet; |
35 | 34 | use std::sync::{Arc, LazyLock};
|
36 | 35 |
|
37 | 36 | use scan::TableChangesScanBuilder;
|
38 | 37 | use url::Url;
|
39 | 38 |
|
40 |
| -use crate::actions::{ensure_supported_features, Protocol}; |
41 | 39 | use crate::log_segment::LogSegment;
|
42 | 40 | use crate::path::AsUrl;
|
43 | 41 | use crate::schema::{DataType, Schema, StructField, StructType};
|
44 | 42 | use crate::snapshot::Snapshot;
|
45 | 43 | use crate::table_configuration::TableConfiguration;
|
46 |
| -use crate::table_features::{ColumnMappingMode, ReaderFeatures}; |
47 |
| -use crate::table_properties::TableProperties; |
48 |
| -use crate::utils::require; |
49 | 44 | use crate::{DeltaResult, Engine, Error, Version};
|
50 | 45 |
|
51 | 46 | mod log_replay;
|
@@ -234,42 +229,6 @@ impl TableChanges {
|
234 | 229 | }
|
235 | 230 | }
|
236 | 231 |
|
237 |
| -/// Ensures that change data feed is enabled in `table_properties`. See the documentation |
238 |
| -/// of [`TableChanges`] for more details. |
239 |
| -fn check_cdf_table_properties(table_properties: &TableProperties) -> DeltaResult<()> { |
240 |
| - require!( |
241 |
| - table_properties.enable_change_data_feed.unwrap_or(false), |
242 |
| - Error::unsupported("Change data feed is not enabled") |
243 |
| - ); |
244 |
| - require!( |
245 |
| - matches!( |
246 |
| - table_properties.column_mapping_mode, |
247 |
| - None | Some(ColumnMappingMode::None) |
248 |
| - ), |
249 |
| - Error::unsupported("Change data feed not supported when column mapping is enabled") |
250 |
| - ); |
251 |
| - Ok(()) |
252 |
| -} |
253 |
| - |
254 |
| -/// Ensures that Change Data Feed is supported for a table with this [`Protocol`] . |
255 |
| -/// See the documentation of [`TableChanges`] for more details. |
256 |
| -fn ensure_cdf_read_supported(protocol: &Protocol) -> DeltaResult<()> { |
257 |
| - static CDF_SUPPORTED_READER_FEATURES: LazyLock<HashSet<ReaderFeatures>> = |
258 |
| - LazyLock::new(|| HashSet::from([ReaderFeatures::DeletionVectors])); |
259 |
| - match &protocol.reader_features() { |
260 |
| - // if min_reader_version = 3 and all reader features are subset of supported => OK |
261 |
| - Some(reader_features) if protocol.min_reader_version() == 3 => { |
262 |
| - ensure_supported_features(reader_features, &CDF_SUPPORTED_READER_FEATURES) |
263 |
| - } |
264 |
| - // if min_reader_version = 1 and there are no reader features => OK |
265 |
| - None if protocol.min_reader_version() == 1 => Ok(()), |
266 |
| - // any other protocol is not supported |
267 |
| - _ => Err(Error::unsupported( |
268 |
| - "Change data feed not supported on this protocol", |
269 |
| - )), |
270 |
| - } |
271 |
| -} |
272 |
| - |
273 | 232 | #[cfg(test)]
|
274 | 233 | mod tests {
|
275 | 234 | use crate::engine::sync::SyncEngine;
|
|
0 commit comments