Skip to content

branch-4.1: [fix](mtmv) Fix query err when calc mv functional dependency which has variant and log more detailed info for troubleshoot a problem #59933 - #61661

Merged
yiguolei merged 1 commit into
branch-4.1from
auto-pick-59933-branch-4.1
Mar 25, 2026
Merged

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #59933

…s variant and log more detailed info for troubleshoot a problem (#59933)
Fix query err when calc mv fd by catch it and log more detailed info for
troubleshoot a problem
1. originOutputs.size() should equlas targetOutputs.size(), if not would
throw exception, this would cause query err,
should log err log and not cause query err
2. current log could not find the root cause, so add detail log
3. fix the problem by mapping the slot full path name between scan mv
output and mv sql plan output
for example as following
```sql
CREATE TABLE fact_var (
k INT,
v VARIANT
) ENGINE=OLAP
DUPLICATE KEY(k)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES ("replication_num" = "1");
INSERT INTO fact_var VALUES
(1, '{"a":1,"b":{"c":10,"d":20}}'),
(2, '{"a":2,"b":{"c":30}}');
CREATE MATERIALIZED VIEW mv_var
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1') AS
SELECT k, v
FROM fact_var;
```
if run query as fllowing, mv_var sacn would return k, v, v['a'] but
mv_var def plan sql, would return k, v,
the size is different but also can work after the fix
```sql
SELECT v['a'] AS c_val FROM mv_var;
```
Related PR: #40106
@yiguolei

Copy link
Copy Markdown
Contributor

run buildall

@yiguoleiyiguolei reopened this Mar 25, 2026
@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Mar 25, 2026
@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by anyone and no changes requested.

@yiguolei
yiguolei merged commit 4d8ff48 into branch-4.1Mar 25, 2026
26 of 29 checks passed
@morningman
morningman deleted the auto-pick-59933-branch-4.1 branch July 8, 2026 14:09
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yiguolei@seawinde