coderfender commented on code in PR #21030:
URL: https://github.com/apache/datafusion/pull/21030#discussion_r2985707196


##########
datafusion-examples/examples/ffi/ffi_module_loader/src/main.rs:
##########
@@ -18,28 +18,47 @@
 use std::sync::Arc;
 
 use datafusion::{
+    datasource::TableProvider,
     error::{DataFusionError, Result},
+    execution::TaskContextProvider,
     prelude::SessionContext,
 };
-
-use abi_stable::library::{RootModule, development_utils::compute_library_path};
-use datafusion::datasource::TableProvider;
-use datafusion::execution::TaskContextProvider;
 use datafusion_ffi::proto::logical_extension_codec::FFI_LogicalExtensionCodec;
-use ffi_module_interface::TableProviderModuleRef;
+use ffi_module_interface::TableProviderModule;
 
 #[tokio::main]
 async fn main() -> Result<()> {
     // Find the location of the library. This is specific to the build 
environment,
     // so you will need to change the approach here based on your use case.
-    let target: &std::path::Path = "../../../../target/".as_ref();
-    let library_path = compute_library_path::<TableProviderModuleRef>(target)
-        .map_err(|e| DataFusionError::External(Box::new(e)))?;
+    let lib_prefix = if cfg!(target_os = "windows") {
+        ""
+    } else {
+        "lib"
+    };
+    let lib_ext = if cfg!(target_os = "macos") {
+        "dylib"
+    } else if cfg!(target_os = "windows") {
+        "dll"
+    } else {
+        "so"
+    };
+
+    let library_path = format!(
+        
"../../../../target/debug/{lib_prefix}ffi_example_table_provider.{lib_ext}"
+    );

Review Comment:
   True . I never updated this part of logic for non debug / release builds and 
fixed it in the latest commit



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to