feat: render .parquet files as a data preview#9666
Open
nishantmonu51 wants to merge 5 commits into
Open
Conversation
Clicking a .parquet file in the file browser previously threw "No renderer available for file type: .parquet". Add a renderer that queries the file with DuckDB and shows its contents in a preview table. - Add `isPreviewableDataFile` to FileArtifact and route .parquet files to a new `ParquetWorkspace` that reads them via `read_parquet(...)` - Resolve the file's absolute path from the repo connector root, since DuckDB resolves relative paths against its own working directory - Skip fetching (binary) text content for these files - Add a dedicated icon for .parquet files in the file browser
- Explicitly target a DuckDB connector for the read_parquet query so projects whose default OLAP connector is not DuckDB (e.g. ClickHouse) still get a preview instead of an error - Key the preview query on the project-relative path and invalidate it on FILE_EVENT_WRITE, so overwriting the file refreshes the table; also skip the pointless binary content fetch for these files in the watcher
AdityaHegde
requested changes
Jul 9, 2026
| @@ -0,0 +1,8 @@ | |||
| <script> | |||
Collaborator
There was a problem hiding this comment.
This feels hacky. Maybe there is a better way to directly use Sheet icon? If it is only for setting stroke-icon-muted then lets always set it?
| `SELECT * FROM read_parquet('${absolutePath.replaceAll("'", "''")}')`, | ||
| ); | ||
|
|
||
| let previewQuery = $derived( |
Collaborator
There was a problem hiding this comment.
Lets move this query to parquet-preview?
| if (artifact.isPreviewableDataFile) { | ||
| // Data files (e.g. .parquet) have no editable text content; refresh | ||
| // their DuckDB-powered preview instead of fetching binary content. | ||
| void queryClient.invalidateQueries({ |
Collaborator
There was a problem hiding this comment.
How about having some switch based on extension? Invalidating parquet queries directly feels incorrect.
Or leave a TODO at isPreviewableDataFile?
- Use the lucide `Sheet` icon directly for .parquet files instead of a one-off wrapper component - Move the preview query construction into `parquet-preview` - Invalidate the preview via an extension switch in the file invalidator rather than referencing the Parquet query key directly
Move the ParquetWorkspace error/status strings to paraglide messages (en/es), matching the i18n framework introduced on main.
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.
Clicking a
.parquetfile in the file browser previously threwNo renderer available for file type: .parquet. This adds a renderer that reads the file with DuckDB and shows its contents..parquetfiles to a newParquetWorkspacethat queries the file viaread_parquet(...)(through thesqlresolver) and renders the rows and schema in the standard preview tableisPreviewableDataFileflag onFileArtifactand skip fetching the (binary) text content for these files on both theweb-localandweb-adminedit routes.parquetfiles in the file browserOnly
.parquetis included; CSV/TSV still open in the text editor.Checklist:
Developed in collaboration with Claude Code