Online Parquet Viewer with Rust

No JS, no server, just Rust
Author

Xiangpeng Hao

Published

November 12, 2024

Quick look

Online here: https://parquet-viewer.haoxp.xyz

Source code: parquet-viewer

Run SQL queries

Visualize query plans

Examine metadata

How it works

It compiles Parquet/Arrow/DataFusion to webassembly which runs in the browser.

Specifically, it uses trunk to pack wasm files, leptos to build reactive UI components, and Tailwind CSS for styling.

And most importantly, LLM wrote most of the code.

Why do I need this?

Parquet files are not human-readable, you can’t just open them like CSV or JSON files.

Of course, there are many CLI tools that allow you to inspect file content – if you enjoy deciphering cryptic CLI args.

There are also Java/C#/Windows applications that provide GUI options – if you’re nostalgia for the 90s.

But with this tool, everything happens inside your favorite browser, written in your favorite language, using your favorite tech stack.

Simply drag and drop the file, and all the important information is in front of you.

Rust for frontend?

The good

  • Leptos is surprisingly intuitive and easy-to-use.
  • DataFusion/Arrow/Parquet compiles to wasm with almost no modification.
  • There’s surprisingly small amount of code needed to build an interactive UI.

The bad

  • Build size is large, debug build is 100MB, release build is 40MB. Poor dev experience due to laggy edit-build-run cycle. (User experience is fine, though)
  • Not every crate is wasm-compatible, and it’s very difficult to triangle down the root cause.
  • I haven’t figure out how to nicely use JavaScript yet – sometimes you do need JS.