sha174n commented on PR #41803:
URL: https://github.com/apache/superset/pull/41803#issuecomment-5368855531

   One thing worth confirming before this lands: Trino SQL UDF bodies can 
contain scalar subqueries (e.g. RETURN (SELECT ... FROM t), or SET x = (SELECT 
... FROM t) inside a BEGIN ... END body). Since the body is captured as an 
opaque exp.Var string, any table referenced inside it is not visible to 
extract_tables_from_statement (traverse_scope only walks FROM/JOIN sources), 
and the statement still parses as a normal Select so it also passes the 
fail-closed guard in has_unparseable_statement. Net effect: strict per-dataset 
scoping and RLS injection can't enumerate those inner tables. Two directions: 
parse the UDF body into a real AST so inner tables/subqueries are enumerable, 
or treat any statement containing an inline UDF/opaque body as unparseable so 
strict scoping fails closed. Also worth noting the hand-copied _parse is pinned 
'as of 30.8.0' while requirements pin sqlglot 30.12.0, so it can drift silently 
on upgrade.


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

Reply via email to