Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
9 changes: 7 additions & 2 deletions rust/datafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ path = "src/lib.rs"

[[bin]]
name = "datafusion-cli"
path = "src/bin/repl.rs"
path = "src/bin/main.rs"

[features]
default = ["cli"]
cli = ["rustyline"]

[dependencies]
fnv = "1.0.3"
Expand All @@ -47,12 +51,13 @@ serde_derive = "1.0.80"
serde_json = "1.0.33"
sqlparser = "0.2.0"
clap = "2.33.0"
rustyline = "4.1.0"
prettytable-rs = "0.8.0"
rustyline = {version = "4.1.0", optional = true}

[dev-dependencies]
criterion = "0.2.0"


[[bench]]
name = "aggregate_query_sql"
harness = false
Expand Down
25 changes: 25 additions & 0 deletions rust/datafusion/src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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.

// Only bring in dependencies for the repl when the cli feature is enabled.
#[cfg(feature = "cli")]
mod repl;

pub fn main() {
#[cfg(feature = "cli")]
repl::main()
}
7 changes: 2 additions & 5 deletions rust/datafusion/src/bin/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@

#![allow(bare_trait_objects)]

#[macro_use]
extern crate clap;

use arrow::array::*;
use arrow::datatypes::{DataType, TimeUnit};
use clap::{App, Arg};
use clap::{crate_version, App, Arg};
use datafusion::error::{ExecutionError, Result};
use datafusion::execution::context::ExecutionContext;
use datafusion::execution::relation::Relation;
Expand All @@ -32,7 +29,7 @@ use std::cell::RefMut;
use std::env;
use std::path::Path;

fn main() {
pub fn main() {
let matches = App::new("DataFusion")
.version(crate_version!())
.about(
Expand Down