yujun777 opened a new pull request, #68812:
URL: https://github.com/apache/doris/pull/68812
### What problem does this PR solve?
Several IVM regression cases under `regression-test/suites/mtmv_p0/ivm/`
read the base table directly in order to assert that it returns the same rows
as the materialized view. With transparent rewrite enabled, that base-table
query can itself be rewritten to the MV, so the comparison is circular and
asserts nothing about the base table.
### Release note
None
### Check List (For Author)
- Test: Regression test
- `./run-regression-test.sh --run -d mtmv_p0 -parallel 1` — 102 suites,
0 failed, 0 fatal, 0 skipped
- Behavior changed: No
- Does this need documentation: No
### Which cases are affected
Twelve cases whose base-table reads are paired with MV reads get `set
enable_materialized_view_rewrite = false` at the top of the suite:
- test_ivm_agg_array_1, test_ivm_bitmap_agg_1, test_ivm_bitmap_agg_2
- test_ivm_bitmap_runtime_fallback, test_ivm_minmax_runtime_fallback
- test_ivm_decimal_avg
- test_ivm_partition_baseline_rebuild_dup_keys,
test_ivm_partition_drop_live_delta
- test_ivm_repeat_1, test_ivm_repeat_2, test_ivm_repeat_join_1
- test_ivm_union_delete_same_base
`test_ivm_rewrite_projection` is the case that exercises the rewrite itself,
so it keeps the rewrite for its hit check and only turns it off for the
base-table comparison:
```groovy
sql """set enable_materialized_view_rewrite = true;"""
mv_rewrite_success_without_check_chosen("""...""", "rewrite_projection_ivm")
sql """set enable_materialized_view_rewrite = false;"""
```
A `SET_VAR` hint cannot be used for this toggle:
`AddInitMaterializationHook` reads the switch during `collectAndLockTable`,
which runs before `analyze()` applies hints, so the materialization contexts
are never built when the switch starts out off.
No `.out` file changes: the compared rows are identical with and without the
rewrite.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]