thorfour commented on code in PR #24565:
URL: https://github.com/apache/datafusion/pull/24565#discussion_r3844118592
##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -1617,6 +1630,38 @@ mod tests {
);
}
+ #[test]
+ fn test_coerced_from_run_end_encoded() {
+ let run_end_encoded_of = |value_type: DataType| {
+ DataType::RunEndEncoded(
+ Field::new("run_ends", DataType::Int32, false).into(),
+ Field::new("values", value_type, true).into(),
+ )
+ };
+
+ let type_into = run_end_encoded_of(DataType::UInt32);
+ let type_from = DataType::Int64;
+ assert_eq!(coerced_from(&type_into, &type_from), None);
+
+ let type_from = run_end_encoded_of(DataType::UInt32);
+ let type_into = DataType::Int64;
+ assert_eq!(
+ coerced_from(&type_into, &type_from),
+ Some(type_into.clone())
+ );
+
+ // Signature candidates for functions like `date_bin` are plain
+ // Timestamp, but a REE-encoded column (e.g. a segment written with
+ // REE-dict encoding for that field) should still coerce against
+ // them via the wrapped value type.
+ let type_from =
run_end_encoded_of(DataType::Timestamp(TimeUnit::Nanosecond, None));
Review Comment:
Fixed
--
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]