From a3b80888e8630037bd305e02fc4ddbd29f829035 Mon Sep 17 00:00:00 2001 From: Lan Lou Date: Sat, 16 Nov 2024 13:51:49 -0500 Subject: [PATCH] Move storage attribute to mod --- optd-cost-model/src/storage/mod.rs | 15 +++++++++++++-- optd-cost-model/src/storage/persistent.rs | 10 +--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/optd-cost-model/src/storage/mod.rs b/optd-cost-model/src/storage/mod.rs index cf7baf5..78c75cd 100644 --- a/optd-cost-model/src/storage/mod.rs +++ b/optd-cost-model/src/storage/mod.rs @@ -1,10 +1,21 @@ -use persistent::Attribute; +use serde::{Deserialize, Serialize}; -use crate::{common::types::TableId, stats::AttributeCombValueStats, CostModelResult}; +use crate::{ + common::{predicates::constant_pred::ConstantType, types::TableId}, + stats::AttributeCombValueStats, + CostModelResult, +}; pub mod mock; pub mod persistent; +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct Attribute { + pub name: String, + pub typ: ConstantType, + pub nullable: bool, +} + #[trait_variant::make(Send)] pub trait CostModelStorageManager { async fn get_attribute_info( diff --git a/optd-cost-model/src/storage/persistent.rs b/optd-cost-model/src/storage/persistent.rs index c789e7f..53f37da 100644 --- a/optd-cost-model/src/storage/persistent.rs +++ b/optd-cost-model/src/storage/persistent.rs @@ -2,7 +2,6 @@ use std::sync::Arc; use optd_persistent::{cost_model::interface::StatType, CostModelStorageLayer}; -use serde::{Deserialize, Serialize}; use crate::{ common::{predicates::constant_pred::ConstantType, types::TableId}, @@ -10,14 +9,7 @@ use crate::{ CostModelResult, }; -use super::CostModelStorageManager; - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct Attribute { - pub name: String, - pub typ: ConstantType, - pub nullable: bool, -} +use super::{Attribute, CostModelStorageManager}; /// TODO: documentation pub struct CostModelStorageManagerImpl {