jiangzhx opened a new issue #1041:
URL: https://github.com/apache/arrow-datafusion/issues/1041
**Describe the bug**
query with datafuison with sql
SELECT sum(LO_EXTENDEDPRICE * LO_DISCOUNT) AS revenue FROM
lineorder_flat;
enable simd feature or not; the performence has no diffrence;
enable command:
cargo +nightly run --release --features "simd" --example
ssb_query_example
with default command:
cargo +nightly run --release --example ssb_query_example
code:
use datafusion::arrow::record_batch::RecordBatch;
use datafusion::arrow::util::pretty::print_batches;
use chrono::prelude::*;
use datafusion::prelude::*;
use futures::StreamExt;
#[cfg(feature = "snmalloc")]
#[global_allocator]
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
#[cfg(feature = "mimalloc")]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[tokio::main]
async fn main() -> datafusion::error::Result<()> {
let parquet_path =
"/Users/sylar/workspace/opensource/ssb-dbgen/output/parquet_10";
let execution_config = ExecutionConfig::new();
let mut ctx = ExecutionContext::with_config(execution_config);
let dt = Local::now();
ctx.register_parquet("lineorder_flat", parquet_path);
// let sql = "select count(distinct S_ADDRESS) from lineorder_flat";
let sql = r#"SELECT sum(LO_EXTENDEDPRICE * LO_DISCOUNT) AS revenue
FROM lineorder_flat;"#;
let df = ctx.sql(sql)?;
let results: Vec<RecordBatch> = df.collect().await?;
print_batches(&results)?;
println!(
"usage millis: {}",
Local::now().timestamp_millis() - dt.timestamp_millis()
);
Ok(())
}
--
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]