Skip to content

Add post: Lumen now speaks SQL on N-dimensional scientific data#99

Closed
ghostiee-11 wants to merge 7 commits into
holoviz-dev:mainfrom
ghostiee-11:add-lumen-xarray-source-post
Closed

Add post: Lumen now speaks SQL on N-dimensional scientific data#99
ghostiee-11 wants to merge 7 commits into
holoviz-dev:mainfrom
ghostiee-11:add-lumen-xarray-source-post

Conversation

@ghostiee-11

Copy link
Copy Markdown
Collaborator

New post: "Lumen now speaks SQL on N-dimensional scientific data". A writeup of the recently-landed XArraySQLSource (lumen#1741).

The post explains the new capability for an xarray / Zarr / Pangeo audience and walks through the architecture, a real query end-to-end on ARCO-ERA5, the metadata that survives the SQL round-trip, and the design decisions behind per-variable table registration and the xarray-sql plus DataFusion stack.

Assets

  • 4 architecture/explanatory diagrams in the editorial cream/vermillion palette
  • 3 cell screenshots rendered from the validation notebook (Gist)
  • 1 result map (D3 + topojson, plausible temperature field on the NCEP/NCAR grid extent, marked as representative not literal)

ghostiee-11 added 7 commits June 5, 2026 00:34
Writeup of XArraySQLSource (holoviz/lumen#1741) for the xarray, Zarr,
and Pangeo audience. Covers the architecture, a real ARCO-ERA5 query
end to end, the metadata that survives the SQL round-trip, and the
design decisions behind per-variable table registration and the
xarray-sql + DataFusion stack.

Adds 9 files under posts/2026-06-05-lumen-xarray-source/ (index.qmd +
8 PNGs in images/). No project-level config or CSS changes.
…oken xarray-sql repo URL

Section 5 was overclaiming a Dataset round-trip that does not exist
in main today. source.execute(sql) calls .to_pandas() on the
DataFusion result; the SQL result is always a pandas DataFrame. The
coordinate metadata is only accessible via source.get_schema(table),
not on the result itself.

- Renamed section 'What stays intact' to 'Where the metadata lives'
  with honest prose: result type today is DataFrame, metadata is on
  the source schema, the full Dataset round-trip is upstream future
  work tracked at xqlsystems/xarray-sql#58.
- Replaced diagram-4-roundtrip.png (input -> SQL -> Dataset out with
  green checks, depicting xarray-sql#58 design goal) with
  diagram-4-metadata.png (three-panel comparison showing input,
  result-today as DataFrame, and the vermillion-accented schema card
  where the metadata actually lives).
- Fixed broken xarray-sql repo URLs from xarray-contrib/xarray-sql
  (which does not exist) to alxmrs/xarray-sql (the real Apache
  project by Alex Merose).
- Softened opening summary and post description to match: 'metadata
  exposed through the source schema' instead of 'preserved through
  the SQL query'.
Re-rendered the 3 cell mockups and the D3 result map with CSS zoom:2
on the same HTML sources, then cropped to taste. Same compositions
and data, sharper at typical blog content widths.

- nb-cell-03.png  (NOAA air_temperature, STANDARD)
- nb-cell-07.png  (ERA-Interim u/v/z, MULTI-VAR)
- nb-cell-09.png  (10M-row scale, SCALE)
- result-map.png  (D3 global map of the SELECT result)
Previous crops downsampled the 2x source back to ~800px wide,
defeating the upscale. New pass element-targets .stage (caption +
card, no surrounding cream-grid background), giving a tight crop at
full 2x density with no manual cropping needed.
The auto-recapture at .stage + zoom:2 produced sharper pixels but
the framing was off (cell-03 had excess trailing background). Going
back to the user-cropped versions from one commit prior.
@ghostiee-11
ghostiee-11 marked this pull request as ready for review June 4, 2026 20:35
@ghostiee-11

ghostiee-11 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

Hey @ahuang11!! Can you please review this..
Thankyou :)

@ahuang11

ahuang11 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Can you do me a favor and rebase onto holoviz-dev/blog instead of a fork so the build passes?

@ghostiee-11

Copy link
Copy Markdown
Collaborator Author

yeah sure, also got one more thing, the 4th diagram is bit blurry and not generated properly

@ahuang11 ahuang11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great start! I think it should be more geared towards Lumen AI, but you can mention the machinery underneath. Also some parts kind of read like AI. I'd like to share this https://matthewrocklin.com/blog/work/2020/07/13/brevity as what I usually like to do.


![](images/diagram-1-hero.png){fig-align="center"}

Lumen is a SQL-first framework. That makes it natural for tabular

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most people don't really know what Lumen is. Perhaps you can have a brief intro.

watching the coordinates, units, and attributes evaporate on the way
in. The Dask graph behind a lazy Zarr disappeared with them.

Lumen has a proper Source for this: `XArraySQLSource`. It takes any

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you should highlight that you worked on this too on the way to support XArray.

This post walks through what landed, how the source is shaped, what
it preserves, and what is next on the xarray integration roadmap.

## A two-minute recap of Lumen

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe link to this in above.

Comment on lines +46 to +50
If you have not used Lumen before:
[Lumen](https://lumen.holoviz.org) is the declarative data
application framework in the HoloViz stack. You describe a `Source`
(where data comes from), a `Pipeline` (how to filter and transform
it), and a `View` (how to render it). Lumen wires the three together

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most people will not interact with Lumen like this; let's highlight the AI of Lumen instead.

Every downstream consumer now sees a flat table with no idea it
ever knew about coordinates.

![Before vs after, the data path through Lumen.](images/diagram-2-before-after.png){fig-align="center"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Beautiful!

@ghostiee-11

Copy link
Copy Markdown
Collaborator Author

Superseded: I rebased onto holoviz-dev/blog directly as you suggested @ahuang11, see the new PR with the same content (the deploy + auto-commit steps should pass now).

@ghostiee-11 ghostiee-11 closed this Jun 4, 2026
@ahuang11

ahuang11 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Oops just commented :D can you address those and tag me again?

@ghostiee-11

Copy link
Copy Markdown
Collaborator Author

Yeah sure, lemme fix all that and then will tag you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants