Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Paging #345

Open
victor-nerdunited opened this issue Dec 6, 2023 · 1 comment
Open

[question] Paging #345

victor-nerdunited opened this issue Dec 6, 2023 · 1 comment

Comments

@victor-nerdunited
Copy link

If my query results return over 200 documents, I get a 405 error (No open transaction). I noticed if I use the console in AWS the call to ExecuteStatement returns a response that has a NextPageToken field. I assume this is what would be used for paing (like Google BigQuery or Azure Cosmos DB). Is this something that is on the roadmap to be implemented in the driver?

@trstephen-amazon
Copy link

trstephen-amazon commented Jan 20, 2024

Hi @victor-nerdunited , thanks for letting us know (and apologies for the delay!)

I tried to reproduce the behavior with an integration test

[TestMethod]
public void Execute_ManyDocuments_NoFetchError()
{
    Logger.Info($"Seeding documents in {Constants.TableName}");

    var insertQuery = $"INSERT INTO {Constants.TableName} ?";
    Enumerable.Range(1, 250).ToList().ForEach(i =>
    {
        var ionStruct = ValueFactory.NewEmptyStruct();
        ionStruct.SetField(Constants.ColumnName, ValueFactory.NewInt(i));

        qldbDriver.Execute(txn => txn.Execute(insertQuery, ionStruct));
    });

    Logger.Info($"Finished seeding {Constants.TableName}");

    var selectQuery = $"SELECT * FROM {Constants.TableName}";
    int docCount = qldbDriver.Execute(txn => txn.Execute(selectQuery).ToList().Count);

    Assert.AreEqual(250, docCount);
}

This passed without issue. I added some extra logging (and sniffed around on the backend) to verify that FetchPage [code, docs] was used. As expected, I see a single FetchPage call for the additional 50 results.

Are you able to share code that can reproduce the error?

edit: I wrote a similar test for the async driver. Again, couldn't reproduce the failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants