Skip to content

Commit 2a0999a

Browse files
steveburnettimjalpreet
authored andcommitted
Move file-based metastore doc to installation/deployment.rst
1 parent 321a196 commit 2a0999a

File tree

3 files changed

+64
-72
lines changed

3 files changed

+64
-72
lines changed

presto-docs/src/main/sphinx/connector.rst

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ from different data sources.
1717
connector/deltalake
1818
connector/druid
1919
connector/elasticsearch
20-
connector/file-based-metastore
2120
connector/googlesheets
2221
connector/hana
2322
connector/hive

presto-docs/src/main/sphinx/connector/file-based-metastore.rst

-71
This file was deleted.

presto-docs/src/main/sphinx/installation/deployment.rst

+64
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,70 @@ Run the Presto server:
418418
./bin/launcher start
419419
420420
421+
File-Based Metastore
422+
--------------------
423+
424+
For testing or development purposes, Presto can be configured to use a local
425+
filesystem directory as a Hive Metastore.
426+
427+
The file-based metastore works only with the following connectors:
428+
429+
* :doc:`/connector/deltalake`
430+
* :doc:`/connector/hive`
431+
* :doc:`/connector/hudi`
432+
* :doc:`/connector/iceberg`
433+
434+
Configuring a File-Based Metastore
435+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
436+
437+
1. In ``etc/catalog/``, find the catalog properties file for the supported
438+
connector.
439+
440+
2. In the catalog properties file, set the following properties:
441+
442+
.. code-block:: none
443+
444+
hive.metastore=file
445+
hive.metastore.catalog.dir=file:///<catalog-dir>
446+
447+
Replace ``<catalog-dir>`` in the example with the path to a directory on an
448+
accessible filesystem.
449+
450+
Using a File-Based Warehouse
451+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
452+
453+
For this example, assume the Hive connector is being used, and the properties
454+
in the Hive connector catalog file are set to the following:
455+
456+
.. code-block:: none
457+
458+
connector.name=hive
459+
hive.metastore=file
460+
hive.metastore.catalog.dir=file:///data/hive_data/
461+
462+
Create a schema
463+
464+
.. code-block:: none
465+
466+
CREATE SCHEMA hive.warehouse;
467+
468+
This query creates a directory ``warehouse`` in the directory set for
469+
``hive.metastore.catalog.dir``, so the path for the ``warehouse`` schema would be
470+
``/data/hive_data/warehouse``.
471+
472+
Create a table with any connector-supported file formats. For example, if the
473+
Hive connector is being configured:
474+
475+
.. code-block:: none
476+
477+
CREATE TABLE hive.warehouse.orders_csv("order_name" varchar, "quantity" varchar) WITH (format = 'CSV');
478+
CREATE TABLE hive.warehouse.orders_parquet("order_name" varchar, "quantity" int) WITH (format = 'PARQUET');
479+
480+
These queries create folders as ``/data/hive_data/warehouse/orders_csv`` and
481+
``/data/hive_data/warehouse/orders_parquet``. Users can insert and query
482+
from these tables.
483+
484+
421485
An Example Deployment with Docker
422486
---------------------------------
423487

0 commit comments

Comments
 (0)