databendlabs / databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.87k stars 751 forks source link

bug: StringView panic with map and array value #16880

Closed b41sh closed 22 hours ago

b41sh commented 1 day ago

Search before asking

Version

v1.2.662

What's Wrong?

binary view panic

panicked at src/common/column/src/binview/mod.rs:156:17:
assertion `left == right` failed
  left: 42
 right: 27
   0: backtrace::backtrace::libunwind::trace
             at /home/b41sh/.cargo/git/checkouts/backtrace-rs-fb1f822361417489/72265be/src/backtrace/libunwind.rs:116:5
      backtrace::backtrace::trace_unsynchronized
             at /home/b41sh/.cargo/git/checkouts/backtrace-rs-fb1f822361417489/72265be/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace
             at /home/b41sh/.cargo/git/checkouts/backtrace-rs-fb1f822361417489/72265be/src/backtrace/mod.rs:53:14
   2: databend_common_tracing::panic_hook::captures_frames
             at /data2/b41sh/databend/src/common/tracing/src/panic_hook.rs:67:5
   3: databend_common_tracing::panic_hook::backtrace
             at /data2/b41sh/databend/src/common/tracing/src/panic_hook.rs:75:5
   4: databend_common_tracing::panic_hook::log_panic
             at /data2/b41sh/databend/src/common/tracing/src/panic_hook.rs:48:25
   5: databend_common_tracing::panic_hook::set_panic_hook::{{closure}}
             at /data2/b41sh/databend/src/common/tracing/src/panic_hook.rs:33:9
   6: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/alloc/src/boxed.rs:2078:9
      std::panicking::rust_panic_with_hook
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panicking.rs:804:13
   7: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panicking.rs:670:13
   8: std::sys::backtrace::__rust_end_short_backtrace
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/sys/backtrace.rs:171:18
   9: rust_begin_unwind
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panicking.rs:661:5
  10: core::panicking::panic_fmt
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/panicking.rs:74:14
  11: core::panicking::assert_failed_inner
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/panicking.rs:410:17
  12: core::panicking::assert_failed
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/panicking.rs:365:5
  13: databend_common_column::binview::BinaryViewColumnGeneric<T>::new_unchecked
             at /data2/b41sh/databend/src/common/column/src/binview/mod.rs:156:17
  14: databend_common_column::binview::builder::<impl core::convert::From<databend_common_column::binview::builder::BinaryViewColumnBuilder<T>> for databend_common_column::binview::BinaryViewColumnGeneric<T>>::from
             at /data2/b41sh/databend/src/common/column/src/binview/builder.rs:73:9
  15: <T as core::convert::Into<U>>::into
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/convert/mod.rs:759:9
  16: databend_common_expression::types::string::StringColumnBuilder::build
             at /data2/b41sh/databend/src/query/expression/src/types/string.rs:323:9
  17: <databend_common_expression::types::string::StringType as databend_common_expression::types::ValueType>::build_column
             at /data2/b41sh/databend/src/query/expression/src/types/string.rs:150:9
  18: databend_common_expression::values::ColumnBuilder::build
             at /data2/b41sh/databend/src/query/expression/src/values.rs:2352:56
  19: databend_common_expression::values::ColumnBuilder::build::{{closure}}
             at /data2/b41sh/databend/src/query/expression/src/values.rs:2347:62
  20: core::iter::adapters::map::map_try_fold::{{closure}}
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/iter/adapters/map.rs:96:28
  21: <alloc::vec::into_iter::IntoIter<T,A> as core::iter::traits::iterator::Iterator>::try_fold
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/alloc/src/vec/into_iter.rs:340:25
  22: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/iter/adapters/map.rs:122:9
  23: <I as alloc::vec::in_place_collect::SpecInPlaceCollect<T,I>>::collect_in_place
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/alloc/src/vec/in_place_collect.rs:379:13
  24: alloc::vec::in_place_collect::from_iter_in_place
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/alloc/src/vec/in_place_collect.rs:270:9
  25: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/alloc/src/vec/in_place_collect.rs:246:9
  26: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/alloc/src/vec/mod.rs:2971:9

How to Reproduce?

root@0.0.0.0:48000/default> SELECT {'w1vY1t5':-15239676694.972677,'6UfU721':-4905646705.765232} from numbers(3);
error: APIError: RequestError: Start Query failed with status 500 Internal Server Error: internal server error

root@0.0.0.0:48000/default> select ['w1vY1t5','6UfU721'] from numbers(5);
error: APIError: RequestError: Start Query failed with status 500 Internal Server Error: internal server error

Are you willing to submit PR?