Skip to main content

Querying from Presto

Presto allows you to query table formats like Hudi, Delta and Iceberg using connectors. The same setup will work for Apache XTable™ (Incubating) synced tables as well.

For more information and required configurations refer to:

Delta Lake:

Delta Lake supports generated columns which are a special type of column whose values are automatically generated based on a user-specified function over other columns in the Delta table. During sync, Apache XTable™ (Incubating) uses the same logic to generate partition columns wherever required. Currently, the generated columns from Apache XTable™ (Incubating) sync shows NULL when queried from Presto CLI.

For hands on experimentation, please follow Creating your first interoperable table tutorial to create Apache XTable™ (Incubating) synced tables followed by Hive Metastore tutorial to register the target table in Hive Metastore. Once done, follow the below high level steps:

  1. If you are working with a self-managed Presto service, from the presto-server directory run ./bin/launcher run
  2. From the directory where you have installed presto-cli: login to presto-cli by running ./presto-cli
  3. Start querying the table i.e. SELECT * FROM catalog.schema.table;.
Note:

If you are following the example from Hive Metastore, you can query the Apache XTable™ (Incubating) synced Hudi table from Presto using the below query.

sql
SELECT * FROM hudi.hudi_db.<table_name>;