2010YOUY01 opened a new issue, #12057:
URL: https://github.com/apache/datafusion/issues/12057

   ### Describe the bug
   
   The below query caused a panic.
   ```
   SELECT
     sum(1) OVER (
       PARTITION BY false=false
     )
   FROM
     t1
   WHERE
     ((false > (v1 = v1)) IS DISTINCT FROM true);
   ```
   
   This bug is triggered quite often in the fuzzer after window function is 
added, I think this bug is related to repartition execution in window functions 
(which is common execution logic, not function specific), see stack trace below.
   
   ### To Reproduce
   
   Run datafusion-cli under latest main (commit 574dfeb29)
   ```
   DataFusion CLI v41.0.0
   > create table t1(v1 int);
   0 row(s) fetched.
   Elapsed 0.065 seconds.
   
   > insert into t1 values (42);
   +-------+
   | count |
   +-------+
   | 1     |
   +-------+
   1 row(s) fetched.
   Elapsed 0.049 seconds.
   
   > SELECT
     sum(1) OVER (
       PARTITION BY false=false
     )
   FROM
     t1
   WHERE
     ((false > (v1 = v1)) IS DISTINCT FROM true);
   
   thread 'tokio-runtime-worker' panicked at 
/Users/yongting/Desktop/code/my_datafusion/arrow-datafusion/datafusion/physical-plan/src/repartition/mod.rs:313:79:
   called `Result::unwrap()` on an `Err` value: InvalidArgumentError("must 
either specify a row count or at least one column")
   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
   Join Error
   caused by
   External error: task 29 panicked
   
   stack backtrace:
      0: rust_begin_unwind
                at 
/rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:652:5
      1: core::panicking::panic_fmt
                at 
/rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/panicking.rs:72:14
      2: core::result::unwrap_failed
                at 
/rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/result.rs:1679:5
      3: core::result::Result<T,E>::unwrap
                at 
/rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/result.rs:1102:23
      4: 
datafusion_physical_plan::repartition::BatchPartitioner::partition_iter::{{closure}}
                at 
/Users/yongting/Desktop/code/my_datafusion/arrow-datafusion/datafusion/physical-plan/src/repartition/mod.rs:313:33
      5: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for 
&mut F>::call_once
                at 
/rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/ops/function.rs:305:13
      6: core::option::Option<T>::map
                at 
/rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/option.rs:1075:29
      7: <core::iter::adapters::map::Map<I,F> as 
core::iter::traits::iterator::Iterator>::next
                at 
/rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/iter/adapters/map.rs:108:26
      8: <alloc::boxed::Box<I,A> as 
core::iter::traits::iterator::Iterator>::next
                at 
/rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/alloc/src/boxed.rs:1997:9
      9: 
datafusion_physical_plan::repartition::RepartitionExec::pull_from_input::{{closure}}
                at 
/Users/yongting/Desktop/code/my_datafusion/arrow-datafusion/datafusion/physical-plan/src/repartition/mod.rs:799:24
      ...
      tokio stuff
      ...
   ```
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   Found by SQLancer https://github.com/apache/datafusion/issues/11030


-- 
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]

Reply via email to