github-actions[bot] commented on code in PR #67532:
URL: https://github.com/apache/doris/pull/67532#discussion_r3944632789


##########
fe/fe-core/src/test/java/org/apache/doris/common/profile/SummaryProfileTest.java:
##########
@@ -131,4 +131,50 @@ public void testExternalTableMetaSummary() {
                 SummaryProfile.EXTERNAL_TABLE_GET_FILE_SCAN_TASKS_TIME));
         Assertions.assertEquals(28, profile.getExternalCatalogMetaTimeMs());
     }
+
+    @Test
+    public void testOptimizeTimeFallbackWhenPreMvSkipped() {
+        SummaryProfile profile = new SummaryProfile();
+        profile.setQueryBeginTime(1);
+        profile.setParseSqlStartTime(3);
+        profile.setParseSqlFinishTime(6);
+        profile.setNereidsLockTableStartTime(8);
+        profile.setNereidsLockTableFinishTime(10);
+        profile.setNereidsAnalysisTime(15);
+        profile.setNereidsRewriteTime(21);
+        profile.setNereidsOptimizeTime(36);
+        profile.setNereidsTranslateTime(45);
+        profile.setNereidsDistributeTime(55);
+        profile.setQueryPlanFinishTime(66);
+
+        profile.update(ImmutableMap.of());
+        RuntimeProfile executionSummary = profile.getExecutionSummary();
+
+        Assertions.assertEquals("N/A", 
executionSummary.getInfoString(SummaryProfile.NEREIDS_PRE_REWRITE_BY_MV_TIME));
+        Assertions.assertEquals("15ms", 
executionSummary.getInfoString(SummaryProfile.NEREIDS_OPTIMIZE_TIME));
+        Assertions.assertEquals(15, profile.getNereidsOptimizeTimeMs());

Review Comment:
   [P2] Cover the collection-marker fallback path
   
   This test only covers the no-hook `rewrite -> optimize` topology because it 
never sets `nereidsCollectTablePartitionFinishTime`. A common query with 
`InitMaterializationContextHook` installed but `needPreRewrite()` false instead 
has `rewrite -> collection -> optimize`, and the new pretty getter must start 
at collection rather than rewrite. None of the current tests distinguishes 
those markers, so an implementation that skips the middle fallback and reports 
the collection phase as optimize time would still pass. Please keep this case 
and add one with, for example, rewrite `21`, collection `28`, no pre-MV marker, 
and optimize `36`, asserting `8ms` (and numeric `8`). This is distinct from the 
existing no-hook numeric and attempted-empty coverage threads.



-- 
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]

Reply via email to