kumarUjjawal commented on code in PR #24916:
URL: https://github.com/apache/datafusion/pull/24916#discussion_r4012676525
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -1099,7 +1099,9 @@ fn coerce_frame_bound(
}
}
-fn extract_window_frame_target_type(col_type: &DataType) -> Result<DataType> {
+/// The type that RANGE frame offsets are coerced to for an ORDER BY column of
+/// `col_type`, or `None` if the type does not support RANGE frames.
Review Comment:
`DataType::is_nested()` does not identify all list element types that
`partial_cmp_list` cannot compare.
For example, it returns false for `Dictionary<Int32, Dictionary<Int8,
Utf8>>`. The leaf type is `Utf8`. As a result, `List<Dictionary<Int32,
Dictionary<Int8, Utf8>>>` passes this guard.
The Arrow `lt` and `eq` kernels unwrap only one dictionary layer. The peer
comparison then fails on the second dictionary layer. The sorter uses
`make_comparator`, which handles dictionary layers recursively.
Thus, `ORDER BY duration, list_of_nested_dictionary` still passes planning
and fails during execution.
Base this guard on the actual scalar-comparison support. For a smaller
change, reject all encoded list elements in this fallback. Add a regression
test for a nested dictionary element.
--
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]