Module utils

Source

Structs§

FragmentDesc
PartialActorLocation
PartialFragmentStateTables
PartialObject
PartialUserPrivilege

Functions§

build_object_group_for_delete 🔒
Build a object group for notifying the deletion of the given objects.
check_connection_name_duplicate
check_connection_name_duplicate checks whether the connection name is already used in the target namespace.
check_database_name_duplicate
check_database_name_duplicate checks whether the database name is already used in the cluster.
check_function_signature_duplicate
check_function_signature_duplicate checks whether the function name and its signature is already used in the target namespace.
check_object_refer_for_drop
check_object_refer_for_drop checks whether the object is used by other objects except indexes. It returns an error that contains the details of the referring objects if it is used by others.
check_relation_name_duplicate
check_relation_name_duplicate checks whether the relation name is already used in the target namespace.
check_schema_name_duplicate
check_schema_name_duplicate checks whether the schema name is already used in the target database.
check_secret_name_duplicate
check_sink_into_table_cycle
Check if create a sink with given dependent objects into the target table will cause a cycle, return true if it will.
check_subscription_name_duplicate
check_user_name_duplicate
check_user_name_duplicate checks whether the user is already existed in the cluster.
compose_dispatchers
construct_obj_dependency_query
This function will construct a query using recursive cte to find all objects[(id, obj_type)] that are used by the given object.
construct_privilege_dependency_query
construct_privilege_dependency_query constructs a query to find all privileges that are dependent on the given one.
construct_sink_cycle_check_query
This function will construct a query using recursive cte to find if dependent objects are already relying on the target table.
ensure_object_id
ensure_object_id ensures the existence of target object in the cluster.
ensure_privileges_not_referred
ensure_privileges_not_referred ensures that the privileges are not granted to any other users.
ensure_schema_empty
ensure_schema_empty ensures that the schema is empty, used by DROP SCHEMA.
ensure_user_id
ensure_user_id ensures the existence of target user in the cluster.
extract_external_table_name_from_definition
extract_grant_obj_id
filter_workers_by_resource_group
get_database_resource_group
get_existing_job_resource_group
get_fragment_actor_dispatchers
get_fragment_actor_ids
get_fragment_actor_ids returns the fragment actor ids of the given fragments.
get_fragment_mappings
get_fragment_mappings returns the fragment vnode mappings of the given job.
get_fragments_for_jobs
For the given streaming jobs, returns
get_index_state_tables_by_table_id
get_internal_tables_by_id
get_object_owner
get_object_owner returns the owner of the given object.
get_referring_objects
List all objects that are using the given one.
get_referring_objects_cascade
List all objects that are using the given one in a cascade way. It runs a recursive CTE to find all the dependencies.
get_referring_privileges_cascade
get_user_privilege
get_user_privilege returns the privileges of the given user.
grant_default_privileges_automatically
grant_default_privileges_automatically grants default privileges automatically for the given new object. It returns the list of user infos whose privileges are updated.
insert_fragment_relations
list_user_info_by_ids
list_user_info_by_ids lists all users’ info by their ids.
rebuild_fragment_mapping_from_actors
rename_relation
rename_relation renames the target relation and its definition, it commits the changes to the transaction and returns the updated relations and the old name.
rename_relation_refer
rename_relation_refer updates the definition of relations that refer to the target one, it commits the changes to the transaction and returns all the updated relations.
resolve_no_shuffle_actor_dispatcher
return (upstream_actor_id -> downstream_actor_id)
validate_subscription_deletion
Validate that subscription can be safely deleted, meeting any of the following conditions: