swuferhong commented on code in PR #24077:
URL: https://github.com/apache/flink/pull/24077#discussion_r1467389305


##########
docs/content/docs/dev/table/sql/queries/hints.md:
##########
@@ -114,6 +114,42 @@ hintOption:
     |   stringLiteral
 ```
 
+### Conflict Cases In Query Hints
+#### Resolution of Key-value Hint Conflicts
+For key-value hints, which are provided in the following syntax:
+
+```sql
+hintName '(' optionKey '=' optionVal [, optionKey '=' optionVal ]* ')'
+```
+
+When Flink encounters conflicting in key-value hints, it adopts a 
last-write-wins strategy. This means that 
+if multiple hint values are provided for the same key, Flink will use the 
value from the last hint specified 
+in the query. For instance, consider the following SQL query with conflicting 
'max-attempts' values in the LOOKUP hint:
+
+```sql
+SELECT /*+ LOOKUP('table'='D', 'max-attempts'='3', 'max-attempts'='4') */ * 
FROM t1 T JOIN t2 AS OF T.proctime AS D ON T.id = D.id;
+```
+
+In this case, Flink will resolve the conflict by selecting the last specified 
value for 'max-attempts'. 
+Therefore, the effective hint for 'max-attempts' will be '4'.
+
+#### Resolution of List Hint Conflicts
+List hints are provided using the following syntax:
+
+```sql
+hintName '(' hintOption [, hintOption ]* ')'
+```
+
+With list hints, Flink resolves conflicts by adopting a first-accept strategy. 
This means that the 
+first specified hint in the list will take precedence and be effective.
+For example, consider the following SQL query with conflicting BROADCAST hints:
+```sql
+SELECT /*+ BROADCAST(t2, t1), BROADCAST(t1, t2) */ * FROM t1;

Review Comment:
   done!



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