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: TranslateApplyRule: assertion failed: tar < self.target_size() #15337

Closed
fuyufjh opened this issue Feb 28, 2024 · 1 comment · Fixed by #15818
Closed

bug: TranslateApplyRule: assertion failed: tar < self.target_size() #15337

fuyufjh opened this issue Feb 28, 2024 · 1 comment · Fixed by #15818
Assignees
Labels
type/bug Something isn't working
Milestone

Comments

@fuyufjh
Copy link
Member

fuyufjh commented Feb 28, 2024

Describe the bug

No response

Error message/log

thread 'rw-main' panicked at src/common/src/util/column_index_mapping.rs:55:13:
assertion failed: tar < self.target_size()
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_common::util::column_index_mapping::ColIndexMapping::put
             at ./src/common/src/util/column_index_mapping.rs:55:13
   4: risingwave_frontend::optimizer::rule::translate_apply_rule::TranslateApplyRule::rewrite_scan
             at ./src/frontend/src/optimizer/rule/translate_apply_rule.rs:256:13
   5: risingwave_frontend::optimizer::rule::translate_apply_rule::TranslateApplyRule::rewrite
             at ./src/frontend/src/optimizer/rule/translate_apply_rule.rs:170:13
   6: <risingwave_frontend::optimizer::rule::translate_apply_rule::TranslateApplyRule as risingwave_frontend::optimizer::rule::Rule>::apply
             at ./src/frontend/src/optimizer/rule/translate_apply_rule.rs:69:61
   7: risingwave_frontend::optimizer::heuristic_optimizer::HeuristicOptimizer::optimize_node
             at ./src/frontend/src/optimizer/heuristic_optimizer.rs:53:36
   8: risingwave_frontend::optimizer::heuristic_optimizer::HeuristicOptimizer::optimize
             at ./src/frontend/src/optimizer/heuristic_optimizer.rs:86:17
   9: risingwave_frontend::optimizer::heuristic_optimizer::HeuristicOptimizer::optimize_inputs::{{closure}}
             at ./src/frontend/src/optimizer/heuristic_optimizer.rs:69:29
  10: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at /rustc/e4c626dd9a17a23270bf8e7158e59cf2b9c04840/library/core/src/ops/function.rs:305:13

To Reproduce

CREATE TABLE t1 (
    c1 varchar,
    c2 bigint,
    c3 numeric,
    c4 timestamp,
) APPEND ONLY;

CREATE TABLE t2 (
    c5 timestamptz,
    c6 varchar,
    c7 numeric,
    c8 numeric,
    c1 varchar
);

CREATE MATERIALIZED VIEW mv1 AS
SELECT
    o.*,
    b.v1,
    b.v2
FROM
    t2 o
    LEFT JOIN LATERAL (
        SELECT
            sum(t.c2 * t.c3) filter (
                WHERE
                    (o.c7) * t.c3 <= (o.c7) * o.c8
            ) AS v1,
            sum(t.c2) filter (
                WHERE
                    (o.c7) * t.c3 <= (o.c7) * o.c8
            ) AS v2
        FROM
            t1 t
        WHERE
            t.c1 = o.c1
            AND t.c4 >= o.c5
            AND t.c4 :: date = o.c5 :: date
    ) AS b ON TRUE;

Expected behavior

No response

How did you deploy RisingWave?

No response

The version of RisingWave

main

Additional context

No response

@fuyufjh fuyufjh added the type/bug Something isn't working label Feb 28, 2024
@github-actions github-actions bot added this to the release-1.7 milestone Feb 28, 2024
@chenzl25 chenzl25 modified the milestones: release-1.7, release-1.8 Mar 6, 2024
@kwannoel
Copy link
Contributor

I think this is root cause: #15679

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

Successfully merging a pull request may close this issue.

3 participants