JingsongLi commented on code in PR #249:
URL: https://github.com/apache/paimon-rust/pull/249#discussion_r3090631724
##########
crates/paimon/src/table/table_read.rs:
##########
@@ -76,17 +77,37 @@ impl<'a> TableRead<'a> {
let deletion_vectors_enabled = core_options.deletion_vectors_enabled();
let data_evolution = core_options.data_evolution_enabled();
+ // PK table without DV: route by merge engine.
+ // Exhaustive match ensures new MergeEngine variants trigger a compile
error.
if has_primary_keys && !deletion_vectors_enabled {
- return Err(Error::Unsupported {
- message: format!(
- "Reading primary-key tables without deletion vectors is
not yet supported. Primary keys: {:?}",
- self.table.schema.primary_keys()
- ),
- });
+ match core_options.merge_engine()? {
+ crate::spec::MergeEngine::Deduplicate => {
+ let reader = KeyValueFileReader::new(
+ self.table.file_io.clone(),
+ KeyValueReadConfig {
+ schema_manager:
self.table.schema_manager().clone(),
+ table_schema_id: self.table.schema().id(),
+ table_fields: self.table.schema.fields().to_vec(),
+ read_type: self.read_type().to_vec(),
+ predicates: self.data_predicates.clone(),
+ primary_keys:
self.table.schema.primary_keys().to_vec(),
+ sequence_fields: core_options
+ .sequence_fields()
+ .iter()
+ .map(|s| s.to_string())
+ .collect(),
+ },
+ );
+ return reader.read(data_splits);
+ }
+ crate::spec::MergeEngine::FirstRow => {
+ // Fall through to DataFileReader — scan already skips
level-0
Review Comment:
This is Paimon's protocol.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]