branch-4.0: [fix](mtmv) Fix query err when calc mv functional dependency which has variant and log more detailed info for troubleshoot a problem #59933#61659
Merged
yiguolei merged 1 commit intobranch-4.0from Mar 24, 2026
Conversation
…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
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
yiguolei
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #59933