From fa2dd1d67c707229f8fc621b986c480093d2e097 Mon Sep 17 00:00:00 2001 From: dantengsky Date: Mon, 5 Aug 2024 22:34:42 +0800 Subject: [PATCH] chore: cargo fmt --- src/query/catalog/src/table.rs | 3 ++- src/query/service/src/test_kits/block_writer.rs | 3 ++- .../src/executor/physical_plans/physical_commit_sink.rs | 3 ++- .../executor/physical_plans/physical_copy_into_table.rs | 2 +- .../sql/src/executor/physical_plans/physical_mutation.rs | 3 ++- .../src/executor/physical_plans/physical_replace_into.rs | 3 ++- src/query/storages/common/table_meta/src/lib.rs | 2 +- src/query/storages/fuse/src/fuse_table.rs | 3 ++- src/query/storages/fuse/src/io/locations.rs | 8 +++----- src/query/storages/fuse/src/io/write/block_writer.rs | 3 ++- src/query/storages/fuse/src/io/write/segment_writer.rs | 3 ++- src/query/storages/fuse/src/operations/commit.rs | 3 ++- .../src/operations/common/generators/append_generator.rs | 3 ++- .../operations/common/generators/mutation_generator.rs | 3 ++- .../operations/common/generators/truncate_generator.rs | 3 ++- .../fuse/src/operations/common/processors/sink_commit.rs | 3 ++- .../common/processors/transform_mutation_aggregator.rs | 3 ++- .../common/processors/transform_serialize_block.rs | 2 +- .../common/processors/transform_serialize_segment.rs | 3 ++- src/query/storages/fuse/src/operations/compact.rs | 3 ++- src/query/storages/fuse/src/operations/merge.rs | 3 ++- src/query/storages/hive/hive/src/hive_table.rs | 3 ++- src/query/storages/memory/src/memory_table.rs | 3 ++- src/query/storages/stage/src/stage_table.rs | 2 +- 24 files changed, 45 insertions(+), 28 deletions(-) diff --git a/src/query/catalog/src/table.rs b/src/query/catalog/src/table.rs index f5eaa81ea577..124bd204a899 100644 --- a/src/query/catalog/src/table.rs +++ b/src/query/catalog/src/table.rs @@ -38,7 +38,8 @@ use databend_common_meta_types::MetaId; use databend_common_pipeline_core::Pipeline; use databend_common_storage::Histogram; use databend_common_storage::StorageMetrics; -use databend_storages_common_table_meta::meta::{SnapshotId, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::SnapshotId; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use databend_storages_common_table_meta::table::ChangeType; diff --git a/src/query/service/src/test_kits/block_writer.rs b/src/query/service/src/test_kits/block_writer.rs index 63f32c388884..901e32d63561 100644 --- a/src/query/service/src/test_kits/block_writer.rs +++ b/src/query/service/src/test_kits/block_writer.rs @@ -26,11 +26,12 @@ use databend_common_storages_fuse::io::WriteSettings; use databend_common_storages_fuse::FuseStorageFormat; use databend_storages_common_blocks::blocks_to_parquet; use databend_storages_common_index::BloomIndex; -use databend_storages_common_table_meta::meta::{BlockMeta, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::BlockMeta; use databend_storages_common_table_meta::meta::ClusterStatistics; use databend_storages_common_table_meta::meta::Compression; use databend_storages_common_table_meta::meta::Location; use databend_storages_common_table_meta::meta::StatisticsOfColumns; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::table::TableCompression; use opendal::Operator; use parquet::format::FileMetaData; diff --git a/src/query/sql/src/executor/physical_plans/physical_commit_sink.rs b/src/query/sql/src/executor/physical_plans/physical_commit_sink.rs index 05efe7201926..76d2b938d828 100644 --- a/src/query/sql/src/executor/physical_plans/physical_commit_sink.rs +++ b/src/query/sql/src/executor/physical_plans/physical_commit_sink.rs @@ -16,8 +16,9 @@ use std::sync::Arc; use databend_common_meta_app::schema::TableInfo; use databend_common_meta_app::schema::UpdateStreamMetaReq; -use databend_storages_common_table_meta::meta::{BlockMeta, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::BlockMeta; use databend_storages_common_table_meta::meta::Statistics; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use crate::executor::physical_plans::common::MutationKind; diff --git a/src/query/sql/src/executor/physical_plans/physical_copy_into_table.rs b/src/query/sql/src/executor/physical_plans/physical_copy_into_table.rs index eedfd3d9649c..e213a9ed3e50 100644 --- a/src/query/sql/src/executor/physical_plans/physical_copy_into_table.rs +++ b/src/query/sql/src/executor/physical_plans/physical_copy_into_table.rs @@ -18,8 +18,8 @@ use databend_common_expression::DataSchemaRef; use databend_common_expression::DataSchemaRefExt; use databend_common_expression::Scalar; use databend_common_meta_app::schema::TableInfo; -use enum_as_inner::EnumAsInner; use databend_storages_common_table_meta::meta::TableMetaTimestamps; +use enum_as_inner::EnumAsInner; use crate::executor::physical_plan::PhysicalPlan; use crate::plans::CopyIntoTableMode; diff --git a/src/query/sql/src/executor/physical_plans/physical_mutation.rs b/src/query/sql/src/executor/physical_plans/physical_mutation.rs index ff38f00dfafa..3a661152dd0d 100644 --- a/src/query/sql/src/executor/physical_plans/physical_mutation.rs +++ b/src/query/sql/src/executor/physical_plans/physical_mutation.rs @@ -38,7 +38,8 @@ use databend_common_expression::PREDICATE_COLUMN_NAME; use databend_common_expression::ROW_ID_COL_NAME; use databend_common_functions::BUILTIN_FUNCTIONS; use databend_common_meta_app::schema::TableInfo; -use databend_storages_common_table_meta::meta::{Location, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::Location; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::NUM_BLOCK_ID_BITS; use databend_storages_common_table_meta::readers::snapshot_reader::TableSnapshotAccessor; use itertools::Itertools; diff --git a/src/query/sql/src/executor/physical_plans/physical_replace_into.rs b/src/query/sql/src/executor/physical_plans/physical_replace_into.rs index f07c539a4e31..75d0af7ac2cd 100644 --- a/src/query/sql/src/executor/physical_plans/physical_replace_into.rs +++ b/src/query/sql/src/executor/physical_plans/physical_replace_into.rs @@ -15,8 +15,9 @@ use databend_common_expression::BlockThresholds; use databend_common_expression::FieldIndex; use databend_common_meta_app::schema::TableInfo; -use databend_storages_common_table_meta::meta::{BlockSlotDescription, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::BlockSlotDescription; use databend_storages_common_table_meta::meta::Location; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use crate::executor::physical_plans::common::OnConflictField; use crate::executor::PhysicalPlan; diff --git a/src/query/storages/common/table_meta/src/lib.rs b/src/query/storages/common/table_meta/src/lib.rs index 56ff665177fd..7212392bd3eb 100644 --- a/src/query/storages/common/table_meta/src/lib.rs +++ b/src/query/storages/common/table_meta/src/lib.rs @@ -21,4 +21,4 @@ pub mod table; mod util; -pub use util::*; \ No newline at end of file +pub use util::*; diff --git a/src/query/storages/fuse/src/fuse_table.rs b/src/query/storages/fuse/src/fuse_table.rs index 59cd5a704c9a..8f28f0d6aca6 100644 --- a/src/query/storages/fuse/src/fuse_table.rs +++ b/src/query/storages/fuse/src/fuse_table.rs @@ -60,9 +60,10 @@ use databend_common_storage::DataOperator; use databend_common_storage::StorageMetrics; use databend_common_storage::StorageMetricsLayer; use databend_storages_common_cache::LoadParams; -use databend_storages_common_table_meta::meta::{ClusterKey, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::ClusterKey; use databend_storages_common_table_meta::meta::SnapshotId; use databend_storages_common_table_meta::meta::Statistics as FuseStatistics; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use databend_storages_common_table_meta::meta::TableSnapshotStatistics; use databend_storages_common_table_meta::meta::Versioned; diff --git a/src/query/storages/fuse/src/io/locations.rs b/src/query/storages/fuse/src/io/locations.rs index e62ce1ee5fca..67f4fdb6f97d 100644 --- a/src/query/storages/fuse/src/io/locations.rs +++ b/src/query/storages/fuse/src/io/locations.rs @@ -16,10 +16,11 @@ use std::marker::PhantomData; use databend_common_exception::Result; use databend_common_expression::DataBlock; -use databend_storages_common_table_meta::meta::{TableMetaTimestamps, uuid_from_date_time}; +use databend_storages_common_table_meta::meta::uuid_from_date_time; use databend_storages_common_table_meta::meta::Location; use databend_storages_common_table_meta::meta::SegmentInfo; use databend_storages_common_table_meta::meta::SnapshotVersion; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshotStatisticsVersion; use databend_storages_common_table_meta::meta::Versioned; use databend_storages_common_table_meta::trim_v5_object_prefix; @@ -111,10 +112,7 @@ impl TableMetaLocationGenerator { ) } - pub fn gen_segment_info_location( - &self, - table_meta_timestamps: TableMetaTimestamps, - ) -> String { + pub fn gen_segment_info_location(&self, table_meta_timestamps: TableMetaTimestamps) -> String { let segment_uuid = uuid_from_date_time(table_meta_timestamps.base_timestamp); format!( "{}/{}/{}{}_v{}.mpk", diff --git a/src/query/storages/fuse/src/io/write/block_writer.rs b/src/query/storages/fuse/src/io/write/block_writer.rs index 2af9d3cfe6e3..f06f6d102df4 100644 --- a/src/query/storages/fuse/src/io/write/block_writer.rs +++ b/src/query/storages/fuse/src/io/write/block_writer.rs @@ -43,10 +43,11 @@ use databend_common_metrics::storage::metrics_inc_block_write_milliseconds; use databend_common_metrics::storage::metrics_inc_block_write_nums; use databend_storages_common_blocks::blocks_to_parquet; use databend_storages_common_index::BloomIndex; -use databend_storages_common_table_meta::meta::{BlockMeta, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::BlockMeta; use databend_storages_common_table_meta::meta::ClusterStatistics; use databend_storages_common_table_meta::meta::ColumnMeta; use databend_storages_common_table_meta::meta::Location; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::table::TableCompression; use log::info; use opendal::Operator; diff --git a/src/query/storages/fuse/src/io/write/segment_writer.rs b/src/query/storages/fuse/src/io/write/segment_writer.rs index a9965ae00053..a723f8ae419f 100644 --- a/src/query/storages/fuse/src/io/write/segment_writer.rs +++ b/src/query/storages/fuse/src/io/write/segment_writer.rs @@ -13,8 +13,9 @@ // limitations under the License. use databend_common_exception::Result; -use databend_storages_common_table_meta::meta::{Location, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::Location; use databend_storages_common_table_meta::meta::SegmentInfo; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::Versioned; use opendal::Operator; diff --git a/src/query/storages/fuse/src/operations/commit.rs b/src/query/storages/fuse/src/operations/commit.rs index 43f1f6d72f7f..1864b6ec45c6 100644 --- a/src/query/storages/fuse/src/operations/commit.rs +++ b/src/query/storages/fuse/src/operations/commit.rs @@ -39,10 +39,11 @@ use databend_common_pipeline_transforms::processors::TransformPipelineHelper; use databend_common_sql::executor::physical_plans::MutationKind; use databend_storages_common_cache::CacheAccessor; use databend_storages_common_cache_manager::CachedObject; -use databend_storages_common_table_meta::meta::{Location, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::Location; use databend_storages_common_table_meta::meta::SegmentInfo; use databend_storages_common_table_meta::meta::SnapshotId; use databend_storages_common_table_meta::meta::Statistics; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use databend_storages_common_table_meta::meta::TableSnapshotStatistics; use databend_storages_common_table_meta::meta::Versioned; diff --git a/src/query/storages/fuse/src/operations/common/generators/append_generator.rs b/src/query/storages/fuse/src/operations/common/generators/append_generator.rs index a462a2096b48..1db6bfbad714 100644 --- a/src/query/storages/fuse/src/operations/common/generators/append_generator.rs +++ b/src/query/storages/fuse/src/operations/common/generators/append_generator.rs @@ -25,9 +25,10 @@ use databend_common_expression::Scalar; use databend_common_expression::TableDataType; use databend_common_expression::TableSchema; use databend_common_sql::field_default_value; -use databend_storages_common_table_meta::meta::{ClusterKey, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::ClusterKey; use databend_storages_common_table_meta::meta::ColumnStatistics; use databend_storages_common_table_meta::meta::Statistics; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use log::info; use log::warn; diff --git a/src/query/storages/fuse/src/operations/common/generators/mutation_generator.rs b/src/query/storages/fuse/src/operations/common/generators/mutation_generator.rs index a36d71a2939a..776426bb87d2 100644 --- a/src/query/storages/fuse/src/operations/common/generators/mutation_generator.rs +++ b/src/query/storages/fuse/src/operations/common/generators/mutation_generator.rs @@ -20,7 +20,8 @@ use databend_common_exception::Result; use databend_common_expression::TableSchema; use databend_common_metrics::storage::*; use databend_common_sql::executor::physical_plans::MutationKind; -use databend_storages_common_table_meta::meta::{ClusterKey, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::ClusterKey; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use databend_storages_common_table_meta::readers::snapshot_reader::TableSnapshotAccessor; use log::info; diff --git a/src/query/storages/fuse/src/operations/common/generators/truncate_generator.rs b/src/query/storages/fuse/src/operations/common/generators/truncate_generator.rs index 44f401758ec8..cc0eb69ba116 100644 --- a/src/query/storages/fuse/src/operations/common/generators/truncate_generator.rs +++ b/src/query/storages/fuse/src/operations/common/generators/truncate_generator.rs @@ -17,7 +17,8 @@ use std::sync::Arc; use databend_common_exception::Result; use databend_common_expression::TableSchema; -use databend_storages_common_table_meta::meta::{ClusterKey, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::ClusterKey; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use crate::operations::common::SnapshotGenerator; diff --git a/src/query/storages/fuse/src/operations/common/processors/sink_commit.rs b/src/query/storages/fuse/src/operations/common/processors/sink_commit.rs index e59206e64109..9184b36ff199 100644 --- a/src/query/storages/fuse/src/operations/common/processors/sink_commit.rs +++ b/src/query/storages/fuse/src/operations/common/processors/sink_commit.rs @@ -34,9 +34,10 @@ use databend_common_pipeline_core::processors::Event; use databend_common_pipeline_core::processors::InputPort; use databend_common_pipeline_core::processors::Processor; use databend_common_pipeline_core::processors::ProcessorPtr; -use databend_storages_common_table_meta::meta::{ClusterKey, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::ClusterKey; use databend_storages_common_table_meta::meta::Location; use databend_storages_common_table_meta::meta::SnapshotId; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use databend_storages_common_table_meta::meta::Versioned; use log::debug; diff --git a/src/query/storages/fuse/src/operations/common/processors/transform_mutation_aggregator.rs b/src/query/storages/fuse/src/operations/common/processors/transform_mutation_aggregator.rs index 0923f563a483..2c5142ead84f 100644 --- a/src/query/storages/fuse/src/operations/common/processors/transform_mutation_aggregator.rs +++ b/src/query/storages/fuse/src/operations/common/processors/transform_mutation_aggregator.rs @@ -29,10 +29,11 @@ use databend_common_expression::TableSchemaRef; use databend_common_metrics::storage::metrics_inc_recluster_write_block_nums; use databend_common_pipeline_transforms::processors::AsyncAccumulatingTransform; use databend_common_sql::executor::physical_plans::MutationKind; -use databend_storages_common_table_meta::meta::{BlockMeta, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::BlockMeta; use databend_storages_common_table_meta::meta::Location; use databend_storages_common_table_meta::meta::SegmentInfo; use databend_storages_common_table_meta::meta::Statistics; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::Versioned; use itertools::Itertools; use log::debug; diff --git a/src/query/storages/fuse/src/operations/common/processors/transform_serialize_block.rs b/src/query/storages/fuse/src/operations/common/processors/transform_serialize_block.rs index 28eb20da350f..40107867aae5 100644 --- a/src/query/storages/fuse/src/operations/common/processors/transform_serialize_block.rs +++ b/src/query/storages/fuse/src/operations/common/processors/transform_serialize_block.rs @@ -32,8 +32,8 @@ use databend_common_pipeline_core::processors::ProcessorPtr; use databend_common_pipeline_core::PipeItem; use databend_common_sql::executor::physical_plans::MutationKind; use databend_storages_common_index::BloomIndex; -use opendal::Operator; use databend_storages_common_table_meta::meta::TableMetaTimestamps; +use opendal::Operator; use crate::io::create_inverted_index_builders; use crate::io::BlockBuilder; diff --git a/src/query/storages/fuse/src/operations/common/processors/transform_serialize_segment.rs b/src/query/storages/fuse/src/operations/common/processors/transform_serialize_segment.rs index 83204922c1c1..7dff8e9773e2 100644 --- a/src/query/storages/fuse/src/operations/common/processors/transform_serialize_segment.rs +++ b/src/query/storages/fuse/src/operations/common/processors/transform_serialize_segment.rs @@ -29,8 +29,9 @@ use databend_common_pipeline_core::processors::ProcessorPtr; use databend_common_pipeline_core::PipeItem; use databend_storages_common_cache::CacheAccessor; use databend_storages_common_cache_manager::CachedObject; -use databend_storages_common_table_meta::meta::{BlockMeta, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::BlockMeta; use databend_storages_common_table_meta::meta::SegmentInfo; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::Versioned; use log::info; use opendal::Operator; diff --git a/src/query/storages/fuse/src/operations/compact.rs b/src/query/storages/fuse/src/operations/compact.rs index 8c6dfdf4951c..2e9edc6d9ac0 100644 --- a/src/query/storages/fuse/src/operations/compact.rs +++ b/src/query/storages/fuse/src/operations/compact.rs @@ -30,7 +30,8 @@ use databend_common_pipeline_core::Pipeline; use databend_common_pipeline_transforms::processors::TransformPipelineHelper; use databend_common_sql::executor::physical_plans::MutationKind; use databend_common_sql::StreamContext; -use databend_storages_common_table_meta::meta::{Statistics, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::Statistics; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; use crate::operations::common::TableMutationAggregator; diff --git a/src/query/storages/fuse/src/operations/merge.rs b/src/query/storages/fuse/src/operations/merge.rs index ad962385a095..309cee80a714 100644 --- a/src/query/storages/fuse/src/operations/merge.rs +++ b/src/query/storages/fuse/src/operations/merge.rs @@ -21,7 +21,8 @@ use databend_common_exception::Result; use databend_common_expression::TableSchemaRef; use databend_common_pipeline_core::PipeItem; use databend_storages_common_index::BloomIndex; -use databend_storages_common_table_meta::meta::{Location, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::Location; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use super::merge_into::MatchedAggregator; use super::mutation::SegmentIndex; diff --git a/src/query/storages/hive/hive/src/hive_table.rs b/src/query/storages/hive/hive/src/hive_table.rs index f07c97e8aa8f..0e475b45d1b5 100644 --- a/src/query/storages/hive/hive/src/hive_table.rs +++ b/src/query/storages/hive/hive/src/hive_table.rs @@ -52,8 +52,9 @@ use databend_common_pipeline_sources::SyncSourcer; use databend_common_storage::init_operator; use databend_common_storage::DataOperator; use databend_storages_common_index::RangeIndex; -use databend_storages_common_table_meta::meta::{SnapshotId, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::SnapshotId; use databend_storages_common_table_meta::meta::StatisticsOfColumns; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::table::ChangeType; use futures::TryStreamExt; use log::info; diff --git a/src/query/storages/memory/src/memory_table.rs b/src/query/storages/memory/src/memory_table.rs index 7de03da7fe17..9087c92e5a50 100644 --- a/src/query/storages/memory/src/memory_table.rs +++ b/src/query/storages/memory/src/memory_table.rs @@ -50,7 +50,8 @@ use databend_common_pipeline_sinks::Sinker; use databend_common_pipeline_sources::SyncSource; use databend_common_pipeline_sources::SyncSourcer; use databend_common_storage::StorageMetrics; -use databend_storages_common_table_meta::meta::{SnapshotId, TableMetaTimestamps}; +use databend_storages_common_table_meta::meta::SnapshotId; +use databend_storages_common_table_meta::meta::TableMetaTimestamps; use parking_lot::Mutex; use parking_lot::RwLock; diff --git a/src/query/storages/stage/src/stage_table.rs b/src/query/storages/stage/src/stage_table.rs index 1c77d97f4e00..830d8081519b 100644 --- a/src/query/storages/stage/src/stage_table.rs +++ b/src/query/storages/stage/src/stage_table.rs @@ -37,8 +37,8 @@ use databend_common_storage::StageFileInfo; use databend_common_storages_orc::OrcTableForCopy; use databend_common_storages_parquet::ParquetTableForCopy; use databend_storages_common_stage::SingleFilePartition; -use opendal::Operator; use databend_storages_common_table_meta::meta::TableMetaTimestamps; +use opendal::Operator; use crate::read::row_based::RowBasedReadPipelineBuilder;