diff --git a/generated_types/protos/influxdata/iox/catalog/v1/service.proto b/generated_types/protos/influxdata/iox/catalog/v1/service.proto index 0957aaa35e..4cd65b466b 100644 --- a/generated_types/protos/influxdata/iox/catalog/v1/service.proto +++ b/generated_types/protos/influxdata/iox/catalog/v1/service.proto @@ -11,8 +11,8 @@ service CatalogService { // Get the partition catalog records by the table id rpc GetPartitionsByTableId(GetPartitionsByTableIdRequest) returns (GetPartitionsByTableIdResponse); - // Get the parquet_file catalog records in the given database and table name - rpc GetParquetFilesByDatabaseTable(GetParquetFilesByDatabaseTableRequest) returns (GetParquetFilesByDatabaseTableResponse); + // Get the parquet_file catalog records in the given namespace and table name + rpc GetParquetFilesByNamespaceTable(GetParquetFilesByNamespaceTableRequest) returns (GetParquetFilesByNamespaceTableResponse); } message GetParquetFilesByPartitionIdRequest { @@ -51,15 +51,15 @@ message GetPartitionsByTableIdResponse { repeated Partition partitions = 1; } -message GetParquetFilesByDatabaseTableRequest { - // the database name - string database_name = 1; +message GetParquetFilesByNamespaceTableRequest { + // the namespace name + string namespace_name = 1; - // the table name in the database + // the table name in the namespace string table_name = 2; } -message GetParquetFilesByDatabaseTableResponse { - // the parquet_file records in the table in the database +message GetParquetFilesByNamespaceTableResponse { + // the parquet_file records in the table in the namespace repeated ParquetFile parquet_files = 1; } diff --git a/influxdb_iox/src/commands/remote/store.rs b/influxdb_iox/src/commands/remote/store.rs index f143ffbece..6b35f313e8 100644 --- a/influxdb_iox/src/commands/remote/store.rs +++ b/influxdb_iox/src/commands/remote/store.rs @@ -41,13 +41,12 @@ struct Get { file_name: String, } -/// Get all the Parquet files for a particular database's table -/// into a local directory +/// Get all the Parquet files for a particular namespace's table into a local directory #[derive(Debug, clap::Parser)] struct GetTable { - /// The database (namespace) to get the Parquet files for + /// The namespace to get the Parquet files for #[clap(action)] - database: String, + namespace: String, /// The name of the table to get the Parquet files for #[clap(action)] @@ -91,8 +90,8 @@ pub async fn command(connection: Connection, config: Config) -> Result<(), Error let mut store_client = store::Client::new(connection); let parquet_files = catalog_client - .get_parquet_files_by_database_table( - get_table.database.clone(), + .get_parquet_files_by_namespace_table( + get_table.namespace.clone(), get_table.table.clone(), ) .await?; diff --git a/influxdb_iox/tests/end_to_end_cases/remote.rs b/influxdb_iox/tests/end_to_end_cases/remote.rs index 7c49d9e491..0ed1d1f001 100644 --- a/influxdb_iox/tests/end_to_end_cases/remote.rs +++ b/influxdb_iox/tests/end_to_end_cases/remote.rs @@ -131,7 +131,7 @@ async fn remote_store_get_table() { .assert() .failure() .stderr(predicate::str::contains( - "Database nacho-namespace not found", + "Namespace nacho-namespace not found", )); } .boxed() diff --git a/influxdb_iox_client/src/client/catalog.rs b/influxdb_iox_client/src/client/catalog.rs index ddb556cf8f..dece931e1c 100644 --- a/influxdb_iox_client/src/client/catalog.rs +++ b/influxdb_iox_client/src/client/catalog.rs @@ -50,16 +50,16 @@ impl Client { Ok(response.into_inner().partitions) } - /// Get the Parquet file records by their database and table names - pub async fn get_parquet_files_by_database_table( + /// Get the Parquet file records by their namespace and table names + pub async fn get_parquet_files_by_namespace_table( &mut self, - database_name: String, + namespace_name: String, table_name: String, ) -> Result, Error> { let response = self .inner - .get_parquet_files_by_database_table(GetParquetFilesByDatabaseTableRequest { - database_name, + .get_parquet_files_by_namespace_table(GetParquetFilesByNamespaceTableRequest { + namespace_name, table_name, }) .await?; diff --git a/service_grpc_catalog/src/lib.rs b/service_grpc_catalog/src/lib.rs index f329eeda46..aba53f0005 100644 --- a/service_grpc_catalog/src/lib.rs +++ b/service_grpc_catalog/src/lib.rs @@ -81,20 +81,20 @@ impl catalog_service_server::CatalogService for CatalogService { Ok(Response::new(response)) } - async fn get_parquet_files_by_database_table( + async fn get_parquet_files_by_namespace_table( &self, - request: Request, - ) -> Result, Status> { + request: Request, + ) -> Result, Status> { let mut repos = self.catalog.repositories().await; let req = request.into_inner(); let namespace = repos .namespaces() - .get_by_name(&req.database_name) + .get_by_name(&req.namespace_name) .await .map_err(|e| Status::unknown(e.to_string()))? .ok_or_else(|| { - Status::not_found(format!("Database {} not found", req.database_name)) + Status::not_found(format!("Namespace {} not found", req.namespace_name)) })?; let table = repos @@ -113,7 +113,7 @@ impl catalog_service_server::CatalogService for CatalogService { .map_err(|e| { warn!( error=%e, - %req.database_name, + %req.namespace_name, %req.table_name, "failed to get parquet_files for table" ); @@ -122,7 +122,7 @@ impl catalog_service_server::CatalogService for CatalogService { let parquet_files: Vec<_> = parquet_files.into_iter().map(to_parquet_file).collect(); - let response = GetParquetFilesByDatabaseTableResponse { parquet_files }; + let response = GetParquetFilesByNamespaceTableResponse { parquet_files }; Ok(Response::new(response)) }