class TimestreamMetadataHandler extends GlueMetadataHandler {

    @Override
    public ListSchemasResponse doListSchemaNames(BlockAllocator blockAllocator, ListSchemasRequest request)
            throws Exception
    {
        List<String> schemaNames = new ArrayList<>();
        ListDatabasesRequest listDatabasesRequest = new ListDatabasesRequest();
        ListDatabasesResult nextResult = tsMeta.listDatabases(listDatabasesRequest);
        List<Database> nextDatabases = nextResult.getDatabases();
        while (!nextDatabases.isEmpty()) {
            nextDatabases.stream().forEach(next -> schemaNames.add(next.getDatabaseName()));
            if (nextResult.getNextToken() != null && !nextResult.getNextToken().isEmpty()) {
                listDatabasesRequest.setNextToken(nextResult.getNextToken());
                nextResult = tsMeta.listDatabases(listDatabasesRequest);
                nextDatabases = nextResult.getDatabases();
            }
            else {
                nextDatabases = Collections.EMPTY_LIST;
            }
        }

        return new ListSchemasResponse(request.getCatalogName(), schemaNames);
    }

    public  TimestreamMetadataHandler();
    @VisibleForTesting protected  TimestreamMetadataHandler(AmazonTimestreamQuery tsQuery,
            AmazonTimestreamWrite tsMeta,
            AWSGlue glue,
            EncryptionKeyFactory keyFactory,
            AWSSecretsManager secretsManager,
            AmazonAthena athena,
            String spillBucket,
            String spillPrefix);

}