public PhysicalPartition getPhysicalPartition(long physicalPartitionId) {
        Long partitionId = physicalPartitionIdToPartitionId.get(physicalPartitionId);
        if (partitionId == null) {
            for (Partition partition : tempPartitions.getAllPartitions()) {
                for (PhysicalPartition subPartition : partition.getSubPartitions()) {
                    if (subPartition.getId() == physicalPartitionId) {
                        return subPartition;
                    }
                }
            }
            for (Partition partition : idToPartition.values()) {
                for (PhysicalPartition subPartition : partition.getSubPartitions()) {
                    if (subPartition.getId() == physicalPartitionId) {
                        return subPartition;
                    }
                }
            }
        } else {
            Partition partition = getPartition(partitionId);
            if (partition != null) {
                return partition.getSubPartition(physicalPartitionId);
            }
        }

        return null;
    }
@Test
    public void testGetPhysicalPartitionByName() {
        Database db = UnitTestUtil.createDb(1, 2, 3, 4, 5, 6, 7, KeysType.AGG_KEYS);
        List<Table> tables = db.getTables();
        for (Table table : tables) {
            OlapTable olapTable = (OlapTable) table;
            PhysicalPartition partition = olapTable.getPhysicalPartition("not_existed_name");
            Assert.assertNull(partition);
        }
    }