@@ -47,7 +47,7 @@ use kernels::{
47
47
} ;
48
48
49
49
/// Binary expression
50
- #[ derive( Debug , Clone ) ]
50
+ #[ derive( Clone ) ]
51
51
pub struct BinaryExpr {
52
52
left : Arc < dyn PhysicalExpr > ,
53
53
op : Operator ,
@@ -116,14 +116,14 @@ impl BinaryExpr {
116
116
. downcast_ref :: < Literal > ( )
117
117
. and_then ( |pattern| match pattern. value ( ) {
118
118
ScalarValue :: Utf8 ( pattern) | ScalarValue :: LargeUtf8 ( pattern) => {
119
- pattern. as_ref ( ) . and_then ( |p| {
119
+ pattern. as_ref ( ) . map ( |p| {
120
120
let string_value = match op {
121
121
Operator :: RegexIMatch | Operator :: RegexNotIMatch => {
122
- vec ! [ "(?i)" , p. as_str( ) ] . join ( "" )
122
+ [ "(?i)" , p. as_str ( ) ] . join ( "" )
123
123
}
124
124
_ => p. clone ( ) ,
125
125
} ;
126
- Some ( regex:: Regex :: new ( string_value. as_str ( ) ) . unwrap ( ) )
126
+ regex:: Regex :: new ( string_value. as_str ( ) ) . unwrap ( )
127
127
} )
128
128
}
129
129
_ => None ,
@@ -142,6 +142,17 @@ impl std::hash::Hash for BinaryExpr {
142
142
}
143
143
}
144
144
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
+
145
156
impl std:: fmt:: Display for BinaryExpr {
146
157
fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
147
158
// Put parentheses around child binary expressions so that we can see the difference
0 commit comments