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

executor: panic on always false filter #289

Closed
skyzh opened this issue Jan 6, 2022 · 6 comments
Closed

executor: panic on always false filter #289

skyzh opened this issue Jan 6, 2022 · 6 comments

Comments

@skyzh
Copy link
Member

skyzh commented Jan 6, 2022

> select * from t where 1 = 0;
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src/array/data_chunk.rs:53:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@xxchan
Copy link
Member

xxchan commented Feb 19, 2022

The panic's place changed.

> select * from t where false
thread 'tokio-runtime-worker' panicked at 'index out of bounds: the len is 0 but the index is 0', 
src/optimizer/plan_nodes/logical_projection.rs:66:25

Another issue 👇 this one is fixed in #561

>  select count(*) from t where false 
# What's this???
+-------+
| count |
+-------+
| 1     |
+-------+

@skyzh
Copy link
Member Author

skyzh commented Feb 19, 2022

I suspect it's caused by the optimizer:

PhysicalProjection:
    InputRef #0
  PhysicalSimpleAgg:
      count(InputRef #0) -> INT
    Dummy:

The dummy executor should not return anything. However,

impl DummyScanExecutor {
    #[try_stream(boxed, ok = DataChunk, error = ExecutorError)]
    pub async fn execute(self) {
        yield DataChunk::single(0);
    }
}

@st1page
Copy link
Collaborator

st1page commented Feb 19, 2022

I think the dummy executor should return nothing, but it should have schema... we need give Dummy Plan Node a schema when constructing it and implement fn schema(&self) -> Vec<ColumnDesc> for it

@skyzh
Copy link
Member Author

skyzh commented Feb 19, 2022

Another problem is that,

> explain select 1
PhysicalProjection:
    1
  Dummy:

Projection is relying on Dummy executor to return a value... Maybe we should use ValuesExecutor for queries like select 1?

@xxchan
Copy link
Member

xxchan commented Feb 19, 2022

We can create a new issue for dummy executor

@wangrunji0408
Copy link
Member

Resolved as we already have a schema for all plan nodes.

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

4 participants