Skip to content

feat: render .parquet files as a data preview#9666

Open
nishantmonu51 wants to merge 5 commits into
mainfrom
parquet_render
Open

feat: render .parquet files as a data preview#9666
nishantmonu51 wants to merge 5 commits into
mainfrom
parquet_render

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator

Clicking a .parquet file in the file browser previously threw No renderer available for file type: .parquet. This adds a renderer that reads the file with DuckDB and shows its contents.

  • Route .parquet files to a new ParquetWorkspace that queries the file via read_parquet(...) (through the sql resolver) and renders the rows and schema in the standard preview table
  • Resolve the file's absolute path from the repo connector root; DuckDB resolves relative paths against its own working directory, so a relative path was unreliable
  • Add an isPreviewableDataFile flag on FileArtifact and skip fetching the (binary) text content for these files on both the web-local and web-admin edit routes
  • Add a dedicated icon for .parquet files in the file browser

Only .parquet is included; CSV/TSV still open in the text editor.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

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
@nishantmonu51 nishantmonu51 requested a review from AdityaHegde July 8, 2026 19:34
- 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
@@ -0,0 +1,8 @@
<script>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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
@nishantmonu51 nishantmonu51 requested a review from AdityaHegde July 9, 2026 17:48
@nishantmonu51 nishantmonu51 added Type:Feature New feature request Size:M Medium change: 100-499 lines labels Jul 10, 2026
Move the ParquetWorkspace error/status strings to paraglide messages
(en/es), matching the i18n framework introduced on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size:M Medium change: 100-499 lines Type:Feature New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants