[EXASOL-2924] Lua support for Virtual Schema Adapter Scripts Created: 08.07.2021 Updated: 13.01.2022 Resolved: 12.07.2021
|Fix Version/s:||Exasol 7.1.0, Exasol 7.1.rc1|
|Reporter:||Captain EXASOL||Assignee:||Captain EXASOL|
Virtual schemas allow virtually accessing external data sources. Virtual Schemas require Adapter Scripts, that can be implemented in Java and Python.
Adapter scripts can now also be written in Lua. Such adapters have a much smaller runtime overhead and can execute local SELECT queries transaction-safe.
The virtual schema callback function has the following signature in Lua:
The Lua CJSON library can be used for JSON handling, see
During the execution of the statements CREATE VIRTUAL SCHEMA, ALTER VIRTUAL SCHEMA, and DROP VIRTUAL SCHEMA (i.e., during the Virtual Schema API request types "createVirtualSchema", "refresh", "setProperties", and "dropVirtualSchema") the Lua adapter script can execute SQL statements. The statements run locally in the same transaction and session as the virtual schema statements. The API for this is similar to the query and pquery functions, but instead there are two new functions which are only available in Lua adapter scripts: exa.query_no_preprocessing and exa.pquery_no_preprocessing.
The following restrictions are enforced for these functions in Lua adapter scripts: