A COUNT(*) with no columns is still a read
source: Apache Kyuubi docs — Spark AuthZ plugin overview
The Kyuubi Spark AuthZ plugin builds its Ranger requests from the columns a query touches. SELECT transaction_id FROM bronze.transactions_raw asks Ranger about bronze/transactions_raw/transaction_id and is denied for an analyst, as it should be. SELECT COUNT(*) FROM bronze.transactions_raw touches no column, generates no request, and returned 1,005,000 for the same user.
It gets worse with a predicate. SELECT COUNT(*) FROM customer_pii WHERE national_id LIKE '1%' answered 5,013 for a user who may not read national_id. A row count under a filter on a forbidden column is a way to read that column one bit at a time.
I checked whether Iceberg's aggregate push-down was involved by disabling it per session; the result did not change. The plan simply contained nothing the plugin's privilege builder considered a read.
The fix that works without touching the plugin is a Ranger row-filter policy on every table the group must not read, with a predicate that keeps the relation in the plan but yields no rows (customer_id < 0 AND customer_id > 0; a plain 1 = 0 gets optimised away and breaks the real denials). Counts come back as 0, column reads are still denied, and Iceberg prunes the scan from file statistics so the count costs nothing.
The rule: when testing an authorization layer, include a query that references no columns. The policy model is only as good as the parser that feeds it.