refactor: Remove async from `PartitionChunk::table_schema` (#1060)

pull/24376/head
Andrew Lamb 2021-03-27 14:08:12 -04:00 committed by GitHub
parent 663d4fb6f7
commit 0ca9ad7285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 12 deletions

View File

@ -261,7 +261,6 @@ impl InfluxRPCPlanner {
// get only tag columns from metadata
let schema = chunk
.table_schema(&table_name, Selection::All)
.await
.expect("to be able to get table schema");
let column_names: Vec<&str> = schema
.tags_iter()
@ -367,7 +366,6 @@ impl InfluxRPCPlanner {
// use schema to validate column type
let schema = chunk
.table_schema(&table_name, Selection::All)
.await
.expect("to be able to get table schema");
// Skip this table if the tag_name is not a column in this table
@ -1150,7 +1148,6 @@ impl InfluxRPCPlanner {
let chunk_table_schema = chunk
.table_schema(table_name, selection)
.await
.map_err(|e| Box::new(e) as _)
.context(GettingTableSchema {
table_name,

View File

@ -117,7 +117,6 @@ impl SQLQueryPlanner {
let chunk_id = chunk.id();
let chunk_table_schema = chunk
.table_schema(table_name, Selection::All)
.await
.map_err(|e| Box::new(e) as _)
.context(GettingTableSchema {
table_name,

View File

@ -120,7 +120,7 @@ pub trait PartitionChunk: Debug + Send + Sync {
/// Returns the Schema for a table in this chunk, with the
/// specified column selection. An error is returned if the
/// selection refers to columns that do not exist.
async fn table_schema(
fn table_schema(
&self,
table_name: &str,
selection: Selection<'_>,

View File

@ -390,7 +390,7 @@ impl PartitionChunk for TestChunk {
Ok(Some(names))
}
async fn table_schema(
fn table_schema(
&self,
table_name: &str,
selection: Selection<'_>,

View File

@ -242,7 +242,7 @@ impl PartitionChunk for DBChunk {
Ok(names)
}
async fn table_schema(
fn table_schema(
&self,
table_name: &str,
selection: Selection<'_>,
@ -323,7 +323,7 @@ impl PartitionChunk for DBChunk {
}
.fail();
}
let schema: Schema = self.table_schema(table_name, selection).await?;
let schema: Schema = self.table_schema(table_name, selection)?;
Ok(Box::pin(MutableBufferChunkStream::new(
Arc::clone(&chunk),

View File

@ -35,10 +35,8 @@ macro_rules! run_table_schema_test_case {
for chunk in db.chunks(&partition_key) {
if chunk.has_table(table_name) {
chunks_with_table += 1;
let actual_schema = chunk
.table_schema(table_name, selection.clone())
.await
.unwrap();
let actual_schema =
chunk.table_schema(table_name, selection.clone()).unwrap();
assert_eq!(
expected_schema,