ALTER LIBRARY
Replaces the library file (C++ .so file, Java JAR file, or R source file) associated with a UDx library defined in the Vertica catalog. Vertica automatically distributes the new file throughout the cluster. See Developing User-Defined Extensions (UDxs) in Extending Vertica for details. The UDxs defined in the catalog that reference the library automatically begin using the new library file.
Syntax
ALTER LIBRARY [schema.]library‑name [DEPENDS 'support‑path'] AS 'library‑path';
Parameters
schema |
Specifies a schema. If multiple schemas are defined in the database, include the schema name. For example: myschema.thisDbObject |
library‑name |
The library to alter. You can only alter an existing library. |
[DEPENDS 'support‑path']
|
Indicates that the UDx library depends on one or more support libraries. Valid values: One or more absolute paths to the support libraries files, located in the initiator node's filesystem. Separate multiple paths with colons (:). Specify a directory containing multiple libraries using an asterisk wildcard (*). For example: |
library‑path |
The absolute path in the initiator node's filesystem to the replacement library file. |
Privileges
Usage Considerations
- After the updated library file is distributed to all of the nodes in the Vertica cluster, every UDF that reference that library begin calling the code.
- Any nodes that are down or that are added to the cluster later automatically receive a copy of the updated library file when they join the cluster.
- The new library must be developed in the same programming language as the library file being replaced. For example, you cannot use this statement to replace a C++ library file with an R library file.
- Vertica does not compare the functions defined in the new library to ensure they match any currently-defined functions in the catalog. If you change the signature of a function in the library (for example, if you change the number and data types accepted by a UDSF defined in the library), calls to that function will likely generate errors. If your new library file changes the definition of a function, you must remove the function using DROP FUNCTION before using ALTER LIBRARY to load the new library. You can then recreate the function using its new signature.
Examples
This example shows how to update an already-defined library myFunctions with a new file.
=> ALTER LIBRARY myFunctions AS '/home/dbadmin/my_new_functions.so';