xndai commented on a change in pull request #1354: [CALCITE-482] Implement sql 
and planner hints
URL: https://github.com/apache/calcite/pull/1354#discussion_r335568737
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/hint/ExplicitHintMatcher.java
 ##########
 @@ -0,0 +1,41 @@
+/*
+ * 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.calcite.rel.hint;
+
+import org.apache.calcite.linq4j.function.Function2;
+import org.apache.calcite.rel.RelNode;
+
+/**
+ * A function to customize whether a relational expression should match a hint.
+ *
+ * <p>Usually you may not need to implement this function, a {@link 
NodeTypeHintStrategy} is enough
+ * for most of the {@link RelHint}s.
+ *
+ * <p>Some of the hints can only be matched to the relational
+ * expression with special match conditions(not only the relational expression 
type).
+ * i.e. "hash_join(r, st)", this hint can only be applied to JOIN expression 
that
+ * has "r" and "st" as the input table names. To implement this, you may need 
to customize an
+ * {@link ExplicitHintStrategy} with an {@link ExplicitHintMatcher}.
 
 Review comment:
   I think fundamentally the question is whether we want to treat some certain 
hints as part of calcite language standard. If hash_join() is one of that 
supported by calcite, we then don't need user to supply an ExplicitHintMatcher 
and calcite defines the hinting syntax for hash_join(). To me this is 
preferable as it standardize some basic and useful hints. Otherwise one 
implementation can choose to use hash_join(r, st), and the other can use 
hashjoin(r st). That would create a lot of confusion.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to