github-actions[bot] commented on code in PR #64440:
URL: https://github.com/apache/doris/pull/64440#discussion_r3435022995
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathExpressionCollector.java:
##########
@@ -374,26 +374,82 @@ public Void visitMapValues(MapValues mapValues,
CollectorContext context) {
return continueCollectAccessPath(mapValues.getArgument(0), context);
}
- private static boolean isFunctionNullCheckPath(List<String> suffixPath) {
+ private static boolean isUnderIsNull(List<String> suffixPath) {
return suffixPath.size() == 1 &&
AccessPathInfo.ACCESS_NULL.equals(suffixPath.get(0));
}
@Override
public Void visitMapContainsKey(MapContainsKey mapContainsKey,
CollectorContext context) {
+ // MAP_CONTAINS_KEY(<map>, <key>)
+ //
+ // isUnderIsNull checks whether the parent of this expression is IS
NULL,
+ // splitting queries into two shapes:
+ //
+ // Shape A (parent is IS NULL):
Review Comment:
FE checkstyle rejects trailing whitespace through the `RegexpSingleline`
rule. This added comment line currently has a trailing space, so `mvn validate`
/ `build.sh --fe` will fail.
```suggestion
// map_contains_key(m, k) returns NULL only when m itself is NULL
— so the path
```
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathExpressionCollector.java:
##########
@@ -374,26 +374,82 @@ public Void visitMapValues(MapValues mapValues,
CollectorContext context) {
return continueCollectAccessPath(mapValues.getArgument(0), context);
}
- private static boolean isFunctionNullCheckPath(List<String> suffixPath) {
+ private static boolean isUnderIsNull(List<String> suffixPath) {
return suffixPath.size() == 1 &&
AccessPathInfo.ACCESS_NULL.equals(suffixPath.get(0));
}
@Override
public Void visitMapContainsKey(MapContainsKey mapContainsKey,
CollectorContext context) {
+ // MAP_CONTAINS_KEY(<map>, <key>)
+ //
+ // isUnderIsNull checks whether the parent of this expression is IS
NULL,
+ // splitting queries into two shapes:
+ //
+ // Shape A (parent is IS NULL):
+ // SQL: SELECT ... WHERE map_contains_key(m, k) IS NULL
+ // map_contains_key(m, k) returns NULL only when m itself is NULL —
so the path
+ // should be m.NULL, not m.KEYS.NULL
+ //
+ // Shape B (regular predicate):
+ // SQL: SELECT ... WHERE map_contains_key(m, element_at(s, 'city'))
+ // AND element_at(s, 'city') IS NULL
Review Comment:
Same checkstyle issue here: this added comment line ends with trailing
whitespace.
```suggestion
// fresh context.
```
--
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]