Repository navigation
Conversation
- Normalize character-backed SQL dates and timestamps to ISO format - Route viewer requests to their originating R session - Discard queued pages and interrupt active reads when viewers close - Keep RPC polling alive after interruption
…torSupport#1795) * feat: option to suppress sess success message and remove prompt from print_async_msg * fix: prompt for sess reconnect only
|
I wonder if we should reconsider how lazy objects are handled before adding backend-driven paging/filtering/sorting here. Existing tools generally seem to treat lazy/remote data as a bounded preview rather than a full query client. For example, dbplyr prints only a small head without querying the total row count, DuckDB UI previews the first 100 rows, and DBeaver fetches a limited batch by default and makes “Fetch All” explicit. Given that precedent, could we instead evaluate a lazy object once for the first N rows (possibly configurable, with N+1 used to detect truncation) and materialize that as a local snapshot (Ideally, it would be an This would also remove a substantial amount of backend-specific paging/cache/query logic. |
I have already implemented it so that each paged fetch is written to Arrow IPC during scrolling. If the user scrolls backward and the requested data is already cached in IPC, the cached data is reused. Requests beyond the cached range continue fetching from the existing result stream rather than re-evaluating the query. This has been done for |
- Execute transformed database queries using their original SQL - Clear cached results after failed or interrupted database fetches - Select cached rows in Arrow before converting them into R - Add regression coverage for retries, ordering, and cache conversion
- Apply viewer operations to cached Arrow and dbplyr query results - Reuse the original execution and restore its order when controls clear - Cover paging, projections, filtering, sorting, retries, and cancellation - Require lazy-query test dependencies in CI
- Clear partial Arrow caches after read errors or cancellation - Ignore unknown workspace row counts when registering queries - Use scanner fallback for nested Parquet schemas - Open lazy queries directly in the paged viewer from R Interactive - Add CI regression coverage for recovery, paging, and View entry paths
|
Superseded by #1876 |
Closes #1785
This might be a big change to support both
Arrow'sFileSystemDatasetandSQL Serverin the Data Viewer. I submit it here for review and discussion. It is not necessarily intended to adopt both of them. The implementations are more complicated than I initially thought, especially when performance is one part of the goals. Nevertheless, the following decisions are mine, with GPT used to generate and iterate on the implementation here.Summary
Add lazy/on-demand Data Viewer support for large Arrow and DBI-backed data sources without loading the full dataset into memory.
Arrow and DBI now share the same general paging model:
dplyr::arrange()).The existing in-memory Data Viewer behaviour remains unchanged.
Changes
Arrow
integer64, dates, datetimes, durations, and nested columns.DBI
tbl_sqlobjects, currently targeting SQL Server.dbFetch()for continuous forward scrolling.OFFSETto reposition the result for jumps or backward requests outside the cache.ORDER BYclauses inside SQL Server subqueries where they are invalid.Other changes
sess/R/handlers.Rsess/R/server.Rsesscontinues processing subsequent requests after an interrupted Data Viewer fetch.src/session.tssess/DESCRIPTIONData Viewer tests
Arrow and DBI use backend-specific strategies under the same Data Viewer behaviour: Arrow keeps source-row mappings for efficient random access, while DBI lets SQL Server perform filtering and sorting and streams the resulting rows through an open database result.
Validation
Added regression tests covering: