xiangfu0 commented on code in PR #20169: URL: https://github.com/apache/pinot/pull/20169#discussion_r4498460651
########## pinot-common/src/main/java/org/apache/pinot/common/function/CrossTableFunction.java: ########## @@ -0,0 +1,73 @@ +/** + * 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.pinot.common.function; + +import javax.annotation.Nullable; +import org.apache.commons.lang3.StringUtils; + + +/// The SQL functions that read rows from somewhere other than the FROM clause of the query that calls them, which the +/// access checks keyed on that FROM clause do not cover: table-level authorization, row-level security and the DELETE +/// predicate rules each decide how to treat every one of them. +/// +/// Nothing derives this list from the function registries, so a function that reads another table or runs a nested +/// query must be added here when it is defined. The single-stage broker then rejects it for a principal with row +/// filters on the queried table, and DELETE rejects it in its WHERE clause, with no further decision. +/// +/// [#matches(String)] is the one spelling check every caller shares: underscores dropped and case folded per +/// character, as [String#equalsIgnoreCase(String)] does, so that the broker's checks and the server's resolver agree on +/// every spelling, including a look-alike such as a dotless `ı` (U+0131) for the `i`, which a `toLowerCase()` +/// comparison leaves apart, and a name lower-cased under a Turkish locale. +public enum CrossTableFunction { Review Comment: Done in f140e9e096: `RequestUtils.isCrossTableFunction(canonicalName)`, next to the canonicalization helpers and backed by `Set.of("lookup", "insubquery", "inpartitionedsubquery")` with a plain `contains()`, documented as taking the canonical name; the enum and its test are gone. The broker keeps a boolean in `CompileResult`, collected before the `IN_SUBQUERY` rewrite, and rejects with the generic `Cross-table functions are not allowed on table <table> when row-level security filters apply`. `DeleteStatement` keeps its own upper-case list as before (its `Locale.ROOT` fold differs), with a cross-reference between the two; unifying the folds is left for the normalization follow-up you mention. _🤖 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]
