From 04a1fcc7800c256d2dd94c3697d73c98b6780032 Mon Sep 17 00:00:00 2001 From: Felipe Miquelim Date: Wed, 24 Feb 2021 11:20:56 -0300 Subject: [PATCH] [DAE-122] Release 1.0.5 (#51) --- CHANGELOG.md | 9 ++++++++- examples/drop_partition.py | 18 ++++++++++++++++++ setup.py | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 examples/drop_partition.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d66c84..f44db2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,19 @@ All notable changes to this project will be documented in this file. Preferably use **Added**, **Changed**, **Removed** and **Fixed** topics in each release or unreleased log for a better organization. +## [1.0.5](https://github.com/quintoandar/hive-metastore-client/releases/tag/1.0.5) +### Added +* Added bulk_drop_partitions method ([#49](https://github.com/quintoandar/hive-metastore-client/pull/49)) +* Added get_partition_values_from_table method ([#50](https://github.com/quintoandar/hive-metastore-client/pull/50)) +### Changed +* Changed max_parts parameter from get_partitions method to int32 ([#45](https://github.com/quintoandar/hive-metastore-client/pull/45)) + ## [1.0.4](https://github.com/quintoandar/hive-metastore-client/releases/tag/1.0.4) ### Added * Added create_external_table method ([#42](https://github.com/quintoandar/hive-metastore-client/pull/42)) * Added get_partition_keys_objects and get_partition_keys_names methods ([#43](https://github.com/quintoandar/hive-metastore-client/pull/43)) ### Fixed -* Enforcing type as EXTERNAL when creating external tables ([#41](https://github.com/quintoandar/hive-metastore-client/issues/41)) +* Enforced type as EXTERNAL when creating external tables ([#41](https://github.com/quintoandar/hive-metastore-client/issues/41)) ## [1.0.3](https://github.com/quintoandar/hive-metastore-client/releases/tag/1.0.3) ### Changed diff --git a/examples/drop_partition.py b/examples/drop_partition.py new file mode 100644 index 0000000..2b45879 --- /dev/null +++ b/examples/drop_partition.py @@ -0,0 +1,18 @@ +from hive_metastore_client.builders import PartitionBuilder +from hive_metastore_client import HiveMetastoreClient + +HIVE_HOST = "" +HIVE_PORT = 9083 + +DATABASE_NAME = "database_name" +TABLE_NAME = "table_name" + +# Partitions should be provided as list +# Values should be passed in the same hierarchical order of the partitions +partition_values = ["2020", "12", "13"] + +with HiveMetastoreClient(HIVE_HOST, HIVE_PORT) as hive_client: + # Dropping respective partition from metastore but keeping its data + hive_client.drop_partition( + DATABASE_NAME, TABLE_NAME, partition_values, deleteData=False + ) diff --git a/setup.py b/setup.py index 397aaae..e52e249 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import find_packages, setup __package_name__ = "hive_metastore_client" -__version__ = "1.0.4" +__version__ = "1.0.5" __repository_url__ = "https://github.com/quintoandar/hive-metastore-client" with open("requirements.txt") as f: