boolean commited = false;
try {
openTransaction();
dbName = dbName.toLowerCase();
tableName = tableName.toLowerCase();
MTable mtbl = this.getMTable(dbName, tableName);
if(mtbl == null) {
commited = commitTransaction();
return null;
}
// Change the query to use part_vals instead of the name which is redundant
String name = Warehouse.makePartName(convertToFieldSchemas(mtbl.getPartitionKeys()), part_vals);
Query query = pm.newQuery(MPartition.class, "table.tableName == t1 && table.database.name == t2 && partitionName == t3");
query.declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3");
query.setUnique(true);
mpart = (MPartition) query.execute(tableName.trim(), dbName.trim(), name);
pm.retrieve(mpart);