quintoandar / hive-metastore-client

A client for connecting and running DDLs on hive metastore.
Apache License 2.0
52 stars 15 forks source link

[DAE-115] Add method add_partitions_to_table and deprecate add_partitions_if_not_exists #57

Closed LucasMMota closed 3 years ago

LucasMMota commented 3 years ago

Why? :open_book:

We noticed that the method add_partitions_if_not_exists has a silent bug (from the Hive Metastore Server): if some partition of partition_list does not exist, the entire list will not be added, and no error will be raised. We fix this in this PR adding each partition individually in a loop. Also, we created a new method to be used in the place of this one if the exception is desired.

What? :wrench:

Make the add_partitions_if_not_exists add each partition individually through a for loop. Add the method add_partitions_to_table that will raise an error if some partition already exists and interrupt the execution.

Type of change :file_cabinet:

How everything was tested? :straight_ruler:

Unit test + testing with a Hive Metastore Server

Checklist :memo:

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication