Vladsz83 commented on code in PR #10902:
URL: https://github.com/apache/ignite/pull/10902#discussion_r1327043402


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlanningContext.java:
##########
@@ -210,6 +232,75 @@ public RexBuilder rexBuilder() {
         return unwrap(BaseQueryContext.class).rexBuilder();
     }
 
+    /**
+     * Stores skipped hint and the reason. Also, logs the issue.
+     */
+    public void skippedHint(RelNode relNode, RelHint hint, String reason) {
+        skippedHints.compute(new IgniteBiTuple<>(hint, relNode), (k, sh) -> {

Review Comment:
   I don't think that the validation phase is actually handy for hints. On this 
phase, hints are not fully parsed, have no parsed params containing. Aren't 
filtered with the hint strategies, are not correctly set for suitable nodes. 
For instance, in `validateJoin(SqlJoin join, SqlValidatorScope scope)` `join` 
has no hints which might be actually set in related `select`. You need to find, 
filter, parse them manually in the related scope. This job is done further by 
Calcite. In a rule, you get correctly assigned hint for current node with 
parsed params. Here, in single place, we can check index name, table names etc. 
and apply (or not) hint. No code split by two or several places. Looks much 
simpler.



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

Reply via email to