-
Hi, I'm working on removing old planners. More specifically, I'm try to removing However, there are some code in #[derive(Clone, Default)]
pub struct ClusterStatsGenerator {
cluster_key_id: u32,
cluster_key_index: Vec<usize>,
expression_executor: Option<ExpressionExecutor>,
level: i32,
block_compactor: BlockCompactor,
}
// This can be used in deletion, for an existing block.
pub fn gen_with_origin_stats(
&self,
data_block: &DataBlock,
origin_stats: Option<ClusterStatistics>,
) -> Result<Option<ClusterStatistics>> {
if origin_stats.is_none() {
return Ok(None);
}
let origin_stats = origin_stats.unwrap();
if origin_stats.cluster_key_id != self.cluster_key_id {
return Ok(None);
}
let block = if let Some(executor) = &self.expression_executor {
// For a clustered table, data_block has been sorted, but may not contain cluster key.
// So only need to get the first and the last row for execute.
let indices = vec![0u32, data_block.num_rows() as u32 - 1];
let input = DataBlock::block_take_by_indices(data_block, &indices)?;
executor.execute(&input)?
} else {
data_block.clone()
};
self.clusters_statistics(&block, origin_stats.level)
} The async fn analyze_cluster_keys(
&mut self,
cluster_by: &[Expr<'a>],
schema: DataSchemaRef,
) -> Result<Vec<String>> { .. } ClusterStatsGenerator will use expression_executor to remove unused columns. How can I remove the |
Beta Was this translation helpful? Give feedback.
Answered by
BohuTANG
Sep 11, 2022
Replies: 1 comment 6 replies
-
cc @zhyass for suggestions |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
Xuanwo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cc @zhyass for suggestions