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


##########
fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/EliminateLogicalSelectHintTest.java:
##########
@@ -0,0 +1,56 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.analysis;
+
+import org.apache.doris.nereids.hint.Hint;
+import org.apache.doris.nereids.hint.UseCboRuleHint;
+import org.apache.doris.nereids.sqltest.SqlTestBase;
+import org.apache.doris.nereids.util.PlanChecker;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Tests for EliminateLogicalSelectHint, verifying that no_use_cbo_rule hints 
are correctly
+ * propagated into the statement context after analysis.
+ */
+public class EliminateLogicalSelectHintTest extends SqlTestBase {
+
+    @Test
+    public void testNoUseCboRuleHintIsRecognized() {
+        String sql = "SELECT /*+ no_use_cbo_rule(INFER_SET_OPERATOR_DISTINCT) 
*/ * FROM T1";

Review Comment:
   This test only verifies that analysis stores a `UseCboRuleHint` in 
`StatementContext`. The bug this PR fixes is in the rewrite path: later, 
`CostBasedRewriteJob.checkRuleHintWithHintName()` must see that hint and 
actually skip `INFER_SET_OPERATOR_DISTINCT`. If that downstream matching 
regressed, this test would still pass.
   
   Please add an end-to-end assertion on rewritten output or `planProcesses` 
for a query where `INFER_SET_OPERATOR_DISTINCT` would normally fire, and verify 
that `/*+ no_use_cbo_rule(INFER_SET_OPERATOR_DISTINCT) */` suppresses that 
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]

Reply via email to