Upload a parquet file to Minio and query from Trino

How To: Upload a parquet file to Minio and query from Trino

> Note: To accomplish this following these instructions, you will be required to have Trino CLI app installed.
  • Upload the target parquet (.parquet) file to the corresponding s3 bucket via UI, CLI or Inbox.

  • For additional information on how to accomplish this in the Data Fabric, please refer to the [Object Store and CRUD Operations](/tests/minio/minio/) documentation.

  • Login to via trino cli:

  • An example command for logging in using Trino CLI: bash https://trino.{ base_url_of_data-fabric } --user=admin --access-token={ access_token } --catalog df-hive > Note: If your local instance of Data Fabric does not have proper certs issued, you can still successfully accomplish this by adding the --insecure flag to the previous command

    > Note: To find the correct token, you can use the bash script packaged with Data Fabric repo, located here: `data-fabric/hacks/df_token.sh`
  • Create a table via Trino CLI:

  • Here is an example table one might use: sql CREATE TABLE orders ( o_orderkey BIGINT , o_custkey BIGINT , o_orderstatus CHAR(1) , o_totalprice DOUBLE PRECISION , o_orderdate DATE , o_orderpriority CHAR(15) , o_clerk CHAR(15) , o_shippriority INTEGER , o_comment VARCHAR(79) ) WITH ( format = 'PARQUET', external_location = 's3a://inbox-public/' ) ;

  • Verify the tables were properly rendered: sql describe default.orders;

  • View the data with a query:

  • Here is an example query one might use: sql select * from default.orders limit 5;