Skip to content

Commit

Permalink
Merge pull request databendlabs#2285 from drmingdrmer/rm-db-engine
Browse files Browse the repository at this point in the history
[query] refactor: remove ExampleDatabase and ExampleDatabaseEngine
  • Loading branch information
databend-bot authored Oct 17, 2021
2 parents a3c33e2 + a9fd281 commit 98e0774
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 171 deletions.
116 changes: 0 additions & 116 deletions query/src/datasources/database/example/example_database.rs

This file was deleted.

46 changes: 0 additions & 46 deletions query/src/datasources/database/example/example_databases.rs

This file was deleted.

4 changes: 0 additions & 4 deletions query/src/datasources/database/example/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod example_database;
mod example_databases;
mod example_table;

pub use example_database::ExampleDatabase;
pub use example_databases::ExampleDatabaseEngine;
pub use example_table::ExampleTable;
3 changes: 1 addition & 2 deletions query/src/datasources/database/system/engines_table_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ async fn test_engines_table() -> Result<()> {
let result = stream.try_collect::<Vec<_>>().await?;
let block = &result[0];
assert_eq!(block.num_columns(), 2);
assert_eq!(block.num_rows(), 3);
assert_eq!(block.num_rows(), 2);
// TODO rename to databend after merge
let expected = vec![
"+---------+-----------------------------------------------------------------------------------------------+",
"| name | description |",
"+---------+-----------------------------------------------------------------------------------------------+",
"| DEFAULT | default database engine, with embedded metastore backend |",
"| EXAMPLE | The example engine is used by example databases and tables. |",
"| SYSTEM | The system engine is used by tables in the system database, which store Databend information. |",
"+---------+-----------------------------------------------------------------------------------------------+",
];
Expand Down
4 changes: 1 addition & 3 deletions query/src/sessions/sessions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ use futures::future::Either;
use metrics::counter;

use crate::catalogs::impls::DatabaseCatalog;
use crate::catalogs::Catalog;
use crate::clusters::ClusterDiscovery;
use crate::clusters::ClusterDiscoveryRef;
use crate::configs::Config;
use crate::datasources::database::example::ExampleDatabaseEngine;
use crate::sessions::session::Session;
use crate::sessions::session_ref::SessionRef;
use crate::users::UserManager;
Expand All @@ -53,7 +51,7 @@ pub type SessionManagerRef = Arc<SessionManager>;
impl SessionManager {
pub async fn from_conf(conf: Config) -> Result<SessionManagerRef> {
let catalog = Arc::new(DatabaseCatalog::try_create_with_config(conf.clone())?);
catalog.register_db_engine("example", Arc::new(ExampleDatabaseEngine::create()))?;
// catalog.register_db_engine("example", Arc::new(ExampleDatabaseEngine::create()))?;

// Cluster discovery.
let discovery = ClusterDiscovery::create_global(conf.clone()).await?;
Expand Down

0 comments on commit 98e0774

Please sign in to comment.