Skip to content

Commit 701f09e

Browse files
committed
refactor: Remove unused re-calculate table statistic logic when creating table with snapshot_location
1 parent 04cb8f2 commit 701f09e

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

src/query/service/src/interpreters/interpreter_table_create.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -349,36 +349,6 @@ impl CreateTableInterpreter {
349349
async fn create_table(&self) -> Result<PipelineBuildResult> {
350350
let catalog = self.ctx.get_catalog(self.plan.catalog.as_str()).await?;
351351
let mut stat = None;
352-
if !GlobalConfig::instance().query.management_mode {
353-
if let Some(snapshot_loc) = self.plan.options.get(OPT_KEY_SNAPSHOT_LOCATION) {
354-
// using application level data operator is a temp workaround
355-
// please see discussions https://github.com/datafuselabs/databend/pull/10424
356-
let operator = self.ctx.get_application_level_data_operator()?.operator();
357-
let reader = MetaReaders::table_snapshot_reader(operator);
358-
359-
let params = LoadParams {
360-
location: snapshot_loc.clone(),
361-
len_hint: None,
362-
ver: TableSnapshot::VERSION,
363-
put_cache: true,
364-
};
365-
366-
let snapshot = reader.read(&params).await?;
367-
stat = Some(TableStatistics {
368-
number_of_rows: snapshot.summary.row_count,
369-
data_bytes: snapshot.summary.uncompressed_byte_size,
370-
compressed_data_bytes: snapshot.summary.compressed_byte_size,
371-
index_data_bytes: snapshot.summary.index_size,
372-
bloom_index_size: snapshot.summary.bloom_index_size,
373-
ngram_index_size: snapshot.summary.ngram_index_size,
374-
inverted_index_size: snapshot.summary.inverted_index_size,
375-
vector_index_size: snapshot.summary.vector_index_size,
376-
virtual_column_size: snapshot.summary.virtual_column_size,
377-
number_of_segments: Some(snapshot.segments.len() as u64),
378-
number_of_blocks: Some(snapshot.summary.block_count),
379-
});
380-
}
381-
}
382352
let req = if let Some(storage_prefix) = self.plan.options.get(OPT_KEY_STORAGE_PREFIX) {
383353
self.build_attach_request(storage_prefix).await
384354
} else {

0 commit comments

Comments
 (0)