# SQL support for the Trino connector

Trino, formerly known as PrestoSQL, supports the ANSI SQL language. The Trino connector uses Trino’s SPI interface to translate SQL language to Aerospike commands using the Aerospike Java client.

## Data model

Trino is an SQL engine, but Aerospike is a NoSQL database and is schemaless. The data models are different, as shown in the following table. The Trino connector reconciles those differences to provide a seamless SQL experience. For more information, see [Aerospike data model](https://aerospike.com/docs/database/learn/architecture/data-storage/data-model).

| Aerospike | Trino |
| --- | --- |
| Cluster | Catalog |
| Namespace | Schema |
| Set | Table |
| Record | Row |
| Bin | Column |

## Data types

The Trino connector does not support all Trino data types. You must typecast unsupported types to supported types.

| Aerospike Data Type | Trino Data Type |
| --- | --- |
| byte\[\] | VARBINARY |
| String | VARCHAR |
| Integer | INTEGER |
| Long | BIGINT |
| Double | DOUBLE |
| Float | DOUBLE |
| Boolean | BOOLEAN |
| Byte | TINYINT |
| Value.ListValue | JSON |
| Value.MapValue | JSON |
| Value.GeoJSONValue | JSON |
| Value.HLLValue | HYPER\_LOG\_LOG |

## SQL statements

The Trino connector supports the following SQL statements:

-   [SHOW CATALOGS](https://trino.io/docs/current/sql/show-catalogs.html)
-   [USE](https://trino.io/docs/current/sql/use.html)
-   [SHOW SCHEMAS](https://trino.io/docs/current/sql/show-schemas.html)
-   [SHOW TABLES](https://trino.io/docs/current/sql/show-tables.html)
-   [DESCRIBE](https://trino.io/docs/current/sql/describe.html)
-   [SELECT](https://trino.io/docs/current/sql/select.html)
-   [INSERT INTO](https://trino.io/docs/current/sql/insert.html)
-   [EXPLAIN](https://trino.io/docs/current/sql/explain.html)
-   [SET SESSION](https://trino.io/docs/current/sql/set-session.html)
-   [RESET SESSION](https://trino.io/docs/current/sql/reset-session.html)
-   [SHOW SESSION](https://trino.io/docs/current/sql/show-session.html)
-   [SHOW STATS](https://trino.io/docs/current/sql/show-stats.html)

Connector only supports [`READ_UNCOMMITTED`](https://trino.io/docs/current/sql/start-transaction.html) transaction isolation level.