Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Union's datatype alignment does not works for generate_series #14537

Open
st1page opened this issue Jan 12, 2024 · 3 comments
Open

Bug: Union's datatype alignment does not works for generate_series #14537

st1page opened this issue Jan 12, 2024 · 3 comments
Assignees
Labels
no-issue-activity type/bug Something isn't working
Milestone

Comments

@st1page
Copy link
Contributor

st1page commented Jan 12, 2024

dev=> select generate_series(-1, 1, 1) union select generate_series(0.25, 0.75, 0.5);
ERROR:  Panicked when handling the request: assertion failed: Schema::all_type_eq(inputs.iter().map(|x| x.schema()))
This is a bug. We would appreciate a bug report at:
  https://github.com/risingwavelabs/risingwave/issues/new?labels=type%2Fbug&template=bug_report.yml
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
psql (16.1, server 9.5.0)
dev=> select generate_series(-1.0, 1.0, 1.0) union select generate_series(0.25, 0.75, 0.5);
 generate_series 
-----------------
               0
            0.25
            0.75
              -1
               1
(5 rows)

panic stack trace

2024-01-12T17:29:47.18208294+08:00  INFO handle_query{mode="simple query" session_id=0 sql=select generate_series(-1, 1, 1) union select generate_series(0.25, 0.75, 0.5);}: risingwave_expr::sig: found 1129 functions
thread 'rw-main' panicked at src/frontend/src/optimizer/plan_node/logical_union.rs:49:9:
assertion failed: Schema::all_type_eq(inputs.iter().map(|x| x.schema()))
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/panicking.rs:144:5
   3: risingwave_frontend::optimizer::plan_node::logical_union::LogicalUnion::new
             at ./src/frontend/src/optimizer/plan_node/logical_union.rs:49:9
   4: risingwave_frontend::optimizer::plan_node::logical_union::LogicalUnion::create
             at ./src/frontend/src/optimizer/plan_node/logical_union.rs:66:9
   5: risingwave_frontend::planner::set_operation::<impl risingwave_frontend::planner::Planner>::plan_set_operation
             at ./src/frontend/src/planner/set_operation.rs:33:20
   6: risingwave_frontend::planner::set_expr::<impl risingwave_frontend::planner::Planner>::plan_set_expr
             at ./src/frontend/src/planner/set_expr.rs:39:18
   7: risingwave_frontend::planner::query::<impl risingwave_frontend::planner::Planner>::plan_query
             at ./src/frontend/src/planner/query.rs:40:24
   8: risingwave_frontend::planner::statement::<impl risingwave_frontend::planner::Planner>::plan_statement
             at ./src/frontend/src/planner/statement.rs:27:41
   9: risingwave_frontend::planner::Planner::plan
             at ./src/frontend/src/planner/mod.rs:54:9
  10: risingwave_frontend::handler::query::gen_batch_query_plan
             at ./src/frontend/src/handler/query.rs:173:23
  11: risingwave_frontend::handler::query::gen_batch_plan_by_statement
             at ./src/frontend/src/handler/query.rs:109:5
  12: risingwave_frontend::handler::query::handle_query::{{closure}}
             at ./src/frontend/src/handler/query.rs:63:27
  13: risingwave_frontend::handler::handle::{{closure}}
             at ./src/frontend/src/handler/mod.rs:407:88
  14: <risingwave_frontend::session::SessionImpl as pgwire::pg_server::Session>::run_one_query::{{closure}}
             at ./src/frontend/src/session.rs:1019:14
  15: pgwire::pg_protocol::PgProtocol<S,SM>::inner_process_query_msg_one_stmt::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:591:14
  16: pgwire::pg_protocol::PgProtocol<S,SM>::inner_process_query_msg::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:573:18
  17: pgwire::pg_protocol::PgProtocol<S,SM>::process_query_msg::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:554:14
  18: pgwire::pg_protocol::PgProtocol<S,SM>::do_process_inner::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:389:88
  19: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/future/future.rs:124:9
  20: <tokio::task::task_local::TaskLocalFuture<T,F> as core::future::future::Future>::poll::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/task/task_local.rs:347:31
  21: tokio::task::task_local::LocalKey<T>::scope_inner
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/task/task_local.rs:217:19
  22: <tokio::task::task_local::TaskLocalFuture<T,F> as core::future::future::Future>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/task/task_local.rs:343:19
  23: pgwire::pg_protocol::PgProtocol<S,SM>::do_process::{{closure}}::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:250:53
  24: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::future::future::Future>::poll
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/panic/unwind_safe.rs:297:9
  25: <futures_util::future::future::catch_unwind::CatchUnwind<Fut> as core::future::future::Future>::poll::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/futures-util-0.3.28/src/future/future/catch_unwind.rs:36:42
  26: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/panic/unwind_safe.rs:272:9
  27: std::panicking::try::do_call
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panicking.rs:552:40
  28: __rust_try
  29: std::panicking::try
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panicking.rs:516:19
  30: std::panic::catch_unwind
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panic.rs:142:14
  31: <futures_util::future::future::catch_unwind::CatchUnwind<Fut> as core::future::future::Future>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/futures-util-0.3.28/src/future/future/catch_unwind.rs:36:9
  32: <tokio::task::task_local::TaskLocalFuture<T,F> as core::future::future::Future>::poll::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/task/task_local.rs:347:31
  33: tokio::task::task_local::LocalKey<T>::scope_inner
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/task/task_local.rs:217:19
  34: <tokio::task::task_local::TaskLocalFuture<T,F> as core::future::future::Future>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/task/task_local.rs:343:19
  35: pgwire::pg_protocol::PgProtocol<S,SM>::do_process::{{closure}}::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:260:18
  36: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/future/future.rs:124:9
  37: <&mut F as core::future::future::Future>::poll
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/future/future.rs:112:9
  38: <tokio::time::timeout::Timeout<T> as core::future::future::Future>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/time/timeout.rs:202:33
  39: pgwire::pg_protocol::PgProtocol<S,SM>::do_process::{{closure}}::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:276:62
  40: pgwire::pg_protocol::PgProtocol<S,SM>::do_process::{{closure}}::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:293:30
  41: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tracing-0.1.37/src/instrument.rs:272:9
  42: pgwire::pg_protocol::PgProtocol<S,SM>::do_process::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:318:19
  43: pgwire::pg_protocol::PgProtocol<S,SM>::process::{{closure}}
             at ./src/utils/pgwire/src/pg_protocol.rs:200:30
  44: pgwire::pg_server::handle_connection::{{closure}}
             at ./src/utils/pgwire/src/pg_server.rs:208:41
  45: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/future/future.rs:124:9
  46: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tracing-0.1.37/src/instrument.rs:272:9
  47: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/core.rs:334:17
  48: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/loom/std/unsafe_cell.rs:16:9
  49: tokio::runtime::task::core::Core<T,S>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/core.rs:323:13
  50: tokio::runtime::task::harness::poll_future::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/harness.rs:485:19
  51: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/panic/unwind_safe.rs:272:9
  52: std::panicking::try::do_call
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panicking.rs:552:40
  53: __rust_try
  54: std::panicking::try
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panicking.rs:516:19
  55: std::panic::catch_unwind
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panic.rs:142:14
  56: tokio::runtime::task::harness::poll_future
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/harness.rs:473:18
  57: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/harness.rs:208:27
  58: tokio::runtime::task::harness::Harness<T,S>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/harness.rs:153:15
  59: tokio::runtime::task::raw::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/raw.rs:276:5
  60: tokio::runtime::task::raw::RawTask::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/raw.rs:200:18
  61: tokio::runtime::task::LocalNotified<S>::run
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/mod.rs:400:9
  62: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/scheduler/multi_thread/worker.rs:576:13
  63: tokio::runtime::coop::with_budget
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/coop.rs:107:5
  64: tokio::runtime::coop::budget
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/coop.rs:73:5
  65: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/scheduler/multi_thread/worker.rs:575:9
  66: tokio::runtime::scheduler::multi_thread::worker::Context::run
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/scheduler/multi_thread/worker.rs:526:24
  67: tokio::runtime::scheduler::multi_thread::worker::run::{{closure}}::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/scheduler/multi_thread/worker.rs:491:21
  68: tokio::runtime::context::scoped::Scoped<T>::set
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/context/scoped.rs:40:9
  69: tokio::runtime::context::set_scheduler::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/context.rs:176:26
  70: std::thread::local::LocalKey<T>::try_with
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/thread/local.rs:270:16
  71: std::thread::local::LocalKey<T>::with
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/thread/local.rs:246:9
  72: tokio::runtime::context::set_scheduler
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/context.rs:176:9
  73: tokio::runtime::scheduler::multi_thread::worker::run::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/scheduler/multi_thread/worker.rs:486:9
  74: tokio::runtime::context::runtime::enter_runtime
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/context/runtime.rs:65:16
  75: tokio::runtime::scheduler::multi_thread::worker::run
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/scheduler/multi_thread/worker.rs:478:5
  76: tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/scheduler/multi_thread/worker.rs:447:45
  77: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/blocking/task.rs:42:21
  78: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tracing-0.1.37/src/instrument.rs:272:9
  79: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/core.rs:334:17
  80: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/loom/std/unsafe_cell.rs:16:9
  81: tokio::runtime::task::core::Core<T,S>::poll
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/core.rs:323:13
  82: tokio::runtime::task::harness::poll_future::{{closure}}
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/harness.rs:485:19
  83: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/panic/unwind_safe.rs:272:9
  84: std::panicking::try::do_call
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panicking.rs:552:40
  85: __rust_try
  86: std::panicking::try
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panicking.rs:516:19
  87: std::panic::catch_unwind
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/std/src/panic.rs:142:14
  88: tokio::runtime::task::harness::poll_future
             at /home/stonepage/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.32.0/src/runtime/task/harness.rs:473:18
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@github-actions github-actions bot added this to the release-1.7 milestone Jan 12, 2024
@st1page st1page added the type/bug Something isn't working label Jan 12, 2024
@xiangjinwu
Copy link
Contributor

xiangjinwu commented Jan 15, 2024

It is a known issue #7768 (comment) that we only support limited cases. Are you interested in expanding it to more cases?

@st1page
Copy link
Contributor Author

st1page commented Jan 15, 2024

It is a known issue #7768 (comment) that we only support limited cases. Are you interested in expanding it to more cases?

One of our users reported it 🤔 At least we need to change the panic to an error and improve the error message. maybe I will do it later.

@st1page st1page self-assigned this Jan 15, 2024
@st1page st1page modified the milestones: release-1.7, release-1.8 Mar 6, 2024
Copy link
Contributor

github-actions bot commented Aug 1, 2024

This issue has been open for 60 days with no activity.

If you think it is still relevant today, and needs to be done in the near future, you can comment to update the status, or just manually remove the no-issue-activity label.

You can also confidently close this issue as not planned to keep our backlog clean.
Don't worry if you think the issue is still valuable to continue in the future.
It's searchable and can be reopened when it's time. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue-activity type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants