@@ -418,6 +418,70 @@ Run the Presto server:
418
418
./bin/launcher start
419
419
420
420
421
+ File-Based MetaStore
422
+ --------------------
423
+
424
+ For testing or developing 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 to the new directory is
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
+
421
485
An Example Deployment with Docker
422
486
---------------------------------
423
487
0 commit comments