Crates.io | qpml |
lib.rs | qpml |
version | 0.14.0 |
source | src |
created_at | 2022-12-18 20:54:31.068887 |
updated_at | 2024-01-18 00:23:06.333613 |
description | Query Plan Markup Language (QPML) |
homepage | https://github.com/andygrove/qpml |
repository | https://github.com/andygrove/qpml |
max_upload_size | |
id | 740598 |
size | 438,690 |
QPML is a utility for visualizing query plans, intended to help produce documentation and presentations.
Query plan diagrams can easily be hand-coded in the YAML-based Query Plan Markup Language, or can be imported from Substrait query plans, or from text representations of query plans, as displayed by an EXPLAIN command.
Here is a minimal example of a QPML file. See examples/nested-join.yaml for a fuller example.
diagram:
title: 'Inner Join: w_warehouse_sk = inv_warehouse_sk'
style: join
inputs:
- title: 'Inner Join: cs_item_sk = inv_item_sk'
style: join
inputs:
- title: catalog_sales
style: table
- title: inventory
style: table
- title: warehouse
style: table
styles:
- name: table
color: lightblue
shape: rectangle
- name: join
color: lightgreen
shape: rectangle
qpml dot minimal.qpml > minimal.dot
dot -Tpng minimal.dot > minimal.png
$ qpml mermaid minimal.qpml > minmal.md
flowchart TD
node0[Inner Join: w_warehouse_sk = inv_warehouse_sk] --> node0_0[Inner Join: cs_item_sk = inv_item_sk]
node0_0[Inner Join: cs_item_sk = inv_item_sk] --> node0_0_0[catalog_sales]
node0_0[Inner Join: cs_item_sk = inv_item_sk] --> node0_0_1[inventory]
node0[Inner Join: w_warehouse_sk = inv_warehouse_sk] --> node0_1[warehouse]
$ qpml print minimal.qpml
Inner Join: w_warehouse_sk = inv_warehouse_sk
Inner Join: cs_item_sk = inv_item_sk
catalog_sales
inventory
warehouse
See the QPML Documentation for more information.