Uploaded image for project: 'EXASOL Roadmap'
  1. EXASOL Roadmap
  2. EXASOL-2924

Lua support for Virtual Schema Adapter Scripts

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: Exasol 7.1.0, Exasol 7.1.rc1
    • Component/s: None
    • Labels:
      None

      Description

      Background

      Virtual schemas allow virtually accessing external data sources. Virtual Schemas require Adapter Scripts, that can be implemented in Java and Python.

      New Feature

      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.

      New SQL Syntax

      CREATE [OR REPLACE] LUA ADAPTER SCRIPT script_name AS
          script_content
      /
      

      New Lua API

      Callback Function

      The virtual schema callback function has the following signature in Lua:

      function adapter_call(request_json)
      

      The Lua CJSON library can be used for JSON handling, see EXASOL-2598.

      Database Interaction

      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:

      • The queries always run with the privileges of the virtual schema owner.
      • No preprocessor script is used for the queries. This makes the queries safe from modification by the user of the virtual schema.
      • Only SELECT queries are allowed.
      • Not allowed in batch mode.
      • No query caching.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                CaptainEXA Captain EXASOL
                Reporter:
                CaptainEXA Captain EXASOL
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: