Skip to content

Commit b494157

Browse files
findepizhuliquan
authored andcommitted
Reveal implementing type and return type in simple UDF implementations (apache#13730)
Debug trait is useful for understanding what something is and how it's configured, especially if the implementation is behind dyn trait.
1 parent ddfc9e5 commit b494157

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

datafusion/expr/src/expr_fn.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,10 @@ pub struct SimpleScalarUDF {
416416

417417
impl Debug for SimpleScalarUDF {
418418
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
419-
f.debug_struct("ScalarUDF")
419+
f.debug_struct("SimpleScalarUDF")
420420
.field("name", &self.name)
421421
.field("signature", &self.signature)
422+
.field("return_type", &self.return_type)
422423
.field("fun", &"<FUNC>")
423424
.finish()
424425
}
@@ -524,9 +525,10 @@ pub struct SimpleAggregateUDF {
524525

525526
impl Debug for SimpleAggregateUDF {
526527
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
527-
f.debug_struct("AggregateUDF")
528+
f.debug_struct("SimpleAggregateUDF")
528529
.field("name", &self.name)
529530
.field("signature", &self.signature)
531+
.field("return_type", &self.return_type)
530532
.field("fun", &"<FUNC>")
531533
.finish()
532534
}

0 commit comments

Comments
 (0)