Skip to content

Commit aee9703

Browse files
committed
添加udf插件加载日志 (#3)
Add print (#4) * 添加更多的日志打印 Add print (#5) * 修复插件加载的bug 删除测试用的日志输出 (#6) 调试bug (#7) Add print for (#8) * 调试bug Add print for (#9) * 调试bug Add print for (#10) * 调试bug 删除测试用的print打印
1 parent 7570fd3 commit aee9703

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

ballista/rust/core/src/serde/physical_plan/from_proto.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,6 @@ impl TryFrom<&protobuf::PhysicalExprNode> for Arc<dyn PhysicalExpr> {
591591
&e.fun_name.to_owned()
592592
))
593593
})?;
594-
595594
let scalar_udf = &*fun.clone();
596595
let args = e
597596
.expr

datafusion/src/plugin/plugin_manager.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ impl GlobalPluginManager {
6262
}
6363
// find library file from udaf_plugin_path
6464
info!("load plugin from dir:{}", plugin_path);
65-
println!("load plugin from dir:{}", plugin_path);
6665

6766
let plugin_files = self.get_all_plugin_files(plugin_path)?;
6867

6968
for plugin_file in plugin_files {
69+
println!("load library :{}", plugin_file.path().to_str().unwrap());
7070
let library = Library::new(plugin_file.path()).map_err(|e| {
7171
DataFusionError::IoError(io::Error::new(
7272
io::ErrorKind::Other,
@@ -82,17 +82,18 @@ impl GlobalPluginManager {
8282
"not found plugin_declaration in the library: {}",
8383
plugin_file.path().to_str().unwrap()
8484
);
85-
return Ok(());
85+
continue;
8686
}
8787

8888
let dec = dec.unwrap().read();
8989

9090
// ersion checks to prevent accidental ABI incompatibilities
9191

9292
if dec.rustc_version != RUSTC_VERSION || dec.core_version != CORE_VERSION {
93+
println!("Version mismatch rustc_version:{}, core_version:{}", RUSTC_VERSION, CORE_VERSION);
9394
return Err(DataFusionError::IoError(io::Error::new(
9495
io::ErrorKind::Other,
95-
"Version mismatch",
96+
format!("Version mismatch rustc_version:{}, core_version:{}", RUSTC_VERSION, CORE_VERSION),
9697
)));
9798
}
9899

@@ -138,10 +139,6 @@ impl GlobalPluginManager {
138139
"load plugin from library file:{}",
139140
item.path().to_str().unwrap()
140141
);
141-
println!(
142-
"load plugin from library file:{}",
143-
item.path().to_str().unwrap()
144-
);
145142
return Some(item);
146143
}
147144
}

datafusion/src/plugin/udf.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ impl PluginRegistrar for UDFPluginManager {
6363
format!("not found fn registrar_udf_plugin in the library: {}", e),
6464
))
6565
})?;
66-
6766
let udf_plugin: Box<dyn UDFPlugin> = register_fun();
6867
udf_plugin
6968
.udf_names()
7069
.unwrap()
7170
.iter()
7271
.try_for_each(|udf_name| {
72+
println!("udf_name: {}", udf_name);
7373
if self.scalar_udfs.contains_key(udf_name) {
74+
println!("udf_name exists");
7475
Err(DataFusionError::IoError(io::Error::new(
7576
io::ErrorKind::Other,
7677
format!("udf name: {} already exists", udf_name),
@@ -88,7 +89,9 @@ impl PluginRegistrar for UDFPluginManager {
8889
.unwrap()
8990
.iter()
9091
.try_for_each(|udaf_name| {
92+
println!("udaf_name: {}", udaf_name);
9193
if self.aggregate_udfs.contains_key(udaf_name) {
94+
println!("udaf_name exists");
9295
Err(DataFusionError::IoError(io::Error::new(
9396
io::ErrorKind::Other,
9497
format!("udaf name: {} already exists", udaf_name),
@@ -101,6 +104,7 @@ impl PluginRegistrar for UDFPluginManager {
101104
Ok(())
102105
}
103106
})?;
107+
self.libraries.push(library);
104108
Ok(())
105109
}
106110

0 commit comments

Comments
 (0)