Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
b42ebe7
Clarify docs about `Accumulator::update` and `Accumulator::update_bat…
alamb Jan 11, 2022
b05feda
Mark ARRAY_AGG(DISTINCT ...) not implemented (#1534)
james727 Jan 11, 2022
06d147a
Add batch operations to stddev (#1547)
realno Jan 11, 2022
e1e7b86
Address clippy warnings (#1553)
sergey-melnychuk Jan 12, 2022
14176ff
Update to arrow-7.0.0 (#1523)
alamb Jan 12, 2022
794b92b
Remove unused `update` and `merge` implementations from Aggregates an…
alamb Jan 13, 2022
cf76969
Make call SchedulerServer::new once in ballista-scheduler process (#1…
Ted-Jiang Jan 13, 2022
b4c77e5
Add covar operators (#1551)
realno Jan 13, 2022
d7e465a
Initial MemoryManager and DiskManager APIs for query execution + Ext…
yjshen Jan 13, 2022
811bb51
Update to rust 1.58 (#1557)
xudong963 Jan 14, 2022
0bddfb7
support cast/try_cast for decimal: signed numeric to decimal (#1442)
liukun4515 Jan 14, 2022
1c39f5c
support comparison for decimal data type and refactor the binary coer…
liukun4515 Jan 14, 2022
b743610
add correlation function (#1561)
realno Jan 16, 2022
1dae7e2
Rename sql integration tests from `mod` to `sql_integration` (#1575)
alamb Jan 16, 2022
bbfc2c0
update reference to python and update readme (#1581)
jimexist Jan 16, 2022
278e859
minor: improve the benchmark readme (#1567)
xudong963 Jan 16, 2022
438b417
Tests for support try_cast/cast decimal to numeric (#1465)
liukun4515 Jan 16, 2022
6f7b2d2
implement Hash for various types and replace PartialOrd (#1580)
jimexist Jan 16, 2022
f027e5f
add from_slice trait to ease arrow2 migration (#1588)
jimexist Jan 17, 2022
92a3e45
Consolidate `batch_size` configuration in `ExecutionConfig`, `Runtime…
yjshen Jan 17, 2022
30df911
support from_slice for binary, string, and boolean array types (#1589)
jimexist Jan 17, 2022
059e52b
update nightly version (#1597)
jimexist Jan 17, 2022
82e8003
remove update and merge (#1582)
jimexist Jan 18, 2022
c549d51
support mathematics operation for decimal data type (#1554)
liukun4515 Jan 18, 2022
fefbfc8
add test for decimal to decimal (#1603)
liukun4515 Jan 18, 2022
8ebc94c
fix: casting Int64 to Float64 unsuccessfully caused tpch8 to fail (#1…
xudong963 Jan 18, 2022
444c153
Add support show tables and show columns for ballista (#1593)
EricJoy2048 Jan 18, 2022
ad392fd
Fix comparison of dictionary arrays (#1606)
alamb Jan 19, 2022
345f727
Replace Datafusion Error with Generic Error for Object store (#1541)
matthewmturner Jan 19, 2022
eb51fae
consolidate binary_expr coercion rule code into `binary_rule.rs` modu…
alamb Jan 20, 2022
a96bb5e
Implement ARRAY_AGG(DISTINCT ...) (#1579)
james727 Jan 20, 2022
d93cf79
Add roadmap to readme (#1616)
matthewmturner Jan 20, 2022
2f702e4
fix: sql planner creates cross join instead of inner join from select…
xudong963 Jan 21, 2022
e92225d
feat: Support complex interval via IntervalMonthDayNano (#1615)
ovr Jan 21, 2022
03075d5
Fix null comparison for Parquet pruning predicate (#1595)
viirya Jan 21, 2022
3c5a679
fix dependabot (#1625)
xudong963 Jan 21, 2022
7d819d1
Consolidate sort and external_sort (#1596)
yjshen Jan 21, 2022
62edddb
Optimize `SortPreservingMergeStream` to avoid `SortKeyCursor` sharing…
yjshen Jan 22, 2022
cc8f325
Update pyo3 requirement from 0.14 to 0.15 (#1627)
dependabot[bot] Jan 22, 2022
67a598c
Update etcd-client requirement from 0.7 to 0.8 (#1626)
dependabot[bot] Jan 22, 2022
0762bf0
Update hashbrown requirement from 0.11 to 0.12 (#1631)
dependabot[bot] Jan 22, 2022
af8786e
support hash decimal array and group by (#1640)
liukun4515 Jan 22, 2022
1c63759
Add spill_count and spilled_bytes to baseline metrics, test sort with…
yjshen Jan 22, 2022
15af24a
Add `DataFusionError` -> `ArrowError` conversion (#1643)
alamb Jan 22, 2022
9c5ccae
update md-5, sha2, blake2 (#1647)
xudong963 Jan 23, 2022
71757bb
Introduce push-based task scheduling for Ballista (#1560)
yahoNanJing Jan 23, 2022
4a2453a
fix a cte block with same name for many times (#1639)
xudong963 Jan 23, 2022
deaa8ac
Handle merging of evolved schemas in ParquetExec (#1622)
thinkharderdev Jan 23, 2022
01b5244
refine match pattern related code (#1650)
xudong963 Jan 23, 2022
6ec18bb
Consolidate Schema and RecordBatch projection (#1638)
alamb Jan 23, 2022
741df36
Remove DataFusionError::into_arrow_external_error (#1645)
alamb Jan 24, 2022
c63cfd4
Move AggregatedMetricsSet to metrics for further reuse (#1663)
yjshen Jan 24, 2022
97f95b3
Make `MemoryManager` and `MemoryStream` public (#1664)
yjshen Jan 24, 2022
618c1e8
feat: Support Substring(str [from int] [for int]) (#1621)
ovr Jan 24, 2022
2a9df64
[Ballista] Fix scheduler state mod bug (#1655)
EricJoy2048 Jan 24, 2022
992624a
Fix predicate pushdown for outer joins (#1618)
james727 Jan 24, 2022
271b6ba
feat: Support quarter granularity in date_trunct fn (#1667)
ovr Jan 25, 2022
6c8d642
Update to arrow 8.0.0 (#1673)
alamb Jan 25, 2022
bf68073
[Ballista] Add Decimal128, Date64, TimestampSecond, TimestampMillisec…
EricJoy2048 Jan 25, 2022
ee91c68
upgrade clap to version 3 (#1672)
jimexist Jan 25, 2022
7153fac
Improve configuration and resource use of `MemoryManager` and `DiskMa…
alamb Jan 25, 2022
bffa5e4
Use NamedTempFile rather than `String` in DiskManager (#1680)
alamb Jan 26, 2022
48ad975
Add VegaFusion as project that uses DataFusion (#1683)
jonmmease Jan 26, 2022
54da006
Stop merging avro schemas as it doesn't support list of lists
Igosuki Jan 26, 2022
d297540
Add a new metric type: `Gauge` + `CurrentMemoryUsage` to metrics (#1682)
yjshen Jan 26, 2022
fdbd608
enhance arithmetic operation for array with scalar (#1552)
liukun4515 Jan 26, 2022
bf71577
refactor array_agg to not to have `update` and `merge` (#1681)
jimexist Jan 27, 2022
2266474
Fix bug while merging `RecordBatch`, add `SortPreservingMerge` fuzz t…
alamb Jan 27, 2022
63d24bf
Make `SortPreservingMergeStream` stable on input stream order (#1687)
alamb Jan 27, 2022
97415ca
use the latest arrow2 with Chunk
Igosuki Jan 27, 2022
18918fa
Merge branch 'master' into i_arrow2
Igosuki Jan 27, 2022
a7ec38e
resolve up to last datafusion issue with SortColumn using a reference…
Igosuki Jan 28, 2022
eea061f
Fix other crates and address check warnings
Igosuki Jan 28, 2022
ab48bb2
clippy
Igosuki Jan 28, 2022
98f98d1
test fix #1, errors and debug strings
Igosuki Jan 28, 2022
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 @@ -35,6 +35,6 @@ lto = true
codegen-units = 1

[patch.crates-io]
arrow2 = { git = "https://github.com/jorgecarleitao/arrow2.git", rev = "ef7937dfe56033c2cc491482c67587b52cd91554" }
arrow2 = { git = "https://github.com/jorgecarleitao/arrow2.git", branch = "main" }
#arrow2 = { git = "https://github.com/blaze-init/arrow2.git", branch = "shuffle_ipc" }
#parquet2 = { git = "https://github.com/blaze-init/parquet2.git", branch = "meta_new" }
7 changes: 4 additions & 3 deletions ballista/rust/client/src/columnar_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ use datafusion::arrow::{
array::ArrayRef,
compute::aggregate::estimated_bytes_size,
datatypes::{DataType, Schema},
record_batch::RecordBatch,
};
use datafusion::field_util::{FieldExt, SchemaExt};
use datafusion::record_batch::RecordBatch;
use datafusion::scalar::ScalarValue;

pub type MaybeColumnarBatch = Result<Option<ColumnarBatch>>;
Expand All @@ -44,7 +45,7 @@ impl ColumnarBatch {
.enumerate()
.map(|(i, array)| {
(
batch.schema().field(i).name().clone(),
batch.schema().field(i).name().to_string(),
ColumnarValue::Columnar(array.clone()),
)
})
Expand All @@ -61,7 +62,7 @@ impl ColumnarBatch {
.fields()
.iter()
.enumerate()
.map(|(i, f)| (f.name().clone(), values[i].clone()))
.map(|(i, f)| (f.name().to_string(), values[i].clone()))
.collect();

Self {
Expand Down
4 changes: 2 additions & 2 deletions ballista/rust/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ tonic = "0.6"
uuid = { version = "0.8", features = ["v4"] }
chrono = { version = "0.4", default-features = false }

arrow-format = { version = "0.3", features = ["flight-data", "flight-service"] }
arrow = { package = "arrow2", version="0.8", features = ["io_ipc", "io_flight"] }
arrow-format = { version = "0.4", features = ["flight-data", "flight-service"] }
arrow = { package = "arrow2", version="0.9", features = ["io_ipc", "io_flight"] }

datafusion = { path = "../../../datafusion", version = "6.0.0" }

Expand Down
8 changes: 5 additions & 3 deletions ballista/rust/core/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ use datafusion::arrow::{
array::{StructArray, Utf8Array},
datatypes::{Schema, SchemaRef},
error::{ArrowError, Result as ArrowResult},
record_batch::RecordBatch,
};
use datafusion::field_util::SchemaExt;
use datafusion::physical_plan::common::collect;
use datafusion::physical_plan::{ExecutionPlan, SendableRecordBatchStream};
use datafusion::record_batch::RecordBatch;
use datafusion::{logical_plan::LogicalPlan, physical_plan::RecordBatchStream};
use futures::{Stream, StreamExt};
use log::debug;
Expand Down Expand Up @@ -174,11 +175,12 @@ impl Stream for FlightDataStream {

arrow::io::flight::deserialize_batch(
&flight_data_chunk,
self.schema.clone(),
self.schema.fields(),
&self.ipc_schema,
&hm,
)
});
})
.map(|c| RecordBatch::new_with_chunk(&self.schema, c));
Some(converted_chunk)
}
None => None,
Expand Down
2 changes: 1 addition & 1 deletion ballista/rust/core/src/execution_plans/shuffle_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ use crate::utils::WrappedStream;
use async_trait::async_trait;
use datafusion::arrow::datatypes::SchemaRef;
use datafusion::arrow::error::Result as ArrowResult;
use datafusion::arrow::record_batch::RecordBatch;
use datafusion::physical_plan::metrics::{
ExecutionPlanMetricsSet, MetricBuilder, MetricsSet,
};
use datafusion::physical_plan::{
DisplayFormatType, ExecutionPlan, Metric, Partitioning, Statistics,
};
use datafusion::record_batch::RecordBatch;
use datafusion::{
error::{DataFusionError, Result},
physical_plan::RecordBatchStream,
Expand Down
7 changes: 5 additions & 2 deletions ballista/rust/core/src/execution_plans/shuffle_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use crate::utils;

use crate::serde::protobuf::ShuffleWritePartition;
use crate::serde::scheduler::{PartitionLocation, PartitionStats};
use arrow::chunk::Chunk;
use arrow::io::ipc::write::WriteOptions;
use async_trait::async_trait;
use datafusion::arrow::array::*;
Expand All @@ -41,8 +42,8 @@ use datafusion::arrow::compute::take;
use datafusion::arrow::datatypes::{DataType, Field, Schema, SchemaRef};
use datafusion::arrow::io::ipc::read::FileReader;
use datafusion::arrow::io::ipc::write::FileWriter;
use datafusion::arrow::record_batch::RecordBatch;
use datafusion::error::{DataFusionError, Result};
use datafusion::field_util::SchemaExt;
use datafusion::physical_plan::hash_utils::create_hashes;
use datafusion::physical_plan::metrics::{
self, ExecutionPlanMetricsSet, MetricBuilder, MetricsSet,
Expand All @@ -52,6 +53,7 @@ use datafusion::physical_plan::Partitioning::RoundRobinBatch;
use datafusion::physical_plan::{
DisplayFormatType, ExecutionPlan, Metric, Partitioning, RecordBatchStream, Statistics,
};
use datafusion::record_batch::RecordBatch;
use futures::StreamExt;
use hashbrown::HashMap;
use log::{debug, info};
Expand Down Expand Up @@ -468,7 +470,8 @@ impl ShuffleWriter {
}

fn write(&mut self, batch: &RecordBatch) -> Result<()> {
self.writer.write(batch, None)?;
let chunk = Chunk::new(batch.columns().to_vec());
self.writer.write(&chunk, None)?;
self.num_batches += 1;
self.num_rows += batch.num_rows() as u64;
let num_bytes: usize = batch
Expand Down
3 changes: 2 additions & 1 deletion ballista/rust/core/src/memory_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

use std::task::{Context, Poll};

use datafusion::arrow::{datatypes::SchemaRef, error::Result, record_batch::RecordBatch};
use datafusion::arrow::{datatypes::SchemaRef, error::Result};
use datafusion::physical_plan::RecordBatchStream;
use datafusion::record_batch::RecordBatch;
use futures::Stream;

/// Iterator over batches
Expand Down
1 change: 1 addition & 0 deletions ballista/rust/core/src/serde/logical_plan/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,7 @@ impl TryInto<Field> for &protobuf::Field {
}

use crate::serde::protobuf::ColumnStats;
use datafusion::field_util::SchemaExt;
use datafusion::physical_plan::{aggregates, windows};
use datafusion::prelude::{
array, date_part, date_trunc, length, lower, ltrim, md5, rtrim, sha224, sha256,
Expand Down
1 change: 1 addition & 0 deletions ballista/rust/core/src/serde/logical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod roundtrip_tests {
use crate::error::BallistaError;
use arrow::datatypes::UnionMode;
use core::panic;
use datafusion::field_util::SchemaExt;
use datafusion::logical_plan::Repartition;
use datafusion::{
arrow::datatypes::{DataType, Field, IntervalUnit, Schema, TimeUnit},
Expand Down
1 change: 1 addition & 0 deletions ballista/rust/core/src/serde/logical_plan/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use datafusion::datasource::TableProvider;

use datafusion::datasource::file_format::parquet::ParquetFormat;
use datafusion::datasource::listing::ListingTable;
use datafusion::field_util::{FieldExt, SchemaExt};
use datafusion::logical_plan::plan::{
Aggregate, EmptyRelation, Filter, Join, Projection, Sort, Window,
};
Expand Down
1 change: 1 addition & 0 deletions ballista/rust/core/src/serde/physical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub mod to_proto;
mod roundtrip_tests {
use std::{convert::TryInto, sync::Arc};

use datafusion::field_util::SchemaExt;
use datafusion::{
arrow::{
compute::sort::SortOptions,
Expand Down
3 changes: 2 additions & 1 deletion ballista/rust/core/src/serde/physical_plan/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use std::{
sync::Arc,
};

use datafusion::field_util::FieldExt;
use datafusion::physical_plan::hash_join::{HashJoinExec, PartitionMode};
use datafusion::physical_plan::limit::{GlobalLimitExec, LocalLimitExec};
use datafusion::physical_plan::projection::ProjectionExec;
Expand Down Expand Up @@ -197,7 +198,7 @@ impl TryInto<protobuf::PhysicalPlanNode> for Arc<dyn ExecutionPlan> {
.aggr_expr()
.iter()
.map(|expr| match expr.field() {
Ok(field) => Ok(field.name().clone()),
Ok(field) => Ok(field.name().to_string()),
Err(e) => Err(BallistaError::DataFusionError(e)),
})
.collect::<Result<_, Self::Error>>()?;
Expand Down
7 changes: 5 additions & 2 deletions ballista/rust/core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use crate::memory_stream::MemoryStream;
use crate::serde::scheduler::PartitionStats;

use crate::config::BallistaConfig;
use arrow::chunk::Chunk;
use async_trait::async_trait;
use datafusion::arrow::datatypes::Schema;
use datafusion::arrow::datatypes::SchemaRef;
Expand All @@ -41,12 +42,12 @@ use datafusion::arrow::{
datatypes::{DataType, Field},
io::ipc::read::FileReader,
io::ipc::write::FileWriter,
record_batch::RecordBatch,
};
use datafusion::error::DataFusionError;
use datafusion::execution::context::{
ExecutionConfig, ExecutionContext, ExecutionContextState, QueryPlanner,
};
use datafusion::field_util::SchemaExt;
use datafusion::logical_plan::{LogicalPlan, Operator};
use datafusion::physical_optimizer::coalesce_batches::CoalesceBatches;
use datafusion::physical_optimizer::merge_exec::AddCoalescePartitionsExec;
Expand All @@ -64,6 +65,7 @@ use datafusion::physical_plan::sort::SortExec;
use datafusion::physical_plan::{
metrics, AggregateExpr, ExecutionPlan, Metric, PhysicalExpr, RecordBatchStream,
};
use datafusion::record_batch::RecordBatch;
use futures::{future, Stream, StreamExt};
use std::time::Instant;

Expand Down Expand Up @@ -104,7 +106,8 @@ pub async fn write_stream_to_disk(
num_bytes += batch_size_bytes;

let timer = disk_write_metric.timer();
writer.write(&batch, None)?;
let chunk = Chunk::new(batch.columns().to_vec());
writer.write(&chunk, None)?;
timer.done();
}
let timer = disk_write_metric.timer();
Expand Down
4 changes: 2 additions & 2 deletions ballista/rust/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ edition = "2018"
snmalloc = ["snmalloc-rs"]

[dependencies]
arrow-format = { version = "0.3", features = ["flight-data", "flight-service"] }
arrow = { package = "arrow2", version="0.8", features = ["io_ipc"] }
arrow-format = { version = "0.4", features = ["flight-data", "flight-service"] }
arrow = { package = "arrow2", version="0.9", features = ["io_ipc"] }
anyhow = "1"
async-trait = "0.1.36"
ballista-core = { path = "../core", version = "0.6.0" }
Expand Down
5 changes: 2 additions & 3 deletions ballista/rust/executor/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ use std::task::{Context, Poll};
use std::{any::Any, pin::Pin};

use async_trait::async_trait;
use datafusion::arrow::{
datatypes::SchemaRef, error::Result as ArrowResult, record_batch::RecordBatch,
};
use datafusion::arrow::{datatypes::SchemaRef, error::Result as ArrowResult};
use datafusion::error::DataFusionError;
use datafusion::physical_plan::{
DisplayFormatType, ExecutionPlan, Partitioning, SendableRecordBatchStream, Statistics,
};
use datafusion::record_batch::RecordBatch;
use datafusion::{error::Result, physical_plan::RecordBatchStream};
use futures::stream::SelectAll;
use futures::Stream;
Expand Down
12 changes: 6 additions & 6 deletions ballista/rust/executor/src/flight_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

//! Implementation of the Apache Arrow Flight protocol that wraps an executor.

use arrow::array::ArrayRef;
use arrow::chunk::Chunk;
use std::fs::File;
use std::pin::Pin;
use std::sync::Arc;
Expand All @@ -34,7 +36,6 @@ use arrow_format::flight::data::{
use arrow_format::flight::service::flight_service_server::FlightService;
use datafusion::arrow::{
error::ArrowError, io::ipc::read::FileReader, io::ipc::write::WriteOptions,
record_batch::RecordBatch,
};
use futures::{Stream, StreamExt};
use log::{info, warn};
Expand Down Expand Up @@ -175,11 +176,11 @@ impl FlightService for BallistaFlightService {
/// Convert a single RecordBatch into an iterator of FlightData (containing
/// dictionaries and batches)
fn create_flight_iter(
batch: &RecordBatch,
chunk: &Chunk<ArrayRef>,
options: &WriteOptions,
) -> Box<dyn Iterator<Item = Result<FlightData, Status>>> {
let (flight_dictionaries, flight_batch) =
arrow::io::flight::serialize_batch(batch, &[], options);
arrow::io::flight::serialize_batch(chunk, &[], options);
Box::new(
flight_dictionaries
.into_iter()
Expand All @@ -201,14 +202,13 @@ async fn stream_flight_data(path: String, tx: FlightDataSender) -> Result<(), St
let reader = FileReader::new(&mut file, file_meta, None);

let options = WriteOptions::default();
let schema_flight_data =
arrow::io::flight::serialize_schema(reader.schema().as_ref(), &[]);
let schema_flight_data = arrow::io::flight::serialize_schema(reader.schema(), None);
send_response(&tx, Ok(schema_flight_data)).await?;

let mut row_count = 0;
for batch in reader {
if let Ok(x) = &batch {
row_count += x.num_rows();
row_count += x.len();
}
let batch_flight_data: Vec<_> = batch
.map(|b| create_flight_iter(&b, &options).collect())
Expand Down
1 change: 1 addition & 0 deletions ballista/rust/scheduler/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use ballista_core::error::Result;

use datafusion::arrow::datatypes::{DataType, Field, Schema};
use datafusion::execution::context::{ExecutionConfig, ExecutionContext};
use datafusion::field_util::SchemaExt;
use datafusion::prelude::CsvReadOptions;

pub const TPCH_TABLES: &[&str] = &[
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
data
data
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ simd = ["datafusion/simd"]
snmalloc = ["snmalloc-rs"]

[dependencies]
arrow = { package = "arrow2", version="0.8", features = ["io_csv", "io_json", "io_parquet", "io_parquet_compression", "io_ipc", "io_print", "ahash", "compute_merge_sort", "compute", "regex"] }
arrow = { package = "arrow2", version="0.9", features = ["io_csv", "io_json", "io_parquet", "io_parquet_compression", "io_ipc", "io_print", "ahash", "compute_merge_sort", "compute", "regex"] }
datafusion = { path = "../datafusion" }
ballista = { path = "../ballista/rust/client" }
structopt = { version = "0.3", default-features = false }
Expand Down
10 changes: 9 additions & 1 deletion benchmarks/src/bin/nyctaxi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

//! Apache Arrow Rust Benchmarks

use arrow::array::ArrayRef;
use arrow::chunk::Chunk;
use std::collections::HashMap;
use std::path::PathBuf;
use std::process;
Expand All @@ -28,6 +30,7 @@ use datafusion::arrow::io::print;
use datafusion::error::Result;
use datafusion::execution::context::{ExecutionConfig, ExecutionContext};

use datafusion::field_util::SchemaExt;
use datafusion::physical_plan::collect;
use datafusion::prelude::CsvReadOptions;
use structopt::StructOpt;
Expand Down Expand Up @@ -124,7 +127,12 @@ async fn execute_sql(ctx: &mut ExecutionContext, sql: &str, debug: bool) -> Resu
let physical_plan = ctx.create_physical_plan(&plan).await?;
let result = collect(physical_plan).await?;
if debug {
print::print(&result);
let fields = result
.first()
.map(|b| b.schema().field_names())
.unwrap_or(vec![]);
let chunks: Vec<Chunk<ArrayRef>> = result.iter().map(|rb| rb.into()).collect();
println!("{}", print::write(&chunks, &fields));
}
Ok(())
}
Expand Down
Loading