Skip to content

Commit 887ae83

Browse files
committed
Move methods
1 parent b808f00 commit 887ae83

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

core/src/sql/sql_provider_datafusion/federation.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,25 @@ use datafusion::{
1313
arrow::datatypes::SchemaRef,
1414
error::{DataFusionError, Result as DataFusionResult},
1515
physical_plan::{stream::RecordBatchStreamAdapter, SendableRecordBatchStream},
16-
sql::{unparser::dialect::Dialect, TableReference},
16+
sql::{
17+
unparser::dialect::{DefaultDialect, Dialect},
18+
TableReference,
19+
},
1720
};
1821

1922
impl<T, P> SqlTable<T, P> {
23+
// Return the current memory location of the object as a unique identifier
24+
fn unique_id(&self) -> usize {
25+
std::ptr::from_ref(self) as usize
26+
}
27+
28+
fn arc_dialect(&self) -> Arc<dyn Dialect + Send + Sync> {
29+
match &self.dialect {
30+
Some(dialect) => Arc::clone(dialect),
31+
None => Arc::new(DefaultDialect {}),
32+
}
33+
}
34+
2035
fn create_federated_table_source(
2136
self: Arc<Self>,
2237
) -> DataFusionResult<Arc<dyn FederatedTableSource>> {

core/src/sql/sql_provider_datafusion/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ impl<T, P> SqlTable<T, P> {
156156
)?))
157157
}
158158

159-
#[cfg(feature = "federation")]
160-
// Return the current memory location of the object as a unique identifier
161-
fn unique_id(&self) -> usize {
162-
std::ptr::from_ref(self) as usize
163-
}
164-
165159
#[must_use]
166160
pub fn with_dialect(self, dialect: Arc<dyn Dialect + Send + Sync>) -> Self {
167161
Self {
@@ -186,14 +180,6 @@ impl<T, P> SqlTable<T, P> {
186180
None => &DefaultDialect {},
187181
}
188182
}
189-
190-
#[cfg(feature = "federation")]
191-
fn arc_dialect(&self) -> Arc<dyn Dialect + Send + Sync> {
192-
match &self.dialect {
193-
Some(dialect) => Arc::clone(dialect),
194-
None => Arc::new(DefaultDialect {}),
195-
}
196-
}
197183
}
198184

199185
#[async_trait]

0 commit comments

Comments
 (0)