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

starrocks error: cannot obtain cte statistics for LogicalCTEConsumeOperator on Version 3.3.0 and 3.3.2 #50044

Open
chathawee opened this issue Aug 21, 2024 · 3 comments
Assignees
Labels
type/bug Something isn't working

Comments

@chathawee
Copy link

chathawee commented Aug 21, 2024

Steps to reproduce the behavior (Required)

On the version 3.2.7, we can run the complex CTE query but after upgrading to version 3.3.0 and 3.3.2. The same query was failed with the error "starrocks error: cannot obtain cte statistics for LogicalCTEConsumeOperator{cteId=‘2’, limit=-1, predicate=null}"

Expected behavior (Required)

The issue happen on Version 3.3.0 and 3.3.2

Real behavior (Required)

Can't run complex CTE query

StarRocks version (Required)

  • You can get the StarRocks version by executing SQL select current_version()
  • Issue happen on 3.3.0 and 3.3.2

This is on version 3.2.7
Screenshot 2567-08-21 at 11 39 07

After upgrading to version 3.3.0 and 3.3.2
Screenshot 2567-08-21 at 11 38 40

Solution for now
We rollback to version 3.2.7 and this query can run on it.

@chathawee chathawee added the type/bug Something isn't working label Aug 21, 2024
@jenwitteng
Copy link

https://github.com/StarRocks/starrocks/blob/main/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/CTEUtils.java#L118
Can it just add

try {
            statisticsCalculator.estimatorStats();
        } catch (Exception e) {
            LOG.warn("Failed to calculate statistics for expression: {}", expr, e);
            return;
        }

same as this one
https://github.com/StarRocks/starrocks/blob/main/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/Utils.java#L800-L805

@chathawee
Copy link
Author

chathawee commented Aug 21, 2024

https://github.com/StarRocks/starrocks/blob/main/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/CTEUtils.java#L118 Can it just add

try {
            statisticsCalculator.estimatorStats();
        } catch (Exception e) {
            LOG.warn("Failed to calculate statistics for expression: {}", expr, e);
            return;
        }

same as this one https://github.com/StarRocks/starrocks/blob/main/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/Utils.java#L800-L805

This is work for us. We can query the complex CTE query
Why the version 3.2.7 didn't happen this issue?

@Seaven
Copy link
Contributor

Seaven commented Aug 21, 2024

I need replay this question, could you provide the result file accord the docs: https://docs.starrocks.io/docs/3.2/faq/Dump_query/

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

No branches or pull requests

3 participants