xiedeyantu commented on code in PR #4587: URL: https://github.com/apache/calcite/pull/4587#discussion_r2450070856
########## core/src/test/resources/sql/hep.iq: ########## @@ -0,0 +1,113 @@ +# hep.iq - hep tests can customizable optimization rules for hep planner +# +# 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. +# + +# This documents the required format for .iq files containing hep planner rule configurations +# +# SYNTAX: +# --------------- +# !set hep-rules " +# +CoreRules.RULE_NAME1, +# -CoreRules.RULE_NAME2, +# +EnumerableRules.ENUMERABLE_RULE_NAME" +# +# FORMAT RULES: +# ------------- +# 1. Must begin with: !set hep-rules " (double quote) +# 2. Each rule must be on its own line. All lines except last must end with comma. +# The last rule line must close with " (double quote) on final line +# 3. Rules must start with - (remove) or + (add) +# 4. Rule prefix can be: +# - CoreRules.RULE_NAME -> added/removed from hep program +# - EnumerableRules.RULE_NAME -> added/removed from volcano program +# - RULE_NAME (no prefix) -> treated as CoreRules, added/removed from hep program +# 5. Duplicate operations on the same rule: last operation wins +# Example: "+Rule1,+Rule1,-Rule1" results in rule being removed +# 6. The optimizer uses a multi-program architecture where each program consists of +# optimization phases executed by a specific planner. Execution order: +# - HEP Program: executed by HepPlanner with configurable CoreRules.* rules +# - Volcano Program: executed by VolcanoPlanner with configurable EnumerableRules.* rules +# - Calc Program: executed by HepPlanner seeded with fixed RelOptRules.CALC_RULES Review Comment: Could you please help me check if this description is correct? ``` # This documents the required format for .iq files containing hep planner rule configurations # SYNTAX: # --------------- # !set hep-rules " # +CoreRules.RULE_NAME1, # -CoreRules.RULE_NAME2, # +EnumerableRules.ENUMERABLE_RULE_NAME" # # RULES FORMAT SPECIFICATION: # ------------- # 1. Must begin with: !set hep-rules " (double quote) # 2. Each rule must be on its own line. All lines except last must end with comma. # The last rule line must close with " (double quote) on final line # 3. Rules must start with - (remove) or + (add) # # RULES PROCESSING LOGIC: # ---------------------- # 1. Rule prefix interpretation: # - CoreRules.RULE_NAME -> added/removed from hep program # - EnumerableRules.RULE_NAME -> added/removed from volcano program # - RULE_NAME (no prefix) -> treated as CoreRules, added/removed from hep program # 2. Duplicate operations on the same rule: last operation wins # Example: "+Rule1,+Rule1,-Rule1" results in rule being removed # 3. Optimizer execution pipeline: # The optimizer uses a multi-program architecture with the following execution order: # - HEP program — executed by HepPlanner using configurable CoreRules.* rule sets # - Volcano program — executed by VolcanoPlanner and initialized from the EnumerableRules.ENUMERABLE_RULES rule set. # it also can be modified by configurable EnumerableRules.* rule sets. # - Calc program — executed by HepPlanner using fixed RelOptRules.CALC_RULES (non-configurable) ``` -- 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]
