Skip to content

Commit 06343d2

Browse files
SQLTableSource accepts anything that implement Into<RemoteTableRef>
1 parent 4599c0d commit 06343d2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

datafusion-federation/src/sql/table.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ impl SQLTableSource {
125125
// creates a SQLTableSource and infers the table schema
126126
pub async fn new(
127127
provider: Arc<SQLFederationProvider>,
128-
table_ref: RemoteTableRef,
128+
table_ref: impl Into<RemoteTableRef>,
129129
) -> Result<Self> {
130+
let table_ref = table_ref.into();
130131
let table_name = table_ref.to_quoted_string();
131132
let schema = provider.executor.get_table_schema(&table_name).await?;
132133
Ok(Self::new_with_schema(provider, table_ref, schema))
@@ -135,12 +136,12 @@ impl SQLTableSource {
135136
/// Create a SQLTableSource with a table reference and schema
136137
pub fn new_with_schema(
137138
provider: Arc<SQLFederationProvider>,
138-
table_ref: RemoteTableRef,
139+
table_ref: impl Into<RemoteTableRef>,
139140
schema: SchemaRef,
140141
) -> Self {
141142
Self {
142143
provider,
143-
table: Arc::new(RemoteTable::new(table_ref, schema)),
144+
table: Arc::new(RemoteTable::new(table_ref.into(), schema)),
144145
}
145146
}
146147

0 commit comments

Comments
 (0)