fdolce commented on code in PR #29146:
URL: https://github.com/apache/flink/pull/29146#discussion_r3979015728
##########
flink-python/pyflink/dataframe/sql.py:
##########
@@ -257,6 +315,97 @@ def _register_bindings(
_warn_skipped(name, f"registration failed: {e}")
continue
registered.append(name)
+ return registered
+
+
+def _register_functions(
+ t_env: TableEnvironment,
+ explicit: Dict[str, _DataFrameUDFWrapper],
+ auto: Dict[str, _DataFrameUDFWrapper],
+) -> List[str]:
+ """
+ Register explicit and auto-collected UDFs as temporary system functions
and return
+ the registered names. Registration is all-or-nothing: if an explicit
binding is
+ rejected, the functions registered before it are dropped again before
raising.
+
+ System functions are looked up by bare name independently of the current
catalog
+ and database, which matches how a Python name is referenced in the query.
Function
+ names are case-insensitive: the catalog normalizes them to lower case, so
+ collisions are checked case-insensitively. Mirroring views, explicit
bindings may
+ shadow built-in and permanent catalog functions but never an existing
temporary
+ function; auto-bind shadows nothing.
+ """
+ if not explicit and not auto:
+ return []
+ # list_user_defined_functions() covers temporary and permanent functions
alike;
+ # the permanent ones are those the current catalog lists for the current
database.
+ user_defined = {f.lower() for f in t_env.list_user_defined_functions()}
+ temporary_functions = user_defined - _permanent_functions(t_env)
Review Comment:
Ah, yes, good catch, working on this
--
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]