Repository navigation
Installing
Only a super-user can install or remove a plugin.
INSTALL example FROM 'github:<owner>/<repo>@v0.1.0'The name after INSTALL must equal plugin.name in the manifest.
| Source | Example | Checksum |
|---|---|---|
| GitHub release | github:my-org/my-plugin@v0.1.0 |
The SHA256SUMS release asset. Required. |
| HTTPS folder | https://plugins.example.org/example/0.1.0/ |
SHA256SUMS in the folder. Required. |
| Local file | file:///srv/plugins/example-0.1.0-any.tar.gz |
SHA256SUMS next to the file, when it exists. |
| Local folder | file:///srv/plugins/example/ |
None. Beacon packs the folder. |
- For a GitHub or HTTPS source, Beacon picks the archive for its DataFusion version and target. Else it uses the
anyarchive. - Beacon refuses a source with a user name or a password.
- Plain
http://works only for127.0.0.1,[::1]andlocalhost. - Beacon refuses an archive larger than 128 MiB.
- A local folder source is good for development. It needs the built library in
lib/.
- Beacon downloads the archive and checks its SHA-256.
- It unpacks the archive into a temporary folder in the plugins directory.
- It checks the manifest and the Beacon version range.
- It loads the library and checks the SDK ABI and the DataFusion version.
- It checks that each function name, format name and table type name is free.
- It moves the folder to
<plugins_dir>/<name>/and registers the functions, the formats and the table types.
When a step fails, Beacon removes the temporary folder. The install changes nothing.
After the install, these items are available:
- The native and SQL functions, with their aliases.
- For each format:
read_<format>,read_<format>_schema,STORED AS <format>andCOPY ... STORED AS <format>for a format that writes. - For each table type:
CREATE EXTERNAL TABLE ... STORED AS <type>.
Set BEACON_PLUGINS to a comma list of name=source:
BEACON_PLUGINS=example=github:<owner>/<repo>@v0.1.0,other=github:<owner>/<other>@v1.2.0At start, Beacon installs each plugin that is not installed.
A plugin that is installed stays at its version. A new tag in BEACON_PLUGINS does not update it.
At each start, Beacon also loads the plugins in the plugins directory again. It does not download them again.
SELECT * FROM beacon.system.plugins| Column | Contents |
|---|---|
name |
The plugin name. |
version |
The plugin version. |
kind |
Native, SQL, or both. |
status |
The state of the plugin, such as loaded or failed. |
error |
The error of a failed plugin. |
functions |
The function names. |
source |
The install source. |
sha256 |
The SHA-256 of the archive. |
UNINSTALL example- Beacon removes the functions, the formats, the table types and the plugin folder.
- A table on a format of the plugin then gives the error
file format `<name>` is not installed. - A table of a table type gives an error. Beacon keeps its definition. See Table types.
- On Windows, the server keeps the library file until it stops. Beacon deletes the folder at the next start.
-
DROP FUNCTIONcannot remove a plugin function. UseUNINSTALL. - The library stays in the memory of the server until the server stops. Each install of a native plugin adds one library.
Beacon refuses an install of a plugin name that is installed. So remove the old version first:
UNINSTALL exampleINSTALL example FROM 'github:<owner>/<repo>@v0.2.0'Restart the server after many updates, to free the memory of the old libraries.
The plugins directory is the only store of plugins:
<plugins_dir>/
example/
beacon-plugin.toml the manifest
install.json the install record
sql/functions.sql the SQL functions
lib/libexample_native.so
.tmp-<random>/ an install or an uninstall that is not complete
- Do not change the files of an installed plugin.
- A folder without a readable
install.jsonis a broken entry.beacon.system.pluginsshows it as failed. - Beacon deletes the
.tmp-*folders at start.
For Beacon v2.1.0-rc4 (SDK ABI 7, DataFusion 55). Template repository: maris-development/beacon-plugin-template.