Skip to content

Commit

Permalink
feat: serialize/deserialize logical and execution plan via substrait (#…
Browse files Browse the repository at this point in the history
…317)

* fix: change Utf8Array indice type

Signed-off-by: Ruihang Xia <[email protected]>

* refactor: remove unused sub-crate

Signed-off-by: Ruihang Xia <[email protected]>

* feat: impl for both Logical and Execution plan

Signed-off-by: Ruihang Xia <[email protected]>

* refactor: move test-util subcrate into table

Signed-off-by: Ruihang Xia <[email protected]>

* test: table scan logical plan round trip

Signed-off-by: Ruihang Xia <[email protected]>

* drop support of physical plan

Signed-off-by: Ruihang Xia <[email protected]>

* fix warnings

Signed-off-by: Ruihang Xia <[email protected]>

* rename trait fns to encode/decode

Signed-off-by: Ruihang Xia <[email protected]>

* address review comments

Signed-off-by: Ruihang Xia <[email protected]>

Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia authored Oct 24, 2022
1 parent 6fc45e3 commit 8ab43b6
Show file tree
Hide file tree
Showing 9 changed files with 590 additions and 27 deletions.
112 changes: 95 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ members = [
"src/common/query",
"src/common/recordbatch",
"src/common/runtime",
"src/common/substrait",
"src/common/telemetry",
"src/common/time",
"src/datanode",
"src/datatypes",
"src/frontend",
"src/log-store",
"src/logical-plans",
"src/meta-client",
"src/meta-srv",
"src/object-store",
Expand Down
2 changes: 1 addition & 1 deletion src/common/grpc/src/physical/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl ExecutionPlan for MockExecution {
_runtime: Arc<RuntimeEnv>,
) -> datafusion::error::Result<SendableRecordBatchStream> {
let id_array = Arc::new(PrimitiveArray::from_slice([1u32, 2, 3, 4, 5]));
let name_array = Arc::new(Utf8Array::<i64>::from_slice([
let name_array = Arc::new(Utf8Array::<i32>::from_slice([
"zhangsan", "lisi", "wangwu", "Tony", "Mike",
]));
let age_array = Arc::new(PrimitiveArray::from_slice([25u32, 28, 27, 35, 25]));
Expand Down
25 changes: 25 additions & 0 deletions src/common/substrait/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "substrait"
version = "0.1.0"
edition = "2021"

[dependencies]
bytes = "1.1"
catalog = { path = "../../catalog" }
common-error = { path = "../error" }
datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = [
"simd",
] }
futures = "0.3"
prost = "0.9"
snafu = { version = "0.7", features = ["backtraces"] }
table = { path = "../../table" }

[dependencies.substrait_proto]
package = "substrait"
version = "0.2"

[dev-dependencies]
datatypes = { path = "../../datatypes" }
table = { path = "../../table" }
tokio = { version = "1.0", features = ["full"] }
Loading

0 comments on commit 8ab43b6

Please sign in to comment.