All Products
Search
Document Center

Object Storage Service:Query OSS-HDFS data in EMR using Trino

Last Updated:Jun 03, 2026

Query data stored in OSS-HDFS by running Trino on an EMR cluster.

Prerequisites

Procedure

  1. Log on to the E-MapReduce console. In the left-side navigation pane, click EMR on ECS and create an EMR cluster.

    When you create the EMR cluster, make sure that Product Version is EMR-3.46.2 or later, or EMR-5.12.2 or later, and Root Storage Directory of Cluster is set to an OSS-HDFS-enabled bucket. Use the defaults for other parameters. For details, see Create a cluster.

  2. Query data in the OSS-HDFS service.

    1. Connect to the Trino CLI.

      On the EMR on ECS console, go to Services > Trino > the Configure tab to get <Trino_server_address> and <Trino_server_port>.

      trino --server <Trino_server_address>:<Trino_server_port> --catalog hive
    2. Create a schema in OSS.

      create schema testDB with (location='oss://<Bucket>.<Endpoint>/<schema_dir>');
    3. Use the schema.

      use testDB;
    4. Create a table.

      create table tbl (key int, val int);
    5. Insert data into the table.

      insert into tbl values (1,666);
    6. Query the table.

      select * from tbl;