Giter VIP home page Giter VIP logo

exasol-virtual-schema-lua's Introduction

Exasol Virtual Schema (Lua)

Build Status

Abstract read access from Exasol to Exasol via a Virtual Schema.

Features

  • Access a local Exasol schema through a Virtual Schema

Table of Contents

Information for Users

Information for Contributors

Requirement, design documents and coverage tags are written in OpenFastTrace format.

Runtime Dependencies

Lua Dependencies

Running the Exasol Virtual Schema (Lua) requires an Exasol database with built-in Lua 5.4 or later.

Dependency Purpose License
Lua CJSON JSON parsing and writing MIT License
remotelog Logging through a TCP socket MIT License

remotelog has a transitive dependency to LuaSocket (MIT License). Note that Lua CSON and LuaSocket are pre-installed on an Exasol database.

For local unit testing you need to install them on the test machine though.

Test Dependencies

Unit Test Dependencies

Unit tests are written in Lua.

Dependency Purpose License
busted Unit testing framework BSD License
Mockagne Mocking framework MIT License

Integration Test Dependencies

The integration tests require exasol-testcontainers to provide an Exasol instance. They are written in Java and require version 11 or later.

See also: Java Dependencies.

Build Dependencies

This project has a complex build setup due to the mixture of Lua and Java. Apache Maven serves as the main build tool.

Lua build steps are also encapsulated by Maven.

Dependency Purpose License
Amalg Bundling Lua modules (and scripts) MIT License
LuaRocks Package management MIT License

See also: Java Dependencies.

exasol-virtual-schema-lua's People

Contributors

exadm-deg avatar kaklakariada avatar redcatbear avatar skyglass avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rohankumardubey

exasol-virtual-schema-lua's Issues

Port user guide

Situation

The current user guide is from RLS Lua. While the installation instructions are similar, the rest of the user guide must come from the existing Exasol user guide.

Acceptance Criteria

  1. Installation instructions ported from RLSL
  2. Rest ported from Exasol VS Java

TLS Certificate Validation

Situation

In #23 we realized that TLS certificate validation is not yet possible in Lua, because Lua has no file system access and thus cannot read from the certificate store.

Since this requires a database change, we decided to create this follow-up ticket of #23 to add certificate validation support once the database is prepared for this.

Acceptance Criteria

  • An integration test proves that a TLS connection requires a valid peer certificate in order to establish a connection.
  • Event-driven way to find out when to restart the database after installing a certificate (install_test_certificate.sh).

Joins

Situation

Join and sub-select rendering are available in the base library, but the dialect does not report the capabilities and integration tests are missing.

Sub-selects are unfortunately not supported by the core database, so the adapter can only handle joins.

Acceptance Criteria

  1. Integration tests prove joins are supported

Partial TLS support (no certificate validation)

Situation

Metadata access to the remote data source during CREATE SCHEMA requires a network connection. This connection should be protected by TLS.

Tasks

The following task requires a change in the Exasol database because Lua does not yet have access to the certificate store.

  • โŒ Run the same test with a valid certificate and get it green โ†’ Follow up ticket: #36

Acceptance Criteria

  • TLS support available TLS support without certificate validation.

Read metadata from remote Exasol

Situation

In the first MVP of the Exasol Virtual Schema we only supported reading metadata from a local Exasol database. The first step in enabling access to a remote Exasol database is to be able to read the metadata using the Lua Exasol Driver.

Acceptance Criteria

  1. Users can define a remote connection
  2. Exasol can read the metadata for a remote connection
  3. An integration test proves that reading the remote metadata works
  4. Properties are backward-compatible (ignoring is OK) with the existing Java-variant
  5. Connection definitions are backward-compatible with the existing Java-variant

It is okay though if the test accesses the same database as long as it uses the database driver to do it. Since IMPORT is not in the scope of this ticket, this kind of test is the easiest way to decouple the tickets.

Implementation hints

Check "Accessing Connection Definitions" in the online handbook for details on how to read the contents of connection definitions in a Lua script.

Fix CVE-2023-42503 in test dependency `org.apache.commons:commons-compress`

Error:  Failed to execute goal org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0:audit (default-cli) on project exasol-virtual-schema-lua: Detected 1 vulnerable components:
Error:    org.apache.commons:commons-compress:jar:1.23.0:test; https://ossindex.sonatype.org/component/pkg:maven/org.apache.commons/[email protected]?utm_source=ossindex-client&utm_medium=integration&utm_content=1.8.1
Error:      * [CVE-2023-42503] CWE-20: Improper Input Validation (5.5); https://ossindex.sonatype.org/vulnerability/CVE-2023-42503?component-type=maven&component-name=org.apache.commons%2Fcommons-compress&utm_source=ossindex-client&utm_medium=integration&utm_content=1.8.1

Port integration tests from Exasol VS Java

Situation

We already have an Exasol Virtual Schema written in Java. The Lua variant must be interface compatible, so all existing integration tests must work with the Lua VS too

