kosiew commented on code in PR #25367:
URL: https://github.com/apache/datafusion/pull/25367#discussion_r4164820026
##########
datafusion/substrait/src/logical_plan/producer/expr/window_function.rs:
##########
@@ -185,7 +176,40 @@ fn to_substrait_bound_offset(value: &ScalarValue) ->
datafusion::common::Result<
#[cfg(test)]
mod tests {
use super::*;
- use datafusion::common::assert_contains;
+ use crate::logical_plan::producer::{DefaultSubstraitProducer,
to_substrait_type};
+ use datafusion::arrow::datatypes::{DataType, Field, Schema};
+ use datafusion::common::{DFSchema, assert_contains};
+ use datafusion::execution::SessionStateBuilder;
+ use datafusion::functions_aggregate::sum::sum_udaf;
+ use datafusion::logical_expr::expr::WindowFunction;
+ use datafusion::prelude::col;
+ use substrait::proto::expression::RexType;
+
+ /// Substrait requires the return type on a window function call, and a
+ /// consumer that reads it rejects the call when it is unset.
+ #[test]
+ fn window_function_output_type() -> datafusion::common::Result<()> {
Review Comment:
Could you also add a `COUNT(*) OVER ()` case, for example using
`count_all_window()`, and assert that its output is required `i64`? The current
test only covers nullable output, so this would catch a regression where
`output_type` is always emitted as nullable.
--
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]