Skip to content

Commit f2ec6ad

Browse files
Update invalidate cache docs for hive connector
1 parent 0655000 commit f2ec6ad

File tree

1 file changed

+23
-11
lines changed
  • presto-docs/src/main/sphinx/connector

1 file changed

+23
-11
lines changed

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

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,12 +1005,16 @@ Hive catalog is called ``web``::
10051005

10061006
CALL web.system.example_procedure()
10071007

1008-
The following procedures are available:
1008+
Create Empty Partition
1009+
^^^^^^^^^^^^^^^^^^^^^^
10091010

10101011
* ``system.create_empty_partition(schema_name, table_name, partition_columns, partition_values)``
10111012

10121013
Create an empty partition in the specified table.
10131014

1015+
Sync Partition Metadata
1016+
^^^^^^^^^^^^^^^^^^^^^^^
1017+
10141018
* ``system.sync_partition_metadata(schema_name, table_name, mode, case_sensitive)``
10151019

10161020
Check and update partitions list in metastore. There are three modes available:
@@ -1024,6 +1028,9 @@ The following procedures are available:
10241028
file system paths to use lowercase (e.g. ``col_x=SomeValue``). Partitions on the file system
10251029
not conforming to this convention are ignored, unless the argument is set to ``false``.
10261030

1031+
Invalidate Directory List Cache
1032+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1033+
10271034
* ``system.invalidate_directory_list_cache()``
10281035

10291036
Flush full directory list cache.
@@ -1032,6 +1039,9 @@ The following procedures are available:
10321039

10331040
Invalidate directory list cache for specified directory_path.
10341041

1042+
Invalidate Metastore Cache
1043+
^^^^^^^^^^^^^^^^^^^^^^^^^^
1044+
10351045
* ``system.invalidate_metastore_cache()``
10361046

10371047
Invalidate all metastore caches.
@@ -1048,8 +1058,10 @@ The following procedures are available:
10481058

10491059
Invalidate all metastore cache entries linked to a specific partition.
10501060

1051-
Note: To enable ``system.invalidate_metastore_cache`` procedure, please refer to the properties that
1052-
apply to Hive Metastore and are listed in the `Metastore Configuration Properties`_ table.
1061+
.. note::
1062+
1063+
To enable ``system.invalidate_metastore_cache`` procedure, ``hive.invalidate-metastore-cache-procedure-enabled`` must be set to ``true``.
1064+
See the properties in `Metastore Configuration Properties`_ table for more information.
10531065

10541066
Extra Hidden Columns
10551067
--------------------
@@ -1064,22 +1076,22 @@ columns as a part of the query like any other columns of the table.
10641076
How to invalidate metastore cache?
10651077
----------------------------------
10661078

1067-
The Hive connector exposes a procedure over JMX (``com.facebook.presto.hive.metastore.CachingHiveMetastore#flushCache``) to invalidate the metastore cache.
1068-
You can call this procedure to invalidate the metastore cache by connecting via jconsole or jmxterm.
1079+
Invalidating metastore cache is useful when the Hive metastore is updated outside of Presto and you want to make the changes visible to Presto immediately.
1080+
There are a couple of ways for invalidating this cache and are listed below -
10691081

1070-
This is useful when the Hive metastore is updated outside of Presto and you want to make the changes visible to Presto immediately.
1082+
* The Hive connector exposes a procedure over JMX (``com.facebook.presto.hive.metastore.InMemoryCachingHiveMetastore#invalidateAll``) to invalidate the metastore cache. You can call this procedure to invalidate the metastore cache by connecting via jconsole or jmxterm. However, this procedure flushes the cache for all the tables in all the schemas.
10711083

1072-
Currently, this procedure flushes the cache for all the tables in all the schemas. This is a known limitation and will be enhanced in the future.
1084+
* The Hive connector exposes ``system.invalidate_metastore_cache`` procedure which enables users to invalidate the metastore cache completely or partially as per the requirement and can be invoked with various arguments. See `Invalidate Metastore Cache`_ for more information.
10731085

10741086
How to invalidate directory list cache?
10751087
---------------------------------------
10761088

1077-
The Hive connector exposes a procedure over JMX (``com.facebook.presto.hive.HiveDirectoryLister#flushCache``) to invalidate the directory list cache.
1078-
You can call this procedure to invalidate the directory list cache by connecting via jconsole or jmxterm.
1089+
Invalidating directory list cache is useful when the files are added or deleted in the cache directory path and you want to make the changes visible to Presto immediately.
1090+
There are a couple of ways for invalidating this cache and are listed below -
10791091

1080-
This is useful when the files are added or deleted in the cache directory path and you want to make the changes visible to Presto immediately.
1092+
* The Hive connector exposes a procedure over JMX (``com.facebook.presto.hive.CachingDirectoryLister#flushCache``) to invalidate the directory list cache. You can call this procedure to invalidate the directory list cache by connecting via jconsole or jmxterm. This procedure flushes all the cache entries.
10811093

1082-
Currently, this procedure flushes all the cache entries. This is a known limitation and will be enhanced in the future.
1094+
* The Hive connector exposes ``system.invalidate_directory_list_cache`` procedure which gives the flexibility to invalidate the list cache completely or partially as per the requirement and can be invoked in various ways. See `Invalidate Directory List Cache`_ for more information.
10831095

10841096
Examples
10851097
--------

0 commit comments

Comments
 (0)