mbrobbel commented on code in PR #2267: URL: https://github.com/apache/arrow-adbc/pull/2267#discussion_r1811157935
########## rust/drivers/datafusion/README.md: ########## @@ -0,0 +1,50 @@ +<!--- + 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. +--> + +# ADBC Driver for Apache DataFusion + +## Example Usage + +``` +use adbc_core::driver_manager::ManagedDriver; +use adbc_core::options::AdbcVersion; +use adbc_core::{Connection, Database, Driver, Statement}; +use arrow::util::pretty::print_batches; Review Comment: ```suggestion use arrow_cast::pretty::print_batches; ``` ########## rust/drivers/datafusion/tests/test_datafusion.rs: ########## @@ -0,0 +1,142 @@ +// 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 adbc_core::driver_manager::{ManagedConnection, ManagedDriver}; +use adbc_core::{Connection, Database, Driver, Statement}; +use arrow_array::RecordBatch; +use datafusion::prelude::*; + +use adbc_core::options::AdbcVersion; +use arrow::compute::concat_batches; Review Comment: ```suggestion use arrow_select::concat::concat_batches; ``` ########## rust/drivers/datafusion/src/lib.rs: ########## @@ -0,0 +1,822 @@ +// 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 datafusion::datasource::TableType; +use datafusion::prelude::*; +use datafusion_substrait::logical_plan::consumer::from_substrait_plan; +use datafusion_substrait::substrait::proto::Plan; +use prost::Message; +use std::sync::Arc; +use std::vec::IntoIter; +use std::{collections::HashMap, fmt::Debug}; +use tokio::runtime::Runtime; + +use arrow::array::{ Review Comment: ```suggestion use arrow_array::{ ``` ########## rust/Cargo.toml: ########## @@ -34,6 +34,7 @@ categories = ["database"] [workspace.dependencies] adbc_core = { path = "./core" } +arrow = { version = "53.1.0", default-features = false } Review Comment: Instead of adding `arrow` we can add the `arrow` subcrates to reduce the size of our dependency tree. It looks like we need to add: - `arrow-cast` for https://docs.rs/arrow-cast/latest/arrow_cast/pretty/fn.print_batches.html (`dev-dependency`) - `arrow-select` for https://docs.rs/arrow-select/latest/arrow_select/concat/fn.concat_batches.html -- 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]
