Repository navigation
feat(dump): optional fields param to download a column subset - #37
Merged
Merged
Conversation
GET /dump/{resource_id}?fields=a,b (or a JSON array) exports only those
columns, in the given order, for every row. Unknown names are a 400.
Each column subset is cached and GC-swept under its own
dumps/<rid>/fields-<hash>/<fmt>/ prefix, so it never serves or deletes
the whole-table file. Parquet subsets always use an explicit column list
instead of SELECT *. Downloads get a _selected_columns filename suffix.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The NESO data explorer lets users hide columns, and they expect the download to leave those columns out. The whole-table dump (
GET /dump/{resource_id}) could only export every column. The only other route was/dump/query, which runs a fresh SQL export just to drop columns.What
GET /datastore/api/v2/dump/{resource_id}takes an optionalfieldsparam, given asa,b,cor as a JSON array. It is parsed the same way asfieldsondatastore_search._id.400before any BigQuery job runs. A malformedfieldsvalue also returns a400.dumps/<rid>/fields-<hash>/<fmt>/<rev>/. It never serves or deletes the whole-table file and is still covered by the existingdumps/lifecycle rule.SELECT *shortcut would bring back every column._selected_columnssuffix.fieldsis left out or empty, the endpoint behaves exactly as before.API.mdis updated.Tests
WHEREand withORDER BY _id. They also check the separate cache/sweep prefix, the CSV header and that an unknown field is rejected before export.pytest: 679 passed.ruff checkpasses. mypy reports no new errors.