HUE-2212 [metastore] Memory can leak when getting a sample of data of a table