jiacai2050 commented on code in PR #1594:
URL: https://github.com/apache/horaedb/pull/1594#discussion_r1849846867
##########
src/partition_table_engine/src/scan_builder.rs:
##########
@@ -89,18 +92,186 @@ impl TableScanBuilder for PartitionedTableScanBuilder {
DataFusionError::Internal(format!("failed to build
partition rule, err:{e}"))
})?;
+ let mut partitioned_key_indices = PartitionedFilterKeyIndex::new();
// Evaluate expr and locate partition.
let partitions = df_partition_rule
- .locate_partitions_for_read(request.predicate.exprs())
+ .locate_partitions_for_read(request.predicate.exprs(), &mut
partitioned_key_indices)
.map_err(|e| {
DataFusionError::Internal(format!("failed to locate partition
for read, err:{e}"))
})?;
+
let sub_tables =
- self.get_sub_table_idents(&self.table_name, &self.partition_info,
partitions);
+ self.get_sub_table_idents(&self.table_name, &self.partition_info,
&partitions);
+
+ let predicates = if partitioned_key_indices.len() == partitions.len() {
+ Some(
+ partitioned_predicates(
+ request.predicate.clone(),
+ &partitions,
+ &mut partitioned_key_indices,
+ )
+ .map_err(|e| DataFusionError::Internal(format!("err:{e}")))?,
Review Comment:
```suggestion
.map_err(|e| DataFusionError::Internal(format!("partition
predicates failed, err:{e}")))?,
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]