HuSen8891 commented on code in PR #11985:
URL: https://github.com/apache/datafusion/pull/11985#discussion_r1717797570
##########
datafusion/expr-common/src/type_coercion/binary.rs:
##########
@@ -1048,11 +1048,23 @@ pub fn like_coercion(lhs_type: &DataType, rhs_type:
&DataType) -> Option<DataTyp
.or_else(|| null_coercion(lhs_type, rhs_type))
}
+/// coercion rules for regular expression comparison operations with NULL
input.
+fn regex_null_coercion(lhs_type: &DataType, rhs_type: &DataType) ->
Option<DataType> {
+ use arrow::datatypes::DataType::*;
+ match (lhs_type, rhs_type) {
+ (DataType::Null, Utf8View | Utf8 | LargeUtf8) =>
Some(rhs_type.clone()),
+ (Utf8View | Utf8 | LargeUtf8, DataType::Null) =>
Some(lhs_type.clone()),
+ (DataType::Null, DataType::Null) => Some(Utf8),
Review Comment:
Here we only accept string and NULL input, not other type, such as select
'abc' ~ null;
But select 1 ~ null is not supported.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]