alamb opened a new issue, #7482:
URL: https://github.com/apache/arrow-datafusion/issues/7482

   ### Describe the bug
   
   Similarly to https://github.com/apache/arrow-datafusion/issues/7418 when I 
am working on an upgrade to DataFusion in IOx 
(https://github.com/influxdata/influxdb_iox/pull/8577) we get a failure like 
this:
   
   ```
   ---- physical_optimizer::projection_pushdown::tests::test_integration stdout 
----
   thread 'physical_optimizer::projection_pushdown::tests::test_integration' 
panicked at 'index out of bounds: the len is 0 but the index is 0', 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/core/src/physical_plan/projection.rs:361:12
   stack backtrace:
      0: rust_begin_unwind
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
      1: core::panicking::panic_fmt
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
      2: core::panicking::panic_bounds_check
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:162:5
      3: <usize as core::slice::index::SliceIndex<[T]>>::index
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/slice/index.rs:261:10
      4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/slice/index.rs:18:9
      5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/vec/mod.rs:2675:9
      6: 
datafusion::physical_plan::projection::validate_output_ordering::{{closure}}
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/core/src/physical_plan/projection.rs:361:12
      7: core::option::Option<T>::and_then
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/option.rs:1413:24
      8: datafusion::physical_plan::projection::validate_output_ordering
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/core/src/physical_plan/projection.rs:357:5
      9: datafusion::physical_plan::projection::ProjectionExec::try_new
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/core/src/physical_plan/projection.rs:151:13
     10: 
iox_query::physical_optimizer::projection_pushdown::wrap_user_into_projections
                at ./src/physical_optimizer/projection_pushdown.rs:398:25
     11: 
<iox_query::physical_optimizer::projection_pushdown::ProjectionPushdown as 
datafusion::physical_optimizer::optimizer::PhysicalOptimizerRule>::optimize::{{closure}}
                at ./src/physical_optimizer/projection_pushdown.rs:214:32
     12: datafusion_common::tree_node::TreeNode::transform_down
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/common/src/tree_node.rs:124:24
     13: datafusion_common::tree_node::TreeNode::transform_down::{{closure}}
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/common/src/tree_node.rs:125:38
     14: core::iter::adapters::map::map_try_fold::{{closure}}
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/adapters/map.rs:91:28
     15: core::iter::traits::iterator::Iterator::try_fold
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/traits/iterator.rs:2303:21
     16: <core::iter::adapters::map::Map<I,F> as 
core::iter::traits::iterator::Iterator>::try_fold
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/adapters/map.rs:117:9
     17: <core::iter::adapters::GenericShunt<I,R> as 
core::iter::traits::iterator::Iterator>::try_fold
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/adapters/mod.rs:195:9
     18: <I as 
alloc::vec::in_place_collect::SpecInPlaceCollect<T,I>>::collect_in_place
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/vec/in_place_collect.rs:258:13
     19: alloc::vec::in_place_collect::<impl 
alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/vec/in_place_collect.rs:182:28
     20: <alloc::vec::Vec<T> as 
core::iter::traits::collect::FromIterator<T>>::from_iter
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/vec/mod.rs:2696:9
     21: core::iter::traits::iterator::Iterator::collect
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/traits/iterator.rs:1895:9
     22: <core::result::Result<V,E> as 
core::iter::traits::collect::FromIterator<core::result::Result<A,E>>>::from_iter::{{closure}}
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1932:51
     23: core::iter::adapters::try_process
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/adapters/mod.rs:164:17
     24: <core::result::Result<V,E> as 
core::iter::traits::collect::FromIterator<core::result::Result<A,E>>>::from_iter
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1932:9
     25: core::iter::traits::iterator::Iterator::collect
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/traits/iterator.rs:1895:9
     26: <alloc::sync::Arc<T> as 
datafusion_common::tree_node::TreeNode>::map_children
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/common/src/tree_node.rs:343:17
     27: datafusion_common::tree_node::TreeNode::transform_down
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/common/src/tree_node.rs:125:9
     28: datafusion_common::tree_node::TreeNode::transform_down::{{closure}}
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/common/src/tree_node.rs:125:38
     29: core::iter::adapters::map::map_try_fold::{{closure}}
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/adapters/map.rs:91:28
     30: core::iter::traits::iterator::Iterator::try_fold
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/traits/iterator.rs:2303:21
     31: <core::iter::adapters::map::Map<I,F> as 
core::iter::traits::iterator::Iterator>::try_fold
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/adapters/map.rs:117:9
     32: <core::iter::adapters::GenericShunt<I,R> as 
core::iter::traits::iterator::Iterator>::try_fold
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/adapters/mod.rs:195:9
     33: <I as 
alloc::vec::in_place_collect::SpecInPlaceCollect<T,I>>::collect_in_place
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/vec/in_place_collect.rs:258:13
     34: alloc::vec::in_place_collect::<impl 
alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/vec/in_place_collect.rs:182:28
     35: <alloc::vec::Vec<T> as 
core::iter::traits::collect::FromIterator<T>>::from_iter
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/vec/mod.rs:2696:9
     36: core::iter::traits::iterator::Iterator::collect
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/traits/iterator.rs:1895:9
     37: <core::result::Result<V,E> as 
core::iter::traits::collect::FromIterator<core::result::Result<A,E>>>::from_iter::{{closure}}
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1932:51
     38: core::iter::adapters::try_process
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/adapters/mod.rs:164:17
     39: <core::result::Result<V,E> as 
core::iter::traits::collect::FromIterator<core::result::Result<A,E>>>::from_iter
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1932:9
     40: core::iter::traits::iterator::Iterator::collect
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/iter/traits/iterator.rs:1895:9
     41: <alloc::sync::Arc<T> as 
datafusion_common::tree_node::TreeNode>::map_children
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/common/src/tree_node.rs:343:17
     42: datafusion_common::tree_node::TreeNode::transform_down
                at 
/Users/alamb/.cargo/git/checkouts/arrow-datafusion-71ae82d9dec9a01c/3ea870c/datafusion/common/src/tree_node.rs:125:9
     43: 
<iox_query::physical_optimizer::projection_pushdown::ProjectionPushdown as 
datafusion::physical_optimizer::optimizer::PhysicalOptimizerRule>::optimize
                at ./src/physical_optimizer/projection_pushdown.rs:41:9
     44: 
iox_query::physical_optimizer::test_util::OptimizationTest::new_with_config
                at ./src/physical_optimizer/test_util.rs:42:29
     45: iox_query::physical_optimizer::test_util::OptimizationTest::new
                at ./src/physical_optimizer/test_util.rs:27:9
     46: 
iox_query::physical_optimizer::projection_pushdown::tests::test_integration
                at ./src/physical_optimizer/projection_pushdown.rs:1364:13
     47: 
iox_query::physical_optimizer::projection_pushdown::tests::test_integration::{{closure}}
                at ./src/physical_optimizer/projection_pushdown.rs:1318:27
     48: core::ops::function::FnOnce::call_once
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:250:5
     49: core::ops::function::FnOnce::call_once
                at 
/rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:250:5
   note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 
backtrace.
   
   ```
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   I believe it is failing in `validate_output_ordering` (a different function 
added in https://github.com/apache/arrow-datafusion/pull/7364 by @berkaysynnada 
(looks like it needs a check for empty).
   
   Clearly our coverage is not good in this regard. 


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

Reply via email to