xiangfu0 commented on code in PR #20169:
URL: https://github.com/apache/pinot/pull/20169#discussion_r4498679067
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java:
##########
@@ -610,6 +610,26 @@ public static String
canonicalizeFunctionNamePreservingSpecialKey(String functio
return CANONICAL_NAME_TO_SPECIAL_KEY_MAP.getOrDefault(canonicalName,
canonicalName);
}
+ /// Canonical names, see [#canonicalizeFunctionName(String)], of the
functions that read rows from somewhere other
+ /// than the FROM clause of the query that calls them: `lookup()` joins a
dimension table by primary key,
+ /// `IN_SUBQUERY` runs its quoted subquery as a request of its own and
`IN_PARTITIONED_SUBQUERY` runs it on the
+ /// server. The access checks keyed on the FROM clause do not cover them, so
the single-stage broker rejects them
+ /// under row-level security, see [#isCrossTableFunction(String)].
+ ///
+ /// Nothing derives this set from the function registries, so a function
that reads another table or runs a nested
+ /// query must be added here when it is defined, and to
`DeleteStatement#CROSS_TABLE_FUNCTIONS`, which keeps the
+ /// same list in its own fold: `lookup` is `TransformFunctionType#LOOKUP`
(with `LookupTransformFunction` in
+ /// pinot-core), `insubquery` is rewritten by
`BaseSingleStageBrokerRequestHandler#IN_SUBQUERY` in pinot-broker and
+ /// `inpartitionedsubquery` by
`ServerQueryExecutorV1Impl#IN_PARTITIONED_SUBQUERY` in pinot-core.
+ private static final Set<String> CROSS_TABLE_FUNCTIONS = Set.of("lookup",
"insubquery", "inpartitionedsubquery");
+
+ /// Returns whether `canonicalName` names a function that reads rows from
somewhere other than the FROM clause, see
+ /// [#CROSS_TABLE_FUNCTIONS]. The name must already be canonical, see
[#canonicalizeFunctionName(String)], as the
+ /// parser leaves the operator of every compiled function call; a name as
written in a query is not matched.
+ public static boolean isCrossTableFunction(String canonicalName) {
Review Comment:
Fixed in 22bcffac00: the broker folds the canonical operator through
`Locale.ROOT` (upper, then lower) before the `Set.contains()`, which accepts
what the server's `equalsIgnoreCase` accepts for these ASCII names, so the
dotless-ı spelling and a Turkish default locale are rejected like the plain
one; `RequestUtils.isCrossTableFunction` still takes the canonical name as
Jackie asked. The dotless-ı case is back in `testHasCrossTableFunction`, with a
Turkish-locale case next to it.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]