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

panic when creating sink into a table which is created by CREATE TABLE AS #15334

Open
st1page opened this issue Feb 28, 2024 · 1 comment
Open
Assignees
Milestone

Comments

@st1page
Copy link
Contributor

st1page commented Feb 28, 2024

dev=> create table t as select 1;
INSERT 0 1
dev=> create sink s into t as select 2 as v with (type = 'append-only');
ERROR:  Panicked when handling the request: called `Result::unwrap()` on an `Err` value: []
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.
thread 'rw-main' panicked at src/frontend/src/handler/create_sink.rs:561:10:
called `Result::unwrap()` on an `Err` value: []
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::result::unwrap_failed
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/result.rs:1073:23
   4: risingwave_frontend::handler::create_sink::reparse_table_for_sink::{{closure}}
             at ./src/frontend/src/handler/create_sink.rs:558:32
   5: risingwave_frontend::handler::create_sink::handle_create_sink::{{closure}}
             at ./src/frontend/src/handler/create_sink.rs:443:62

It is because the definition is None for the CREATE TABLE AS

dev=> show create table t;
   Name   | Create Sql 
----------+------------
 public.t | 
(1 row)
@github-actions github-actions bot added this to the release-1.7 milestone Feb 28, 2024
@fuyufjh
Copy link
Member

fuyufjh commented Feb 28, 2024

If we have already heavily relied on the CREATE TABLE statement, it seems like we need to build such a CREATE TABLE (<column_definitions>) for CREATE TABLE AS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants