docs/src/main/sphinx/connector/exasol.md
The Exasol connector allows querying an Exasol database.
To connect to Exasol, you need:
To configure the Exasol connector as the example catalog, create a file
named example.properties in etc/catalog. Include the following
connection properties in the file:
connector.name=exasol
connection-url=jdbc:exa:exasol.example.com:8563
connection-user=user
connection-password=secret
The connection-url defines the connection information and parameters to pass
to the JDBC driver. See the
Exasol JDBC driver documentation
for more information.
The connection-user and connection-password are typically required and
determine the user credentials for the connection, often a service user. You can
use {doc}secrets </security/secrets> to avoid using actual values in catalog
properties files.
:::{note}
If your Exasol database uses a self-signed TLS certificate you must
specify the certificate's fingerprint in the JDBC URL using parameter
fingerprint, e.g.: jdbc:exa:exasol.example.com:8563;fingerprint=ABC123.
:::
(exasol-type-mapping)=
Because Trino and Exasol each support types that the other does not, this
connector {ref}modifies some types <type-mapping-overview> when reading data.
Data types may not map the same way in both directions between
Trino and the data source. Refer to the following sections for type mapping in
each direction.
Trino supports selecting Exasol database types. This table shows the Exasol to Trino data type mapping:
:::{list-table} Exasol to Trino type mapping :widths: 25, 25, 50 :header-rows: 1
BOOLEANBOOLEANDOUBLE PRECISIONREALDECIMAL(p, s)DECIMAL(p, s)exasol-number-mappingCHAR(n)CHAR(n)VARCHAR(n)VARCHAR(n)DATEDATEHASHTYPEVARBINARY:::
No other types are supported.
(exasol-number-mapping)=
An Exasol DECIMAL(p, s) maps to Trino's DECIMAL(p, s) and vice versa
except in these conditions:
DECIMAL or
DECIMAL(*)).s) is greater than precision.p) is greater than 36.(exasol-character-mapping)=
Trino's VARCHAR(n) maps to VARCHAR(n) and vice versa if n is no greater
than 2000000. Exasol does not support longer values.
If no length is specified, the connector uses 2000000.
Trino's CHAR(n) maps to CHAR(n) and vice versa if n is no greater than 2000.
Exasol does not support longer values.
(exasol-sql-support)=
The connector provides read access to data and metadata in Exasol. In addition to the globally available and read operation statements, the connector supports the following features:
(exasol-procedures)=
(exasol-table-functions)=
The connector provides specific {doc}table functions </functions/table> to
access Exasol.
(exasol-query-function)=
query(varchar) -> tableThe query function allows you to query the underlying database directly. It
requires syntax native to Exasol, because the full query is pushed down and
processed in Exasol. This can be useful for accessing native features which are
not available in Trino or for improving query performance in situations where
running a query natively may be faster.
As a simple example, query the example catalog and select an entire table::
SELECT
*
FROM
TABLE(
example.system.query(
query => 'SELECT
*
FROM
tpch.nation'
)
);
As a practical example, you can use the WINDOW clause from Exasol:
SELECT
*
FROM
TABLE(
example.system.query(
query => 'SELECT
id, department, hire_date, starting_salary,
AVG(starting_salary) OVER w2 AVG,
MIN(starting_salary) OVER w2 MIN_STARTING_SALARY,
MAX(starting_salary) OVER (w1 ORDER BY hire_date)
FROM employee_table
WINDOW w1 as (PARTITION BY department), w2 as (w1 ORDER BY hire_date)
ORDER BY department, hire_date'
)
);
The connector includes a number of performance improvements, detailed in the following sections.
(exasol-pushdown)=
The connector supports pushdown for a number of operations:
limit-pushdowntopn-pushdown