File tree 2 files changed +53
-4
lines changed
physical-expr/src/expressions
2 files changed +53
-4
lines changed Original file line number Diff line number Diff line change @@ -318,10 +318,14 @@ impl PhysicalExpr for BinaryExpr {
318
318
// Attempt to use special kernels if one input is scalar and the other is an array
319
319
let scalar_result = match ( & lhs, & rhs) {
320
320
( ColumnarValue :: Array ( array) , ColumnarValue :: Scalar ( scalar) ) => {
321
- // if left is array and right is literal - use scalar operations
322
- self . evaluate_array_scalar ( array, scalar. clone ( ) ) ?. map ( |r| {
323
- r. and_then ( |a| to_result_type_array ( & self . op , a, & result_type) )
324
- } )
321
+ // if left is array and right is literal(not NULL) - use scalar operations
322
+ if scalar. is_null ( ) {
323
+ None
324
+ } else {
325
+ self . evaluate_array_scalar ( array, scalar. clone ( ) ) ?. map ( |r| {
326
+ r. and_then ( |a| to_result_type_array ( & self . op , a, & result_type) )
327
+ } )
328
+ }
325
329
}
326
330
( _, _) => None , // default to array implementation
327
331
} ;
Original file line number Diff line number Diff line change 48
48
true
49
49
true
50
50
51
+ query B
52
+ SELECT str ~ NULL FROM t;
53
+ ----
54
+ NULL
55
+ NULL
56
+ NULL
57
+ NULL
58
+ NULL
59
+ NULL
60
+ NULL
61
+ NULL
62
+ NULL
63
+ NULL
64
+ NULL
65
+
66
+ query B
67
+ select str ~ right('foo', NULL) FROM t;
68
+ ----
69
+ NULL
70
+ NULL
71
+ NULL
72
+ NULL
73
+ NULL
74
+ NULL
75
+ NULL
76
+ NULL
77
+ NULL
78
+ NULL
79
+ NULL
80
+
81
+ query B
82
+ select right('foo', NULL) !~ str FROM t;
83
+ ----
84
+ NULL
85
+ NULL
86
+ NULL
87
+ NULL
88
+ NULL
89
+ NULL
90
+ NULL
91
+ NULL
92
+ NULL
93
+ NULL
94
+ NULL
95
+
51
96
query B
52
97
SELECT regexp_like('foobarbequebaz', '');
53
98
----
You can’t perform that action at this time.
0 commit comments