Skip to content

Commit a0d3598

Browse files
committed
feat: not debug field precompiled_regexp
1 parent 6f3127d commit a0d3598

File tree

1 file changed

+15
-4
lines changed
  • datafusion/physical-expr/src/expressions

1 file changed

+15
-4
lines changed

datafusion/physical-expr/src/expressions/binary.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use kernels::{
4747
};
4848

4949
/// Binary expression
50-
#[derive(Debug, Clone)]
50+
#[derive(Clone)]
5151
pub struct BinaryExpr {
5252
left: Arc<dyn PhysicalExpr>,
5353
op: Operator,
@@ -116,14 +116,14 @@ impl BinaryExpr {
116116
.downcast_ref::<Literal>()
117117
.and_then(|pattern| match pattern.value() {
118118
ScalarValue::Utf8(pattern) | ScalarValue::LargeUtf8(pattern) => {
119-
pattern.as_ref().and_then(|p| {
119+
pattern.as_ref().map(|p| {
120120
let string_value = match op {
121121
Operator::RegexIMatch | Operator::RegexNotIMatch => {
122-
vec!["(?i)", p.as_str()].join("")
122+
["(?i)", p.as_str()].join("")
123123
}
124124
_ => p.clone(),
125125
};
126-
Some(regex::Regex::new(string_value.as_str()).unwrap())
126+
regex::Regex::new(string_value.as_str()).unwrap()
127127
})
128128
}
129129
_ => None,
@@ -142,6 +142,17 @@ impl std::hash::Hash for BinaryExpr {
142142
}
143143
}
144144

145+
impl std::fmt::Debug for BinaryExpr {
146+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
147+
f.debug_struct("BinaryExpr")
148+
.field("left", &self.left)
149+
.field("op", &self.op)
150+
.field("right", &self.right)
151+
.field("fail_on_overflow", &self.fail_on_overflow)
152+
.finish()
153+
}
154+
}
155+
145156
impl std::fmt::Display for BinaryExpr {
146157
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
147158
// Put parentheses around child binary expressions so that we can see the difference

0 commit comments

Comments
 (0)