@Override
    public List<String> listPartitionNames(String databaseName, String tableName, TableVersionRange version) {
        return deltaOps.getPartitionKeys(databaseName, tableName);
    }
@Test
    public void testListPartitionNames(@Mocked SnapshotImpl snapshot, @Mocked ScanBuilder scanBuilder,
                                       @Mocked Scan scan) {
        new MockUp<DeltaUtils>() {
            @Mock
            public DeltaLakeTable convertDeltaToSRTable(String catalog, String dbName, String tblName, String path,
                                                        Engine deltaEngine, long createTime) {
                return new DeltaLakeTable(1, "delta0", "db1", "table1",
                        Lists.newArrayList(), Lists.newArrayList("ts"), snapshot,
                        "s3://bucket/path/to/table", null, 0);
            }
        };

        // mock schema:
        // struct<add:struct<path:string,partitionValues:map<string,string>>>
        List<FilteredColumnarBatch> filteredColumnarBatches = Lists.newArrayList();

        ColumnVector[] addFileCols = new ColumnVector[2];
        addFileCols[0] = new DefaultBinaryVector(BasePrimitiveType.createPrimitive("string"),
                3, new byte[][] {new byte[] {'0', '0', '0', '0'},
                    new byte[] {'0', '0', '0', '1'}, new byte[] {'0', '0', '0', '2'}});

        int[] offsets = new int[] {0, 1, 2, 3};
        DataType mapType = new MapType(StringType.STRING, StringType.STRING, true);
        addFileCols[1] = new DefaultMapVector(3, mapType, Optional.empty(), offsets,
                new DefaultBinaryVector(BasePrimitiveType.createPrimitive("string"),
                        3, new byte[][] {new byte[] {'t', 's'}, new byte[] {'t', 's'}, new byte[] {'t', 's'}}),
                new DefaultBinaryVector(BasePrimitiveType.createPrimitive("string"),
                        3, new byte[][] {new byte[] {'1', '9', '9', '9'}, new byte[] {'2', '0', '0', '0'},
                            new byte[] {'2', '0', '0', '1'}})
        );
        // addFile schema, here we only care about the partitionValues, so not use all fields
        StructType addFileSchema = new StructType(Lists.newArrayList(
                new StructField("path", BasePrimitiveType.createPrimitive("string"), true, null),
                new StructField("partitionValues", mapType, true, null)));
        DefaultStructVector addFile = new DefaultStructVector(3, addFileSchema, Optional.empty(), addFileCols);
        // construct a columnar batch which only contains addFile
        ColumnarBatch columnarBatch = new DefaultColumnarBatch(3,
                new StructType(Lists.newArrayList(new StructField("add", addFileSchema, true))),
                new DefaultStructVector[] {addFile});

        FilteredColumnarBatch filteredColumnarBatch = new FilteredColumnarBatch(columnarBatch, Optional.empty());
        filteredColumnarBatches.add(filteredColumnarBatch);
        CloseableIterator<FilteredColumnarBatch> scanFilesAsBatches = new CloseableIterator<FilteredColumnarBatch>() {
            private int index = 0;

            @Override
            public boolean hasNext() {
                return index < filteredColumnarBatches.size();
            }

            @Override
            public FilteredColumnarBatch next() {
                return filteredColumnarBatches.get(index++);
            }

            @Override
            public void close() {
            }
        };

        new Expectations() {
            {
                snapshot.getScanBuilder((Engine) any);
                result = scanBuilder;
                minTimes = 0;

                scanBuilder.build();
                result = scan;
                minTimes = 0;

                scan.getScanFiles((Engine) any);
                result = scanFilesAsBatches;
                minTimes = 0;
            }
        };
        List<String> partitionNames = deltaLakeMetadata.listPartitionNames("db1", "table1",
                TableVersionRange.empty());
        Assert.assertEquals(3, partitionNames.size());
        Assert.assertEquals("ts=1999", partitionNames.get(0));
        Assert.assertEquals("ts=2000", partitionNames.get(1));
        Assert.assertEquals("ts=2001", partitionNames.get(2));
    }