Tasks

  • Copy the integration test
  • Fix failing tests (i.e. implement the Virtual Schema)

VS Workaround for `GROUP BY <integer>`

Summary

When users combine integer constants as expressions with DISTINCT, the engine pushes down GROUP BY <integer-constant>. Exasol interprets this as "group by column number", which yields wrong results. What should happen here is that you get a result with a single group. GROUP BY TRUE, GROUP BY '0' or any other non-integer constant will work as expected.

Note that some databases interpret this as "group by integer constant". So the behavior is database specific. The reason is that this case is not covered by the SQL standard.

Workaround:

The adapter should work around this by turning GROUP BY <integer-constant> into GROUP BY <other-constant>.

Theoretically that should be done on a db-by-db basis, but that is too much effort, so a general workaround in VSCL and VSCJ should be implemented. This can be overridden in the dialect if there is ever the need.

Features

  • Turns GROUP BY <integer-constant> into GROUP BY <other-constant>

Specifiy import data types explicitly

Situation

In #21 we implemented import from a remote Exasol database. So far the IMPORT statement that the adapter generates does not contain a column type list. While that works for getting the data, it has the downside of letting the ExaLoader pick the column types. Those do not always match the ones the database expects.

What we need is to take the data types the core database in the request element selectListDataTypes and explicitly state them in the IMPORT.

Acceptance Criteria

  • IMPORT contains wanted result column data types

Test query runtime against baseline

Situation

Currently in file QueryRuntimeIT we only test the absolute maximum runtime. This is a good regression test.
But it does not fulfill the criteria defined in qr~query-execution-time~1.

Acceptance Criteria

  1. Test exists that establishes the Query time baseline by querying the source schema and compares this with the same query through the Virtual Schema as defined in qr~query-execution-time~1.

Port integration tests from Java version

Situation

The EVSL has a good number of integration tests already. Still we should scan the existing Java EVS and port any test cases that are not yet covered to ensure backward compatibility

Acceptance Criteria

  • Integration tests for functions not covered yet ported from the Java variant.

๐Ÿ” CVE-2024-25710: org.apache.commons:commons-compress:jar:1.24.0:test

Summary

Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in Apache Commons Compress.This issue affects Apache Commons Compress: from 1.3 through 1.25.0.

Users are recommended to upgrade to version 1.26.0 which fixes the issue.

CVE: CVE-2024-25710
CWE: CWE-835

References

TS(9) support in Exasol VS Lua

Situation

We need to support nanosecond timestamp resolution.

Acceptance Criteria

  • An integration test against Exasol 8 proves that TS(9) is supported

More predicates

Acceptance Criteria

For each of the listed predicates an integration test exists:

  • FN_PRED_AND
  • FN_PRED_BETWEEN
  • FN_PRED_EQUAL
  • FN_PRED_IN_CONSTLIST
  • FN_PRED_IS_JSON
  • FN_PRED_IS_NOT_JSON
  • FN_PRED_IS_NOT_NULL
  • FN_PRED_IS_NULL
  • FN_PRED_LESS
  • FN_PRED_LESSEQUAL
  • FN_PRED_LIKE
  • FN_PRED_LIKE_ESCAPE
  • FN_PRED_NOT
  • FN_PRED_NOTEQUAL
  • FN_PRED_REGEXP_LIKE
  • FN_PRED_OR

CI test with V8 when on Dockerhub

Situation

Tests with a development version of V8 are only available locally. Currently, the CI tests run with 7.1.18 and skip remote tests.
Once V8 is on Dockerhub, we need to reenable CI tests with V8 in ExasolVritualSchemaTestConstants.

Acceptance Criteria

  • CI tests run with Exasol version that supports remote login via Lua.

๐Ÿ” CVE-2024-26308: org.apache.commons:commons-compress:jar:1.24.0:test

Summary

Allocation of Resources Without Limits or Throttling vulnerability in Apache Commons Compress.This issue affects Apache Commons Compress: from 1.21 before 1.26.

Users are recommended to upgrade to version 1.26, which fixes the issue.

CVE: CVE-2024-26308
CWE: CWE-770

References

Use EVSCL

Situation

To unify the code base of EVSL and RLSL we need to move common parts to a library called exasol-virtual-schema-common-lua (EVSCL).

Tasks

Dependencies

  1. 3 of 3
    refactoring
    redcatbear
  2. 3 of 3
    refactoring
    redcatbear

Remove RLS-specific parts after port

Situation

Exasol Virtual Schema Lua started as a port of RLS Lua. Simply put it is RLS minus the row-restriction logic. In this issue we will remove the RLS-specific parts of the ported software.

Acceptance Criteria

  1. RLS logic removed
  2. RLS mentions in documentation removed

Filter expressions

Acceptance Criteria

  1. An integration tests proves that filter expressions (capability FILTER_EXPRESSIONS) are supported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.