### Question:
TPCDSMetadataHandler extends MetadataHandler { @Override public GetSplitsResponse doGetSplits(BlockAllocator allocator, GetSplitsRequest request) { String catalogName = request.getCatalogName(); int scaleFactor = TPCDSUtils.extractScaleFactor(request.getTableName().getSchemaName()); int totalSplits = (int) Math.ceil(((double) scaleFactor / 48D)); logger.info("doGetSplits: Generating {} splits for {} at scale factor {}", totalSplits, request.getTableName(), scaleFactor); int nextSplit = request.getContinuationToken() == null ? 0 : Integer.parseInt(request.getContinuationToken()); Set<Split> splits = new HashSet<>(); for (int i = nextSplit; i < totalSplits; i++) { splits.add(Split.newBuilder(makeSpillLocation(request), makeEncryptionKey()) .add(SPLIT_NUMBER_FIELD, String.valueOf(i)) .add(SPLIT_TOTAL_NUMBER_FIELD, String.valueOf(totalSplits)) .add(SPLIT_SCALE_FACTOR_FIELD, String.valueOf(scaleFactor)) .build()); if (splits.size() >= 1000) { return new GetSplitsResponse(catalogName, splits, String.valueOf(i + 1)); } } logger.info("doGetSplits: exit - " + splits.size()); return new GetSplitsResponse(catalogName, splits); } TPCDSMetadataHandler(); @VisibleForTesting protected  TPCDSMetadataHandler(EncryptionKeyFactory keyFactory,
            AWSSecretsManager secretsManager,
            AmazonAthena athena,
            String spillBucket,
            String spillPrefix); @Override ListSchemasResponse doListSchemaNames(BlockAllocator allocator, ListSchemasRequest request); @Override ListTablesResponse doListTables(BlockAllocator allocator, ListTablesRequest request); @Override GetTableResponse doGetTable(BlockAllocator allocator, GetTableRequest request); @Override void getPartitions(BlockWriter blockWriter, GetTableLayoutRequest request, QueryStatusChecker queryStatusChecker); @Override GetSplitsResponse doGetSplits(BlockAllocator allocator, GetSplitsRequest request);  }### Answer:
@Test public void doGetSplits() { logger.info("doGetSplits: enter"); Schema schema = SchemaBuilder.newBuilder() .addIntField("partitionId") .build(); Block partitions = BlockUtils.newBlock(allocator, "partitionId", Types.MinorType.INT.getType(), 1); String continuationToken = null; GetSplitsRequest originalReq = new GetSplitsRequest(identity, "queryId", "catalog_name", new TableName("tpcds1", "customer"), partitions, Collections.EMPTY_LIST, new Constraints(new HashMap<>()), continuationToken); int numContinuations = 0; do { GetSplitsRequest req = new GetSplitsRequest(originalReq, continuationToken); logger.info("doGetSplits: req[{}]", req); MetadataResponse rawResponse = handler.doGetSplits(allocator, req); assertEquals(MetadataRequestType.GET_SPLITS, rawResponse.getRequestType()); GetSplitsResponse response = (GetSplitsResponse) rawResponse; continuationToken = response.getContinuationToken(); logger.info("doGetSplits: continuationToken[{}] - numSplits[{}]", continuationToken, response.getSplits().size()); for (Split nextSplit : response.getSplits()) { assertNotNull(nextSplit.getProperty(SPLIT_NUMBER_FIELD)); assertNotNull(nextSplit.getProperty(SPLIT_TOTAL_NUMBER_FIELD)); assertNotNull(nextSplit.getProperty(SPLIT_SCALE_FACTOR_FIELD)); } if (continuationToken != null) { numContinuations++; } } while (continuationToken != null); assertTrue(numContinuations == 0); logger.info("doGetSplits: exit"); }