SteNicholas commented on code in PR #534:
URL: https://github.com/apache/paimon-cpp/pull/534#discussion_r4509912775


##########
src/paimon/core/table/system/system_table.cpp:
##########
@@ -174,6 +176,23 @@ std::optional<SystemTableFactory> 
FindSystemTableFactory(const std::string& syst
     return std::nullopt;
 }
 
+// The system tables that read the rows or the file statistics of a query-auth 
table are refused
+// as soon as they are loaded: `$files` and `$binlog` as in Java, and 
`$audit_log` and `$ro`, whose
+// reads would not apply the rules. The other system tables report only 
metadata.
+Status ValidateQueryAuthSystemTable(const std::string& system_table_name,
+                                    const std::shared_ptr<TableSchema>& 
table_schema,
+                                    const std::map<std::string, std::string>& 
dynamic_options) {
+    std::string normalized_name = StringUtils::ToLowerCase(system_table_name);
+    if (table_schema == nullptr || (normalized_name != FilesSystemTable::kName 
&&

Review Comment:
   Fixed in 46778d17. `$manifests` is now refused on a query-auth table, like 
`$files`, `$binlog`, `$audit_log` and `$ro`, because `min_partition_stats` and 
`max_partition_stats` hold raw partition values. For the same reason, the 
global `sys.partitions` table now leaves out query-auth tables, since its 
`partition_name` exposes the same values. The remaining per-table system tables 
(`$options`, `$snapshots`, `$schemas`, `$tags`, `$branches`, `$consumers`) hold 
no partition or column values. 
`TableTest.TestQueryAuthTableRefusesWhatCannotApplyItsRules` and 
`TableTest.TestQueryAuthSystemTablesValidateTheBranchRead` now include 
`manifests`. `SystemTableReadInteTest.TestReadGlobalPartitions` adds a 
query-auth table with a `secret` partition and checks that only the other 
table's partition is listed.



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