Skip to content
Merged
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
4 changes: 3 additions & 1 deletion datafusion/src/plugin/plugin_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl GlobalPluginManager {
let plugin_files = self.get_all_plugin_files(plugin_path)?;

for plugin_file in plugin_files {
println!("load library :{}", plugin_file.path().to_str().unwrap());
let library = Library::new(plugin_file.path()).map_err(|e| {
DataFusionError::IoError(io::Error::new(
io::ErrorKind::Other,
Expand All @@ -90,9 +91,10 @@ impl GlobalPluginManager {
// ersion checks to prevent accidental ABI incompatibilities

if dec.rustc_version != RUSTC_VERSION || dec.core_version != CORE_VERSION {
println!("Version mismatch rustc_version:{}, core_version:{}", RUSTC_VERSION, CORE_VERSION);
return Err(DataFusionError::IoError(io::Error::new(
io::ErrorKind::Other,
"Version mismatch",
format!("Version mismatch rustc_version:{}, core_version:{}", RUSTC_VERSION, CORE_VERSION),
)));
}

Expand Down
7 changes: 6 additions & 1 deletion datafusion/src/plugin/udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ impl PluginRegistrar for UDFPluginManager {
format!("not found fn registrar_udf_plugin in the library: {}", e),
))
})?;

println!("1111111111111111111111");
let udf_plugin: Box<dyn UDFPlugin> = register_fun();
udf_plugin
.udf_names()
.unwrap()
.iter()
.try_for_each(|udf_name| {
println!("udf_name: {}", udf_name);
if self.scalar_udfs.contains_key(udf_name) {
println!("udf_name exists");
Err(DataFusionError::IoError(io::Error::new(
io::ErrorKind::Other,
format!("udf name: {} already exists", udf_name),
Expand All @@ -88,7 +90,9 @@ impl PluginRegistrar for UDFPluginManager {
.unwrap()
.iter()
.try_for_each(|udaf_name| {
println!("udaf_name: {}", udaf_name);
if self.aggregate_udfs.contains_key(udaf_name) {
println!("udaf_name exists");
Err(DataFusionError::IoError(io::Error::new(
io::ErrorKind::Other,
format!("udaf name: {} already exists", udaf_name),
Expand Down Expand Up @@ -124,6 +128,7 @@ macro_rules! declare_udf_plugin {
// make sure the constructor is the correct type.
let constructor: fn() -> $curr_plugin_type = $constructor;
let object = constructor();
println!("I be called");
Box::new(object)
}

Expand Down