Verifying the Trino Environment

Prev Next

Run the following commands from your Trino client to confirm that the connector is correctly set up:

  1. List Trino catalogs:

    trino> SHOW CATALOGS;

    The output should include a catalog named vast:

     Catalog
    ---------
     <...>
     vast
     <...>
    
  2. List schemas in the vast catalog:

    trino> SHOW SCHEMAS FROM vast;

    The output should include the database and the schema you created when configuring the VAST cluster:

           Schema
    --------------------
      <...>
     vastdb/schema1
      <...>
  3. List tables in schema vastdb/schema1:

    trino> SHOW TABLES FROM vast."vastdb/schema1";

    If you did not create any tables in the schema, the command completes but the output shows no tables.

  4. (Optional) Set vastdb/schema1 as the default namespace for this session. This allows you to omit specifying the catalog and schema in the following steps.

    trino> USE vast."vastdb/schema1";
  5. Create a table in schema vastdb/schema1:

    trino:vastdb/schema1> CREATE TABLE cats (weight BIGINT, name VARCHAR, attitude REAL, date DATE, time TIMESTAMP);
  6. List columns in the newly created table:

    trino:vastdb/schema1> DESCRIBE cats;

    The output should show the columns:

      Column  |     Type     | Extra | Comment
    ----------+--------------+-------+---------
     weight   | bigint       |       |
     name     | varchar      |       |
     attitude | real         |       |
     date     | date         |       |
     time     | timestamp(3) |       |
    (5 rows)
  7. Add data to the newly created table:

    trino:vastdb/schema1> INSERT INTO cats (weight, name, attitude, date, time) VALUES (14, 'jeff', 2.5, date('2022-12-07'), now());
  8. Run a transaction:

    trino:vastdb/schema1> START TRANSACTION;
    INSERT INTO cats (
      weight, name, attitude, date, time
    ) VALUES (
      12, 'happy', 18.7, date('2022-12-02'), now()
    );
    INSERT INTO cats (
      weight, name, attitude, date, time
    ) VALUES (
      8, 'joy', 19.2, date('2022-12-02'), now()
    );
    INSERT INTO cats (
      weight, name, attitude, date, time
    ) VALUES (
      11, 'chester', 13.2, date('2022-12-02'), now()
    );
    COMMIT;
  9. List table rows:

    trino:vastdb/schema1> SELECT * FROM cats;

    The output should contain the following rows:

     weight |  name   | attitude |    date    |          time
    --------+---------+----------+------------+-------------------------
         14 | jeff    |      2.5 | 2022-12-07 | 2022-12-08 19:50:51.471
         12 | happy   |     18.7 | 2022-12-02 | 2022-12-08 19:55:35.325
          8 | joy     |     19.2 | 2022-12-02 | 2022-12-08 19:55:36.390
         11 | chester |     13.2 | 2022-12-02 | 2022-12-08 19:55:37.180
    (4 rows)
  10. Verify that you can view a query execution plan:

    trino:vastdb/schema1> EXPLAIN SELECT * FROM cats WHERE weight > 10 AND attitude < 10;