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

[BugFix] Disable stats collection for generated columns #54537

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

LiShuMing
Copy link
Contributor

@LiShuMing LiShuMing commented Dec 31, 2024

Why I'm doing:

2024-12-30 14:11:22.694+08:00 ERROR (analyze-task-concurrency-pool-1|271) [HyperQueryJob.executeStatisticsQuery():134] execute statistics query failed, sql: with base_cte_table as ( SELECT * FROM (SELECT *  FROM `db1`.`iceberg_lineitem_days_utc_1000_mv` tablet(30132)  WHERE rand() <= 0.300000  LIMIT 200000) t_low) SELECT cast(9 as INT), cast(30126 as B
IGINT), '__generated_partition_column_0', cast(0 as BIGINT), cast(8 * 1 as BIGINT), hex(hll_serialize(IFNULL(hll_raw(`__generated_partition_column_0`), hll_empty()))), cast((COUNT(*) - COUNT(`__generated_partition_column_0`)) * 1 / COUNT(*) as BIGINT), '', '', cast(-1.0 as BIGINT) FROM base_cte_table
 com.starrocks.sql.analyzer.SemanticException: Getting analyzing error. Detail message: Column '`__generated_partition_column_0`' cannot be resolved.
        at com.starrocks.sql.analyzer.Scope.resolveField(Scope.java:96)
        at com.starrocks.sql.analyzer.Scope.resolveField(Scope.java:90)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer$Visitor.visitSlot(ExpressionAnalyzer.java:434)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer$Visitor.visitSlot(ExpressionAnalyzer.java:376)
        at com.starrocks.analysis.SlotRef.accept(SlotRef.java:535)
        at com.starrocks.sql.ast.AstVisitor.visit(AstVisitor.java:88)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer.bottomUpAnalyze(ExpressionAnalyzer.java:372)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer.bottomUpAnalyze(ExpressionAnalyzer.java:370)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer.bottomUpAnalyze(ExpressionAnalyzer.java:370)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer.bottomUpAnalyze(ExpressionAnalyzer.java:370)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer.bottomUpAnalyze(ExpressionAnalyzer.java:370)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer.analyze(ExpressionAnalyzer.java:136)
        at com.starrocks.sql.analyzer.ExpressionAnalyzer.analyzeExpression(ExpressionAnalyzer.java:1822)
        at com.starrocks.sql.analyzer.SelectAnalyzer.analyzeExpression(SelectAnalyzer.java:746)
        at com.starrocks.sql.analyzer.SelectAnalyzer.analyzeSelect(SelectAnalyzer.java:251)
        at com.starrocks.sql.analyzer.SelectAnalyzer.analyze(SelectAnalyzer.java:78)
        at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitSelect(QueryAnalyzer.java:378)
        at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitSelect(QueryAnalyzer.java:286)
        at com.starrocks.sql.ast.SelectRelation.accept(SelectRelation.java:232)
        at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.process(QueryAnalyzer.java:291)
        at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitQueryRelation(QueryAnalyzer.java:306)
        at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitQueryStatement(QueryAnalyzer.java:296)
        at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitQueryStatement(QueryAnalyzer.java:286)
        at com.starrocks.sql.ast.QueryStatement.accept(QueryStatement.java:72)
        at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.process(QueryAnalyzer.java:291)
        at com.starrocks.sql.analyzer.QueryAnalyzer.analyze(QueryAnalyzer.java:124)
        at com.starrocks.sql.analyzer.Analyzer$AnalyzerVisitor.visitQueryStatement(Analyzer.java:443)
        at com.starrocks.sql.analyzer.Analyzer$AnalyzerVisitor.visitQueryStatement(Analyzer.java:179)
        at com.starrocks.sql.ast.QueryStatement.accept(QueryStatement.java:72)
        at com.starrocks.sql.ast.AstVisitor.visit(AstVisitor.java:88)
        at com.starrocks.sql.analyzer.Analyzer.analyze(Analyzer.java:176)
        at com.starrocks.sql.StatementPlanner.analyzeStatement(StatementPlanner.java:204)
        at com.starrocks.sql.StatementPlanner.plan(StatementPlanner.java:125)
        at com.starrocks.statistic.StatisticExecutor.executeDQL(StatisticExecutor.java:527)
        at com.starrocks.statistic.StatisticExecutor.executeStatisticDQL(StatisticExecutor.java:481)
        at com.starrocks.statistic.hyper.HyperQueryJob.executeStatisticsQuery(HyperQueryJob.java:130)
        at com.starrocks.statistic.hyper.MetaQueryJob.queryDataMetric(MetaQueryJob.java:107)
        at com.starrocks.statistic.hyper.MetaQueryJob.queryStatistics(MetaQueryJob.java:55)
        at com.starrocks.statistic.HyperStatisticsCollectJob.collect(HyperStatisticsCollectJob.java:93)
        at com.starrocks.statistic.StatisticExecutor.collectStatistics(StatisticExecutor.java:369)
        at com.starrocks.qe.StmtExecutor.executeAnalyze(StmtExecutor.java:1575)
        at com.starrocks.qe.StmtExecutor.executeAnalyze(StmtExecutor.java:1530)
        at com.starrocks.qe.StmtExecutor.lambda$handleAnalyzeStmt$2(StmtExecutor.java:1466)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)

What I'm doing:

  • Disable stats collection for generated columns

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.4
    • 3.3
    • 3.2
    • 3.1
    • 3.0

@LiShuMing LiShuMing requested a review from a team as a code owner December 31, 2024 03:22
Signed-off-by: shuming.li <[email protected]>
@LiShuMing LiShuMing force-pushed the disable_generated_column_stats branch from 5735c0e to bf81bb5 Compare December 31, 2024 05:18
Seaven
Seaven previously approved these changes Dec 31, 2024
Signed-off-by: shuming.li <[email protected]>
Signed-off-by: shuming.li <[email protected]>
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

pass : 2 / 2 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/statistic/StatisticUtils.java 2 2 100.00% []

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@LiShuMing LiShuMing enabled auto-merge (squash) December 31, 2024 11:20
@LiShuMing LiShuMing merged commit fea3ea4 into StarRocks:main Jan 2, 2025
48 checks passed
@LiShuMing LiShuMing deleted the disable_generated_column_stats branch January 2, 2025 02:03
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

Successfully merging this pull request may close these issues.

3 participants