milenkovicm commented on code in PR #1376: URL: https://github.com/apache/datafusion-ballista/pull/1376#discussion_r2714036354
########## examples/examples/standalone-substrait.rs: ########## @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::sync::Arc; + +use ballista::datafusion::common::Result; +use ballista::extension::{Extension, SubstraitSchedulerClient}; +use ballista_core::extension::SessionConfigExt; +use ballista_examples::test_util; +use datafusion::catalog::MemoryCatalogProviderList; +use datafusion::execution::SessionStateBuilder; +use datafusion::prelude::{SessionConfig, SessionContext}; +use datafusion_substrait::serializer::serialize_bytes; +use futures::StreamExt; + +/// This example demonstrates executing Substrait plans against external tables +/// using datafusion-substrait as our frontend. +#[tokio::main] +async fn main() -> Result<()> { + let catalog_list = Arc::new(MemoryCatalogProviderList::new()); Review Comment: it would be good to add the comment here to describe whats the current limitation with the substrait ########## ballista/client/src/extension.rs: ########## @@ -159,6 +163,23 @@ impl SessionContextExt for SessionContext { } } +#[cfg(feature = "standalone")] Review Comment: I don't think we should add this to ballista interface, if needed consider adding it as part of example. ########## ballista/client/tests/substrait_client.rs: ########## @@ -0,0 +1,160 @@ +// Licensed to the Apache Software Foundation (ASF) under one Review Comment: if needed should be moved to be part of example ########## ballista/client/src/extension.rs: ########## @@ -234,3 +256,301 @@ impl Extension { Ok(scheduler_url) } } + Review Comment: same with this one, if needed please add it as part of example ########## ballista/client/Cargo.toml: ########## @@ -33,24 +33,28 @@ ballista-core = { path = "../core", version = "51.0.0" } ballista-executor = { path = "../executor", version = "51.0.0", optional = true } ballista-scheduler = { path = "../scheduler", version = "51.0.0", optional = true } datafusion = { workspace = true } +futures = { workspace = true } log = { workspace = true } - tokio = { workspace = true } +tonic = { workspace = true, optional = true } url = { workspace = true } +uuid = { workspace = true } [dev-dependencies] ballista-executor = { path = "../executor", version = "51.0.0" } ballista-scheduler = { path = "../scheduler", version = "51.0.0" } ctor = { workspace = true } datafusion-proto = { workspace = true } +datafusion-substrait = { workspace = true } env_logger = { workspace = true } rstest = { workspace = true } tempfile = { workspace = true } tonic = { workspace = true } [features] -default = ["standalone"] +default = ["standalone", "substrait"] Review Comment: client should not advertise substrait -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
