@Override
    public Map<String, Optional<HivePartitionDataInfo>> getPartitionDataInfos() {
        Map<String, Optional<HivePartitionDataInfo>> partitionDataInfos = Maps.newHashMap();
        List<String> partitionNameToFetch = partitionNames;
        if (partitionLimit >= 0 && partitionLimit < partitionNames.size()) {
            partitionNameToFetch = partitionNames.subList(partitionNames.size() - partitionLimit, partitionNames.size());
        }
        List<PartitionInfo> partitions =
                GlobalStateMgr.getCurrentState().getMetadataMgr().getRemotePartitions(table, partitionNameToFetch);
        for (int i = 0; i < partitionNameToFetch.size(); i++) {
            PartitionInfo partitionInfo = partitions.get(i);
            HivePartitionDataInfo hivePartitionDataInfo = new HivePartitionDataInfo(partitionInfo.getModifiedTime(), 1);
            partitionDataInfos.put(partitionNameToFetch.get(i), Optional.of(hivePartitionDataInfo));
        }
        return partitionDataInfos;
    }
@Test
    public void testGetPartitionDataInfos(@Mocked MetadataMgr metadataMgr) {
        List<PartitionInfo> partitionInfoList = createRemotePartitions(4);

        new Expectations() {
            {
                GlobalStateMgr.getCurrentState().getMetadataMgr();
                result = metadataMgr;
                minTimes = 0;

                metadataMgr.getRemotePartitions((Table) any, (List<String>) any);
                result = partitionInfoList;
                minTimes = 0;
            }
        };

        String location = "hdfs://path_to_file/lineorder_part";
        HiveTable hiveTable = createHiveTable(location);
        List<String> partitionNames = Lists.newArrayList(
                "date=20240501", "date=20240502", "date=20240503", "date=20240504");
        TableUpdateArbitrator.UpdateContext updateContext =
                new TableUpdateArbitrator.UpdateContext(hiveTable, -1, partitionNames);
        TableUpdateArbitrator arbitrator = TableUpdateArbitrator.create(updateContext);
        Assert.assertTrue(arbitrator instanceof DirectoryBasedUpdateArbitrator);
        Map<String, Optional<HivePartitionDataInfo>> hivePartitionDataInfo = arbitrator.getPartitionDataInfos();
        Assert.assertEquals(4, hivePartitionDataInfo.size());
        Assert.assertTrue(hivePartitionDataInfo.containsKey("date=20240501"));
        Assert.assertTrue(hivePartitionDataInfo.containsKey("date=20240502"));
        Assert.assertTrue(hivePartitionDataInfo.containsKey("date=20240503"));
        Assert.assertTrue(hivePartitionDataInfo.containsKey("date=20240504"));
    }