Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partiql-visualize-dot: add #438

Merged
merged 5 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ members = [
"partiql-rewriter",
"partiql-types",
"partiql-value",

"partiql-visualize-dot",
alancai98 marked this conversation as resolved.
Show resolved Hide resolved

"extension/partiql-extension-ion",
"extension/partiql-extension-ion-functions",
Expand Down
28 changes: 28 additions & 0 deletions partiql-visualize-dot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "partiql-visualize-dot"
description = "Visulize PartiQL AST and Logical Plan in DOT format"
authors.workspace = true
homepage.workspace = true
repository.workspace = true
license = "Apache-2.0"
readme = "../README.md"
keywords = ["sql", "parser", "query", "compilers", "interpreters"]
categories = ["database", "compilers"]
exclude = [
"**/.git/**",
"**/.github/**",
"**/.travis.yml",
"**/.appveyor.yml",
]
version.workspace = true
edition.workspace = true

[lib]
bench = false

[dependencies]
partiql-ast = { path = "../partiql-ast", version = "0.5.*" }
partiql-logical = { path = "../partiql-logical", version = "0.5.*" }

Copy link
Member

Choose a reason for hiding this comment

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

Could you put a features section for dot visualization and call it something like visualize-dot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not entirely clear how adding visualize-dot to features would be helpful. Please allow me to explain and let me know your thoughts.

From what I can make out, the code in partiql-rust-cli/src/visualize creates an output in dot format, using dot-writer crate.

It then uses other crates to support rendering in different formats, such as png, svg, etc.,

In the current PR, I've only extracted the code to just create dot output. I am guessing when we add support for png, svg output, those can be behind feature flags in order to minimize the dependency graph?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry perhaps I should have added more detail in my initial comment. Since the dot visualization of the logical plan is still experimental / a PoC, we'd like to put the new functions and structures behind a feature similar to what was done for partiql-ast's serde feature:

With how we had defined the serde feature, the above code would only be compiled and built when the serde feature is specified (or --all-features). We would like something similar for partiql-extension-visualize.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added visualize-dot feature. Please review.

dot-writer = "0.1.*"
itertools = "0.10.*"
Loading
Loading