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

Feat/sql pagination 2 #157

Merged

Conversation

matthewmturner
Copy link
Collaborator

@matthewmturner matthewmturner commented Sep 20, 2024

(#141) was becoming hard for me to reason about because FlightSQL pagination has to be handled differently than SQL tab pagination (because on the SQL tab we can control batch size directly on the context but we cant do that with FlightSQL). So I would like to split pagination on each of those tabs into their own PRs to keep them more focused and easier to review / reason about / etc.

So this PR makes pagination work and adds integration tests for testing pagination. There is still room for improvement in the end to end testing (right now we test some of the implementation details) but at least we have some coverage.

@matthewmturner
Copy link
Collaborator Author

Marked as draft as I have not yet added testing for pagination

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests here dont quite test the entire flow like actually happens in the tui. it would be better if we could get a full end to end test with both a query being into to the editor and reading from a file with a known batch number so we could deterministically test

let _ = _event_tx.send(AppEvent::FlightSQLQueryResult(query));
});
}
// KeyCode::Enter => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to come back to this in a follow on PR for paginating FlightSQL

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can somehow hide it behind an interface (so the pagination code for FlightSQL and local are the same) 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that would be nice. I want to finalize the functionality for flightsql first - then with both features complete i think it will be easier to reason about what the appropriate interface should be.

}
});
}
// #[cfg(feature = "flightsql")]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming back to this in follow on PR as well

@matthewmturner matthewmturner marked this pull request as ready for review September 21, 2024 15:37
@matthewmturner
Copy link
Collaborator Author

@alamb I plan to merge this in the coming day or two (will leave for a bit in case your interested, but no pressure to review if you dont have time) and then work on flightsql pagination next. I had to comment out some stuff for flightsql that was dependent on the sql code - that will be fixed in the follow on pr.

Comment on lines 168 to +169
pub fn record_batches_to_table<'frame, 'results>(
record_batches: &'results [RecordBatch],
record_batches: &'results [&RecordBatch],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what the signature of this function will be yet - should be finalized in the flightsql PR

@@ -14,78 +14,15 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//

@matthewmturner matthewmturner merged commit c431b3a into datafusion-contrib:main Sep 23, 2024
3 checks passed
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I briefly skimmed this PR @matthewmturner -- and it looks quite cool. Thank you 🙏

let _ = _event_tx.send(AppEvent::FlightSQLQueryResult(query));
});
}
// KeyCode::Enter => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can somehow hide it behind an interface (so the pagination code for FlightSQL and local are the same) 🤔

@@ -0,0 +1,211 @@
// Licensed to the Apache Software Foundation (ASF) under one
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE!

@matthewmturner matthewmturner linked an issue Oct 5, 2024 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Querys that return large # of results can freeze / crash the app
2 participants