yujun777 commented on PR #68787: URL: https://github.com/apache/doris/pull/68787#issuecomment-6060887307
Responding to the static review at c9c5e4c58 (the review this body belongs to; the carried P1 is replied to in its inline thread). The carried P1 with the FLOAT example is fixed in 362ea855566, which removes the heuristic instead of narrowing it: the same-name test and the insert-coercion helper are gone entirely. On a refresh the state column now comes from the MV schema (the carrier when the MV has that column, the MV's visible column otherwise), and CREATE keeps deciding the layout from whether the aggregate output survives into the sink. Expression shape no longer takes part in the decision, so `CAST`/`SUBSTRING` over a state slot cannot be taken for the state whether the coercion comes from the binder or from the user. The triggering plan from this review now behaves as follows: - `SELECT k, CAST(SUM(v) AS FLOAT) AS \`sum(v)\`` with SUM(v)=16777217 materializes `__DORIS_IVM_AGG_0_SUM_COL__`; after inserting v=1 the MV returns 16777218 and the source query returns 16777218 (this review predicted 16777216 before the fix). - `SELECT k, CAST(SUM(d) AS DECIMAL(20, 0)) AS \`sum(d)\`` over two rows of 1.55 returns 3 (the earlier head returned 157). - `SELECT k, SUM(v) * 100 AS \`sum(v)\`` returns 200, 500, 1000. Coverage added on this head: `test_ivm_agg_expr_over_agg_2` part 9 (multiplication alias) and part 10 (lossy cast) both check `DESC`, repeated incremental refreshes and a COMPLETE refresh against the source query, and `IvmNormalizeMTMVTest#testRefreshLayoutComesFromTheMvSchema` covers both branches of the new decision. The old-layout thread is closed under the pre-GA layout policy and its diagnostic improved (normalization names the missing state column instead of a sink arity error). Both regression suites and the aggregate unit tests pass on b20b3323f32. -- 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]
