Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 55 additions & 152 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ edition = { workspace = true }
publish = false

[dependencies]
abi_stable = "0.11.3"
arrow = { workspace = true }
datafusion = { workspace = true }
datafusion-ffi = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@

use std::sync::Arc;

use abi_stable::{export_root_module, prefix_type::PrefixTypeTrait};
use arrow::array::RecordBatch;
use arrow::datatypes::{DataType, Field, Schema};
use datafusion::{common::record_batch, datasource::MemTable};
use datafusion_ffi::proto::logical_extension_codec::FFI_LogicalExtensionCodec;
use datafusion_ffi::table_provider::FFI_TableProvider;
use ffi_module_interface::{TableProviderModule, TableProviderModuleRef};
use ffi_module_interface::TableProviderModule;

fn create_record_batch(start_value: i32, num_values: usize) -> RecordBatch {
let end_value = start_value + num_values as i32;
Expand Down Expand Up @@ -56,11 +55,10 @@ extern "C" fn construct_simple_table_provider(
FFI_TableProvider::new_with_ffi_codec(Arc::new(table_provider), true, None, codec)
}

#[export_root_module]
/// This defines the entry point for using the module.
pub fn get_simple_memory_table() -> TableProviderModuleRef {
#[unsafe(no_mangle)]
pub extern "C" fn ffi_example_get_module() -> TableProviderModule {
TableProviderModule {
create_table: construct_simple_table_provider,
}
.leak_into_prefix()
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ publish = false
workspace = true

[dependencies]
abi_stable = "0.11.3"
datafusion-ffi = { workspace = true }
Loading
Loading