Skip to content

Commit 242fb76

Browse files
alambtimsaucer
andauthored
[branch-53] fix: foreign inner ffi types (#21439) (#21524)
- Part of #21079 - Closes #21155 on branch-53 This PR: - Backports #21439 from @timsaucer to the branch-53 line Co-authored-by: Tim Saucer <timsaucer@gmail.com>
1 parent 6fc7114 commit 242fb76

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

datafusion/ffi/src/catalog_provider.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ impl FFI_CatalogProvider {
250250
runtime: Option<Handle>,
251251
logical_codec: FFI_LogicalExtensionCodec,
252252
) -> Self {
253+
if let Some(provider) = provider.as_any().downcast_ref::<ForeignCatalogProvider>()
254+
{
255+
return provider.0.clone();
256+
}
257+
253258
let private_data = Box::new(ProviderPrivateData { provider, runtime });
254259

255260
Self {

datafusion/ffi/src/schema_provider.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ impl FFI_SchemaProvider {
259259
runtime: Option<Handle>,
260260
logical_codec: FFI_LogicalExtensionCodec,
261261
) -> Self {
262+
if let Some(provider) = provider.as_any().downcast_ref::<ForeignSchemaProvider>()
263+
{
264+
return provider.0.clone();
265+
}
266+
262267
let owner_name = provider.owner_name().map(|s| s.into()).into();
263268
let private_data = Box::new(ProviderPrivateData { provider, runtime });
264269

datafusion/ffi/src/table_provider.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ impl FFI_TableProvider {
391391
runtime: Option<Handle>,
392392
logical_codec: FFI_LogicalExtensionCodec,
393393
) -> Self {
394+
if let Some(provider) = provider.as_any().downcast_ref::<ForeignTableProvider>() {
395+
return provider.0.clone();
396+
}
394397
let private_data = Box::new(ProviderPrivateData { provider, runtime });
395398

396399
Self {

0 commit comments

Comments
 (0)