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] follow the output type after eliminating agg #52741

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

ZiheLiu
Copy link
Contributor

@ZiheLiu ZiheLiu commented Nov 8, 2024

Why I'm doing:

When eliminating aggregation by a unique key, the aggregation node is rewritten to a project node. The output of COUNT aggregation function is BIGINT, but it is rewritten to TINYINT.

Refresh materialized view lineitem_agg_mv1 failed after retrying 1 times(try-lock 0 times), error-msg : com.starrocks.common.UserException: type of exprs is not match slot's, expr_type=1, slot_type=7, slot_name=count_qty backend [id=10001] [host=172.26.95.192]
	at com.starrocks.qe.DefaultCoordinator.handleErrorExecution(DefaultCoordinator.java:719)
	at com.starrocks.qe.scheduler.Deployer.waitForDeploymentCompletion(Deployer.java:251)
	at com.starrocks.qe.scheduler.Deployer.deployFragments(Deployer.java:121)
	at com.starrocks.qe.scheduler.dag.AllAtOnceExecutionSchedule.schedule(AllAtOnceExecutionSchedule.java:45)
	at com.starrocks.qe.DefaultCoordinator.deliverExecFragments(DefaultCoordinator.java:645)
	at com.starrocks.qe.DefaultCoordinator.startScheduling(DefaultCoordinator.java:543)
	at com.starrocks.qe.scheduler.Coordinator.startScheduling(Coordinator.java:115)
	at com.starrocks.qe.scheduler.Coordinator.exec(Coordinator.java:94)
	at com.starrocks.qe.StmtExecutor.handleDMLStmt(StmtExecutor.java:2300)
 [wrapped] com.starrocks.common.UserException: type of exprs is not match slot's, expr_type=1, slot_type=7, slot_name=count_qty backend [id=10001] [host=172.26.95.192]
	at com.starrocks.qe.StmtExecutor.handleDMLStmt(StmtExecutor.java:2571)
	at com.starrocks.load.InsertOverwriteJobRunner.executeInsert(InsertOverwriteJobRunner.java:356)
	at com.starrocks.load.InsertOverwriteJobRunner.doLoad(InsertOverwriteJobRunner.java:170)
	at com.starrocks.load.InsertOverwriteJobRunner.handle(InsertOverwriteJobRunner.java:150)
	at com.starrocks.load.InsertOverwriteJobRunner.transferTo(InsertOverwriteJobRunner.java:211)
	at com.starrocks.load.InsertOverwriteJobRunner.prepare(InsertOverwriteJobRunner.java:255)
	at com.starrocks.load.InsertOverwriteJobRunner.handle(InsertOverwriteJobRunner.java:147)
	at com.starrocks.load.InsertOverwriteJobRunner.run(InsertOverwriteJobRunner.java:135)
	at com.starrocks.load.InsertOverwriteJobMgr.executeJob(InsertOverwriteJobMgr.java:91)
	at com.starrocks.qe.StmtExecutor.handleInsertOverwrite(StmtExecutor.java:2100)
	at com.starrocks.qe.StmtExecutor.handleDMLStmt(StmtExecutor.java:2195)
	at com.starrocks.qe.StmtExecutor.handleDMLStmtWithProfile(StmtExecutor.java:2109)
	at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.refreshMaterializedView(PartitionBasedMvRefreshProcessor.java:1159)
	at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doRefreshMaterializedView(PartitionBasedMvRefreshProcessor.java:467)
	at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doRefreshMaterializedViewWithRetry(PartitionBasedMvRefreshProcessor.java:373)
	at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doMvRefresh(PartitionBasedMvRefreshProcessor.java:332)
	at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.processTaskRun(PartitionBasedMvRefreshProcessor.java:204)
	at com.starrocks.scheduler.TaskRun.executeTaskRun(TaskRun.java:270)
	at com.starrocks.scheduler.TaskRunExecutor.lambda$executeTaskRun$0(TaskRunExecutor.java:58)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

What I'm doing:

Follow the output type of the aggregation after eliminating agg.

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.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@ZiheLiu ZiheLiu requested a review from a team as a code owner November 8, 2024 07:46
@mergify mergify bot assigned ZiheLiu Nov 8, 2024
Copy link

sonarcloud bot commented Nov 8, 2024

Copy link

github-actions bot commented Nov 8, 2024

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Nov 8, 2024

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Nov 8, 2024

[FE Incremental Coverage Report]

pass : 10 / 10 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/sql/optimizer/rule/transformation/EliminateAggRule.java 10 10 100.00% []

@ZiheLiu ZiheLiu merged commit b094453 into StarRocks:main Nov 8, 2024
72 checks passed
@ZiheLiu ZiheLiu deleted the fix/main/eliminate_agg_count branch November 8, 2024 09:25
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