risinglight
risinglight copied to clipboard
executor: panic on always false filter
> 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
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 https://github.com/risinglightdb/risinglight/pull/561
> select count(*) from t where false
# What's this???
+-------+
| count |
+-------+
| 1 |
+-------+
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);
}
}
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
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
?
We can create a new issue for dummy executor
Resolved as we already have a schema for all plan nodes.