From c4e1a26149c3fb4bd6aa66cb5ee564be07f45b18 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Tue, 29 Jan 2019 22:44:24 -0700 Subject: [PATCH 01/12] DataFusion Donation --- rust/Cargo.toml | 1 + rust/datafusion/Cargo.toml | 50 + rust/datafusion/README.md | 94 ++ rust/datafusion/examples/csv_sql.rs | 93 ++ rust/datafusion/src/dfparser.rs | 220 +++ rust/datafusion/src/execution/aggregate.rs | 1211 +++++++++++++++++ rust/datafusion/src/execution/context.rs | 228 ++++ rust/datafusion/src/execution/datasource.rs | 74 + rust/datafusion/src/execution/error.rs | 69 + rust/datafusion/src/execution/expression.rs | 508 +++++++ rust/datafusion/src/execution/filter.rs | 120 ++ rust/datafusion/src/execution/mod.rs | 26 + rust/datafusion/src/execution/physicalplan.rs | 37 + rust/datafusion/src/execution/projection.rs | 115 ++ rust/datafusion/src/execution/relation.rs | 57 + rust/datafusion/src/lib.rs | 30 + rust/datafusion/src/logicalplan.rs | 650 +++++++++ rust/datafusion/src/sqlplanner.rs | 687 ++++++++++ .../datafusion/test/data/aggregate_test_1.csv | 8 + .../datafusion/test/data/aggregate_test_2.csv | 8 + rust/datafusion/test/data/all_types.csv | 3 + rust/datafusion/test/data/all_types_flat.csv | 257 ++++ .../test/data/all_types_flat.parquet | Bin 0 -> 29137 bytes .../test/data/alltypes_plain.parquet | Bin 0 -> 1851 bytes rust/datafusion/test/data/null_test.csv | 6 + rust/datafusion/test/data/numerics.csv | 4 + rust/datafusion/test/data/people.csv | 11 + rust/datafusion/test/data/uk_cities.csv | 37 + rust/datafusion/test/data/uk_cities.parquet | Bin 0 -> 1788 bytes rust/datafusion/tests/sql.rs | 151 ++ 30 files changed, 4755 insertions(+) create mode 100644 rust/datafusion/Cargo.toml create mode 100644 rust/datafusion/README.md create mode 100644 rust/datafusion/examples/csv_sql.rs create mode 100644 rust/datafusion/src/dfparser.rs create mode 100644 rust/datafusion/src/execution/aggregate.rs create mode 100644 rust/datafusion/src/execution/context.rs create mode 100644 rust/datafusion/src/execution/datasource.rs create mode 100644 rust/datafusion/src/execution/error.rs create mode 100644 rust/datafusion/src/execution/expression.rs create mode 100644 rust/datafusion/src/execution/filter.rs create mode 100644 rust/datafusion/src/execution/mod.rs create mode 100644 rust/datafusion/src/execution/physicalplan.rs create mode 100644 rust/datafusion/src/execution/projection.rs create mode 100644 rust/datafusion/src/execution/relation.rs create mode 100644 rust/datafusion/src/lib.rs create mode 100644 rust/datafusion/src/logicalplan.rs create mode 100644 rust/datafusion/src/sqlplanner.rs create mode 100644 rust/datafusion/test/data/aggregate_test_1.csv create mode 100644 rust/datafusion/test/data/aggregate_test_2.csv create mode 100644 rust/datafusion/test/data/all_types.csv create mode 100644 rust/datafusion/test/data/all_types_flat.csv create mode 100644 rust/datafusion/test/data/all_types_flat.parquet create mode 100755 rust/datafusion/test/data/alltypes_plain.parquet create mode 100644 rust/datafusion/test/data/null_test.csv create mode 100644 rust/datafusion/test/data/numerics.csv create mode 100644 rust/datafusion/test/data/people.csv create mode 100644 rust/datafusion/test/data/uk_cities.csv create mode 100644 rust/datafusion/test/data/uk_cities.parquet create mode 100644 rust/datafusion/tests/sql.rs diff --git a/rust/Cargo.toml b/rust/Cargo.toml index abfb71ada795..c415ab7c8d7d 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -19,4 +19,5 @@ members = [ "arrow", "parquet", + "datafusion", ] \ No newline at end of file diff --git a/rust/datafusion/Cargo.toml b/rust/datafusion/Cargo.toml new file mode 100644 index 000000000000..864243bce4cc --- /dev/null +++ b/rust/datafusion/Cargo.toml @@ -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. + +[package] +name = "datafusion" +description = "DataFusion is an in-memory query engine that uses Apache Arrow as the memory model" +version = "0.13.0-SNAPSHOT" +homepage = "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/apache/arrow" +repository = "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/apache/arrow" +authors = ["Apache Arrow "] +license = "Apache-2.0" +keywords = [ "arrow", "query", "sql" ] +include = [ + "src/**/*.rs", + "Cargo.toml", +] +edition = "2018" + +[lib] +name = "datafusion" +path = "src/lib.rs" + +[dependencies] +clap = "2.31.2" +fnv = "1.0.3" +arrow = { path = "../arrow" } +parquet = { path = "../parquet" } +datafusion-rustyline = "2.0.0-alpha-20180628" +serde = { version = "1.0.80", features = ["alloc", "rc"] } +serde_derive = "1.0.80" +serde_json = "1.0.33" +sqlparser = "0.2.0" + +[dev-dependencies] +criterion = "0.2.0" + diff --git a/rust/datafusion/README.md b/rust/datafusion/README.md new file mode 100644 index 000000000000..3c9d4540c42a --- /dev/null +++ b/rust/datafusion/README.md @@ -0,0 +1,94 @@ + + +# DataFusion + +DataFusion is an in-memory query engine that uses Apache Arrow as the memory model + +# Status + +The current code supports single-threaded execution of limited SQL queries (projection, selection, and aggregates) against CSV files. Parquet files will be supported shortly. + +Here is a brief example for running a SQL query against a CSV file. See the [examples](examples) directory for full examples. + +```rust +fn main() { + // create local execution context + let mut ctx = ExecutionContext::new(); + + // define schema for data source (csv file) + let schema = Arc::new(Schema::new(vec![ + Field::new("city", DataType::Utf8, false), + Field::new("lat", DataType::Float64, false), + Field::new("lng", DataType::Float64, false), + ])); + + // register csv file with the execution context + let csv_datasource = CsvDataSource::new("test/data/uk_cities.csv", schema.clone(), 1024); + ctx.register_datasource("cities", Rc::new(RefCell::new(csv_datasource))); + + // simple projection and selection + let sql = "SELECT city, lat, lng FROM cities WHERE lat > 51.0 AND lat < 53"; + + // execute the query + let relation = ctx.sql(&sql).unwrap(); + + // display the relation + let mut results = relation.borrow_mut(); + + while let Some(batch) = results.next().unwrap() { + + println!( + "RecordBatch has {} rows and {} columns", + batch.num_rows(), + batch.num_columns() + ); + + let city = batch + .column(0) + .as_any() + .downcast_ref::() + .unwrap(); + + let lat = batch + .column(1) + .as_any() + .downcast_ref::() + .unwrap(); + + let lng = batch + .column(2) + .as_any() + .downcast_ref::() + .unwrap(); + + for i in 0..batch.num_rows() { + let city_name: String = String::from_utf8(city.get_value(i).to_vec()).unwrap(); + + println!( + "City: {}, Latitude: {}, Longitude: {}", + city_name, + lat.value(i), + lng.value(i), + ); + } + } +} +``` + diff --git a/rust/datafusion/examples/csv_sql.rs b/rust/datafusion/examples/csv_sql.rs new file mode 100644 index 000000000000..2ea70dc81102 --- /dev/null +++ b/rust/datafusion/examples/csv_sql.rs @@ -0,0 +1,93 @@ +// 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::cell::RefCell; +use std::rc::Rc; +use std::sync::Arc; + +extern crate arrow; +extern crate datafusion; + +use arrow::array::{BinaryArray, Float64Array}; +use arrow::datatypes::{DataType, Field, Schema}; + +use datafusion::execution::context::ExecutionContext; +use datafusion::execution::datasource::CsvDataSource; + +/// This example demonstrates executing a simple query against an Arrow data source and fetching results +fn main() { + // create local execution context + let mut ctx = ExecutionContext::new(); + + // define schema for data source (csv file) + let schema = Arc::new(Schema::new(vec![ + Field::new("city", DataType::Utf8, false), + Field::new("lat", DataType::Float64, false), + Field::new("lng", DataType::Float64, false), + ])); + + // register csv file with the execution context + let csv_datasource = + CsvDataSource::new("test/data/uk_cities.csv", schema.clone(), 1024); + ctx.register_datasource("cities", Rc::new(RefCell::new(csv_datasource))); + + // simple projection and selection + let sql = "SELECT city, lat, lng FROM cities WHERE lat > 51.0 AND lat < 53"; + + // execute the query + let relation = ctx.sql(&sql).unwrap(); + + // display the relation + let mut results = relation.borrow_mut(); + + while let Some(batch) = results.next().unwrap() { + println!( + "RecordBatch has {} rows and {} columns", + batch.num_rows(), + batch.num_columns() + ); + + let city = batch + .column(0) + .as_any() + .downcast_ref::() + .unwrap(); + + let lat = batch + .column(1) + .as_any() + .downcast_ref::() + .unwrap(); + + let lng = batch + .column(2) + .as_any() + .downcast_ref::() + .unwrap(); + + for i in 0..batch.num_rows() { + let city_name: String = String::from_utf8(city.value(i).to_vec()).unwrap(); + + println!( + "City: {}, Latitude: {}, Longitude: {}", + city_name, + lat.value(i), + lng.value(i), + ); + } + } +} diff --git a/rust/datafusion/src/dfparser.rs b/rust/datafusion/src/dfparser.rs new file mode 100644 index 000000000000..7abbd8dcf10b --- /dev/null +++ b/rust/datafusion/src/dfparser.rs @@ -0,0 +1,220 @@ +// 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. + +//! SQL Parser +//! +//! Note that most SQL parsing is now delegated to the sqlparser crate, which handles ANSI SQL but +//! this module contains DataFusion-specific SQL extensions. + +use sqlparser::dialect::*; +use sqlparser::sqlast::*; +use sqlparser::sqlparser::*; +use sqlparser::sqltokenizer::*; + +macro_rules! parser_err { + ($MSG:expr) => { + Err(ParserError::ParserError($MSG.to_string())) + }; +} + +#[derive(Debug, Clone)] +pub enum FileType { + NdJson, + Parquet, + CSV, +} + +#[derive(Debug, Clone)] +pub enum DFASTNode { + /// ANSI SQL AST node + ANSI(ASTNode), + /// DDL for creating an external table in DataFusion + CreateExternalTable { + /// Table name + name: String, + /// Optional schema + columns: Vec, + /// File type (Parquet, NDJSON, CSV) + file_type: FileType, + /// Header row? + header_row: bool, + /// Path to file + location: String, + }, +} + +/// SQL Parser +pub struct DFParser { + parser: Parser, +} + +impl DFParser { + /// Parse the specified tokens + pub fn new(sql: String) -> Result { + let dialect = GenericSqlDialect {}; + let mut tokenizer = Tokenizer::new(&dialect, &sql); + let tokens = tokenizer.tokenize()?; + Ok(DFParser { + parser: Parser::new(tokens), + }) + } + + /// Parse a SQL statement and produce an Abstract Syntax Tree (AST) + pub fn parse_sql(sql: String) -> Result { + let mut parser = DFParser::new(sql)?; + parser.parse() + } + + /// Parse a new expression + pub fn parse(&mut self) -> Result { + self.parse_expr(0) + } + + /// Parse tokens until the precedence changes + fn parse_expr(&mut self, precedence: u8) -> Result { + let mut expr = self.parse_prefix()?; + loop { + let next_precedence = self.parser.get_next_precedence()?; + if precedence >= next_precedence { + break; + } + + if let Some(infix_expr) = self.parse_infix(expr.clone(), next_precedence)? { + expr = infix_expr; + } + } + Ok(expr) + } + + /// Parse an expression prefix + fn parse_prefix(&mut self) -> Result { + if self + .parser + .parse_keywords(vec!["CREATE", "EXTERNAL", "TABLE"]) + { + match self.parser.next_token() { + Some(Token::Identifier(id)) => { + // parse optional column list (schema) + let mut columns = vec![]; + if self.parser.consume_token(&Token::LParen) { + loop { + if let Some(Token::Identifier(column_name)) = + self.parser.next_token() + { + if let Ok(data_type) = self.parser.parse_data_type() { + let allow_null = if self + .parser + .parse_keywords(vec!["NOT", "NULL"]) + { + false + } else if self.parser.parse_keyword("NULL") { + true + } else { + true + }; + + match self.parser.peek_token() { + Some(Token::Comma) => { + self.parser.next_token(); + columns.push(SQLColumnDef { + name: column_name, + data_type: data_type, + allow_null, + default: None, + is_primary: false, + is_unique: false, + }); + } + Some(Token::RParen) => break, + _ => { + return parser_err!( + "Expected ',' or ')' after column definition" + ); + } + } + } else { + return parser_err!( + "Error parsing data type in column definition" + ); + } + } else { + return parser_err!("Error parsing column name"); + } + } + } + + //println!("Parsed {} column defs", columns.len()); + + let mut headers = true; + let file_type: FileType = if self + .parser + .parse_keywords(vec!["STORED", "AS", "CSV"]) + { + if self.parser.parse_keywords(vec!["WITH", "HEADER", "ROW"]) { + headers = true; + } else if self + .parser + .parse_keywords(vec!["WITHOUT", "HEADER", "ROW"]) + { + headers = false; + } + FileType::CSV + } else if self.parser.parse_keywords(vec!["STORED", "AS", "NDJSON"]) { + FileType::NdJson + } else if self.parser.parse_keywords(vec!["STORED", "AS", "PARQUET"]) + { + FileType::Parquet + } else { + return parser_err!(format!( + "Expected 'STORED AS' clause, found {:?}", + self.parser.peek_token() + )); + }; + + let location: String = if self.parser.parse_keywords(vec!["LOCATION"]) + { + self.parser.parse_literal_string()? + } else { + return parser_err!("Missing 'LOCATION' clause"); + }; + + Ok(DFASTNode::CreateExternalTable { + name: id, + columns, + file_type, + header_row: headers, + location, + }) + } + _ => parser_err!(format!( + "Unexpected token after CREATE EXTERNAL TABLE: {:?}", + self.parser.peek_token() + )), + } + } else { + Ok(DFASTNode::ANSI(self.parser.parse_prefix()?)) + } + } + + pub fn parse_infix( + &mut self, + _expr: DFASTNode, + _precedence: u8, + ) -> Result, ParserError> { + unimplemented!() + } +} diff --git a/rust/datafusion/src/execution/aggregate.rs b/rust/datafusion/src/execution/aggregate.rs new file mode 100644 index 000000000000..328210407a01 --- /dev/null +++ b/rust/datafusion/src/execution/aggregate.rs @@ -0,0 +1,1211 @@ +// 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. + +//! Execution of a simple aggregate relation containing MIN, MAX, COUNT, SUM aggregate functions +//! with optional GROUP BY columns + +use std::cell::RefCell; +use std::rc::Rc; +use std::str; +use std::sync::Arc; + +use arrow::array::*; +use arrow::array_ops; +use arrow::builder::*; +use arrow::datatypes::{DataType, Schema}; +use arrow::record_batch::RecordBatch; + +use super::error::{ExecutionError, Result}; +use super::expression::{AggregateType, RuntimeExpr}; +use super::relation::Relation; +use crate::logicalplan::ScalarValue; + +use fnv::FnvHashMap; + +/// An aggregate relation is made up of zero or more grouping expressions and one +/// or more aggregate expressions +pub struct AggregateRelation { + schema: Arc, + input: Rc>, + group_expr: Vec, + aggr_expr: Vec, + end_of_results: bool, +} + +impl AggregateRelation { + pub fn new( + schema: Arc, + input: Rc>, + group_expr: Vec, + aggr_expr: Vec, + ) -> Self { + AggregateRelation { + schema, + input, + group_expr, + aggr_expr, + end_of_results: false, + } + } +} + +/// Enumeration of types that can be used in a GROUP BY expression (all primitives except for +/// floating point numerics) +#[derive(Debug, PartialEq, Eq, Hash, Clone)] +enum GroupByScalar { + UInt8(u8), + UInt16(u16), + UInt32(u32), + UInt64(u64), + Int8(i8), + Int16(i16), + Int32(i32), + Int64(i64), + Utf8(String), +} + +/// Common trait for all aggregation functions +trait AggregateFunction { + /// Get the function name (used for debugging) + fn name(&self) -> &str; + fn accumulate_scalar(&mut self, value: &Option); + fn result(&self) -> &Option; + fn data_type(&self) -> &DataType; +} + +#[derive(Debug)] +struct MinFunction { + data_type: DataType, + value: Option, +} + +impl MinFunction { + fn new(data_type: &DataType) -> Self { + Self { + data_type: data_type.clone(), + value: None, + } + } +} + +impl AggregateFunction for MinFunction { + fn name(&self) -> &str { + "min" + } + + fn accumulate_scalar(&mut self, value: &Option) { + if self.value.is_none() { + self.value = value.clone(); + } else if value.is_some() { + self.value = match (&self.value, value) { + (Some(ScalarValue::UInt8(a)), Some(ScalarValue::UInt8(b))) => { + Some(ScalarValue::UInt8(*a.min(b))) + } + (Some(ScalarValue::UInt16(a)), Some(ScalarValue::UInt16(b))) => { + Some(ScalarValue::UInt16(*a.min(b))) + } + (Some(ScalarValue::UInt32(a)), Some(ScalarValue::UInt32(b))) => { + Some(ScalarValue::UInt32(*a.min(b))) + } + (Some(ScalarValue::UInt64(a)), Some(ScalarValue::UInt64(b))) => { + Some(ScalarValue::UInt64(*a.min(b))) + } + (Some(ScalarValue::Int8(a)), Some(ScalarValue::Int8(b))) => { + Some(ScalarValue::Int8(*a.min(b))) + } + (Some(ScalarValue::Int16(a)), Some(ScalarValue::Int16(b))) => { + Some(ScalarValue::Int16(*a.min(b))) + } + (Some(ScalarValue::Int32(a)), Some(ScalarValue::Int32(b))) => { + Some(ScalarValue::Int32(*a.min(b))) + } + (Some(ScalarValue::Int64(a)), Some(ScalarValue::Int64(b))) => { + Some(ScalarValue::Int64(*a.min(b))) + } + (Some(ScalarValue::Float32(a)), Some(ScalarValue::Float32(b))) => { + Some(ScalarValue::Float32(a.min(*b))) + } + (Some(ScalarValue::Float64(a)), Some(ScalarValue::Float64(b))) => { + Some(ScalarValue::Float64(a.min(*b))) + } + _ => panic!("unsupported data type for MIN"), + } + } + } + + fn result(&self) -> &Option { + &self.value + } + + fn data_type(&self) -> &DataType { + &self.data_type + } +} + +#[derive(Debug)] +struct MaxFunction { + data_type: DataType, + value: Option, +} + +impl MaxFunction { + fn new(data_type: &DataType) -> Self { + Self { + data_type: data_type.clone(), + value: None, + } + } +} + +impl AggregateFunction for MaxFunction { + fn name(&self) -> &str { + "max" + } + + fn accumulate_scalar(&mut self, value: &Option) { + if self.value.is_none() { + self.value = value.clone(); + } else if value.is_some() { + self.value = match (&self.value, value) { + (Some(ScalarValue::UInt8(a)), Some(ScalarValue::UInt8(b))) => { + Some(ScalarValue::UInt8(*a.max(b))) + } + (Some(ScalarValue::UInt16(a)), Some(ScalarValue::UInt16(b))) => { + Some(ScalarValue::UInt16(*a.max(b))) + } + (Some(ScalarValue::UInt32(a)), Some(ScalarValue::UInt32(b))) => { + Some(ScalarValue::UInt32(*a.max(b))) + } + (Some(ScalarValue::UInt64(a)), Some(ScalarValue::UInt64(b))) => { + Some(ScalarValue::UInt64(*a.max(b))) + } + (Some(ScalarValue::Int8(a)), Some(ScalarValue::Int8(b))) => { + Some(ScalarValue::Int8(*a.max(b))) + } + (Some(ScalarValue::Int16(a)), Some(ScalarValue::Int16(b))) => { + Some(ScalarValue::Int16(*a.max(b))) + } + (Some(ScalarValue::Int32(a)), Some(ScalarValue::Int32(b))) => { + Some(ScalarValue::Int32(*a.max(b))) + } + (Some(ScalarValue::Int64(a)), Some(ScalarValue::Int64(b))) => { + Some(ScalarValue::Int64(*a.max(b))) + } + (Some(ScalarValue::Float32(a)), Some(ScalarValue::Float32(b))) => { + Some(ScalarValue::Float32(a.max(*b))) + } + (Some(ScalarValue::Float64(a)), Some(ScalarValue::Float64(b))) => { + Some(ScalarValue::Float64(a.max(*b))) + } + _ => panic!("unsupported data type for MAX"), + } + } + } + + fn result(&self) -> &Option { + &self.value + } + + fn data_type(&self) -> &DataType { + &self.data_type + } +} + +#[derive(Debug)] +struct SumFunction { + data_type: DataType, + value: Option, +} + +impl SumFunction { + fn new(data_type: &DataType) -> Self { + Self { + data_type: data_type.clone(), + value: None, + } + } +} + +impl AggregateFunction for SumFunction { + fn name(&self) -> &str { + "sum" + } + + fn accumulate_scalar(&mut self, value: &Option) { + if self.value.is_none() { + self.value = value.clone(); + } else if value.is_some() { + self.value = match (&self.value, value) { + (Some(ScalarValue::UInt8(a)), Some(ScalarValue::UInt8(b))) => { + Some(ScalarValue::UInt8(*a + b)) + } + (Some(ScalarValue::UInt16(a)), Some(ScalarValue::UInt16(b))) => { + Some(ScalarValue::UInt16(*a + b)) + } + (Some(ScalarValue::UInt32(a)), Some(ScalarValue::UInt32(b))) => { + Some(ScalarValue::UInt32(*a + b)) + } + (Some(ScalarValue::UInt64(a)), Some(ScalarValue::UInt64(b))) => { + Some(ScalarValue::UInt64(*a + b)) + } + (Some(ScalarValue::Int8(a)), Some(ScalarValue::Int8(b))) => { + Some(ScalarValue::Int8(*a + b)) + } + (Some(ScalarValue::Int16(a)), Some(ScalarValue::Int16(b))) => { + Some(ScalarValue::Int16(*a + b)) + } + (Some(ScalarValue::Int32(a)), Some(ScalarValue::Int32(b))) => { + Some(ScalarValue::Int32(*a + b)) + } + (Some(ScalarValue::Int64(a)), Some(ScalarValue::Int64(b))) => { + Some(ScalarValue::Int64(*a + b)) + } + (Some(ScalarValue::Float32(a)), Some(ScalarValue::Float32(b))) => { + Some(ScalarValue::Float32(a + *b)) + } + (Some(ScalarValue::Float64(a)), Some(ScalarValue::Float64(b))) => { + Some(ScalarValue::Float64(a + *b)) + } + _ => panic!("unsupported data type for SUM"), + } + } + } + + fn result(&self) -> &Option { + &self.value + } + + fn data_type(&self) -> &DataType { + &self.data_type + } +} + +struct AccumulatorSet { + aggr_values: Vec>>, +} + +impl AccumulatorSet { + fn accumulate_scalar(&mut self, i: usize, value: Option) { + let mut accumulator = self.aggr_values[i].borrow_mut(); + accumulator.accumulate_scalar(&value); + } + + fn values(&self) -> Vec> { + self.aggr_values + .iter() + .map(|x| x.borrow().result().clone()) + .collect() + } +} + +#[derive(Debug)] +struct MapEntry { + k: Vec, + v: Vec>, +} + +/// Create an initial aggregate entry +fn create_accumulators(aggr_expr: &Vec) -> Result { + let aggr_values: Vec>> = aggr_expr + .iter() + .map(|e| match e { + RuntimeExpr::AggregateFunction { ref f, ref t, .. } => match f { + AggregateType::Min => Ok(Rc::new(RefCell::new(MinFunction::new(t))) + as Rc>), + AggregateType::Max => Ok(Rc::new(RefCell::new(MaxFunction::new(t))) + as Rc>), + AggregateType::Sum => Ok(Rc::new(RefCell::new(SumFunction::new(t))) + as Rc>), + _ => Err(ExecutionError::ExecutionError( + "unsupported aggregate function".to_string(), + )), + }, + _ => Err(ExecutionError::ExecutionError( + "invalid aggregate expression".to_string(), + )), + }) + .collect::>>>>()?; + + Ok(AccumulatorSet { aggr_values }) +} + +fn array_min(array: ArrayRef, dt: &DataType) -> Result> { + match dt { + DataType::UInt8 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt8(n))), + None => Ok(None), + } + } + DataType::UInt16 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt16(n))), + None => Ok(None), + } + } + DataType::UInt32 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt32(n))), + None => Ok(None), + } + } + DataType::UInt64 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt64(n))), + None => Ok(None), + } + } + DataType::Int8 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int8(n))), + None => Ok(None), + } + } + DataType::Int16 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int16(n))), + None => Ok(None), + } + } + DataType::Int32 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int32(n))), + None => Ok(None), + } + } + DataType::Int64 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int64(n))), + None => Ok(None), + } + } + DataType::Float32 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Float32(n))), + None => Ok(None), + } + } + DataType::Float64 => { + match array_ops::min(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Float64(n))), + None => Ok(None), + } + } + _ => Err(ExecutionError::ExecutionError( + "Unsupported data type for MIN".to_string(), + )), + } +} + +fn array_max(array: ArrayRef, dt: &DataType) -> Result> { + match dt { + DataType::UInt8 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt8(n))), + None => Ok(None), + } + } + DataType::UInt16 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt16(n))), + None => Ok(None), + } + } + DataType::UInt32 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt32(n))), + None => Ok(None), + } + } + DataType::UInt64 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt64(n))), + None => Ok(None), + } + } + DataType::Int8 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int8(n))), + None => Ok(None), + } + } + DataType::Int16 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int16(n))), + None => Ok(None), + } + } + DataType::Int32 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int32(n))), + None => Ok(None), + } + } + DataType::Int64 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int64(n))), + None => Ok(None), + } + } + DataType::Float32 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Float32(n))), + None => Ok(None), + } + } + DataType::Float64 => { + match array_ops::max(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Float64(n))), + None => Ok(None), + } + } + _ => Err(ExecutionError::ExecutionError( + "Unsupported data type for MAX".to_string(), + )), + } +} + +fn array_sum(array: ArrayRef, dt: &DataType) -> Result> { + match dt { + DataType::UInt8 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt8(n))), + None => Ok(None), + } + } + DataType::UInt16 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt16(n))), + None => Ok(None), + } + } + DataType::UInt32 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt32(n))), + None => Ok(None), + } + } + DataType::UInt64 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::UInt64(n))), + None => Ok(None), + } + } + DataType::Int8 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int8(n))), + None => Ok(None), + } + } + DataType::Int16 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int16(n))), + None => Ok(None), + } + } + DataType::Int32 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int32(n))), + None => Ok(None), + } + } + DataType::Int64 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Int64(n))), + None => Ok(None), + } + } + DataType::Float32 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Float32(n))), + None => Ok(None), + } + } + DataType::Float64 => { + match array_ops::sum(array.as_any().downcast_ref::().unwrap()) { + Some(n) => Ok(Some(ScalarValue::Float64(n))), + None => Ok(None), + } + } + _ => Err(ExecutionError::ExecutionError( + "Unsupported data type for SUM".to_string(), + )), + } +} + +fn update_accumulators( + batch: &RecordBatch, + row: usize, + accumulator_set: &mut AccumulatorSet, + aggr_expr: &Vec, +) { + // update the accumulators + for j in 0..accumulator_set.aggr_values.len() { + match &aggr_expr[j] { + RuntimeExpr::AggregateFunction { args, t, .. } => { + // evaluate argument to aggregate function + match args[0](&batch) { + Ok(array) => { + let value: Option = match t { + DataType::UInt8 => { + let z = + array.as_any().downcast_ref::().unwrap(); + Some(ScalarValue::UInt8(z.value(row))) + } + DataType::UInt16 => { + let z = + array.as_any().downcast_ref::().unwrap(); + Some(ScalarValue::UInt16(z.value(row))) + } + DataType::UInt32 => { + let z = + array.as_any().downcast_ref::().unwrap(); + Some(ScalarValue::UInt32(z.value(row))) + } + DataType::UInt64 => { + let z = + array.as_any().downcast_ref::().unwrap(); + Some(ScalarValue::UInt64(z.value(row))) + } + DataType::Int8 => { + let z = + array.as_any().downcast_ref::().unwrap(); + Some(ScalarValue::Int8(z.value(row))) + } + DataType::Int16 => { + let z = + array.as_any().downcast_ref::().unwrap(); + Some(ScalarValue::Int16(z.value(row))) + } + DataType::Int32 => { + let z = + array.as_any().downcast_ref::().unwrap(); + Some(ScalarValue::Int32(z.value(row))) + } + DataType::Int64 => { + let z = + array.as_any().downcast_ref::().unwrap(); + Some(ScalarValue::Int64(z.value(row))) + } + DataType::Float32 => { + let z = array + .as_any() + .downcast_ref::() + .unwrap(); + Some(ScalarValue::Float32(z.value(row))) + } + DataType::Float64 => { + let z = array + .as_any() + .downcast_ref::() + .unwrap(); + Some(ScalarValue::Float64(z.value(row))) + } + _ => panic!(), + }; + accumulator_set.accumulate_scalar(j, value); + } + _ => panic!(), + } + } + _ => panic!(), + } + } +} + +impl Relation for AggregateRelation { + fn next(&mut self) -> Result> { + if self.end_of_results { + Ok(None) + } else { + self.end_of_results = true; + if self.group_expr.is_empty() { + self.without_group_by() + } else { + self.with_group_by() + } + } + } + + fn schema(&self) -> &Arc { + &self.schema + } +} + +macro_rules! array_from_scalar { + ($BUILDER:ident, $TY:ident, $ACCUM:expr) => {{ + let mut b = $BUILDER::new(1); + let mut err = false; + match $ACCUM.result() { + Some(ScalarValue::$TY(n)) => { + b.append_value(*n)?; + } + None => { + b.append_null()?; + } + Some(_) => { + err = true; + } + }; + if err { + Err(ExecutionError::ExecutionError( + "unexpected type when creating array from scalar value".to_string(), + )) + } else { + Ok(Arc::new(b.finish()) as ArrayRef) + } + }}; +} + +/// Create array from `key` attribute in map entry (representing a grouping scalar value) +macro_rules! group_array_from_map_entries { + ($BUILDER:ident, $TY:ident, $ENTRIES:expr, $COL_INDEX:expr) => {{ + let mut builder = $BUILDER::new($ENTRIES.len()); + let mut err = false; + for j in 0..$ENTRIES.len() { + match $ENTRIES[j].k[$COL_INDEX] { + GroupByScalar::$TY(n) => builder.append_value(n).unwrap(), + _ => err = true, + } + } + if err { + Err(ExecutionError::ExecutionError( + "unexpected type when creating array from aggregate map".to_string(), + )) + } else { + Ok(Arc::new(builder.finish()) as ArrayRef) + } + }}; +} + +/// Create array from `value` attribute in map entry (representing an aggregate scalar value) +macro_rules! aggr_array_from_map_entries { + ($BUILDER:ident, $TY:ident, $ENTRIES:expr, $COL_INDEX:expr) => {{ + let mut builder = $BUILDER::new($ENTRIES.len()); + let mut err = false; + for j in 0..$ENTRIES.len() { + match $ENTRIES[j].v[$COL_INDEX] { + Some(ScalarValue::$TY(n)) => builder.append_value(n).unwrap(), + None => builder.append_null().unwrap(), + _ => err = true, + } + } + if err { + Err(ExecutionError::ExecutionError( + "unexpected type when creating array from aggregate map".to_string(), + )) + } else { + Ok(Arc::new(builder.finish()) as ArrayRef) + } + }}; +} + +impl AggregateRelation { + /// perform simple aggregate on entire columns without grouping logic + fn without_group_by(&mut self) -> Result> { + let aggr_expr_count = self.aggr_expr.len(); + let mut accumulator_set = create_accumulators(&self.aggr_expr)?; + + while let Some(batch) = self.input.borrow_mut().next()? { + for i in 0..aggr_expr_count { + match &self.aggr_expr[i] { + RuntimeExpr::AggregateFunction { f, args, t, .. } => { + // evaluate argument to aggregate function + match args[0](&batch) { + Ok(array) => match f { + AggregateType::Min => accumulator_set + .accumulate_scalar(i, array_min(array, &t)?), + AggregateType::Max => accumulator_set + .accumulate_scalar(i, array_max(array, &t)?), + AggregateType::Sum => accumulator_set + .accumulate_scalar(i, array_sum(array, &t)?), + _ => { + return Err(ExecutionError::NotImplemented( + "Unsupported aggregate function".to_string(), + )); + } + }, + Err(_) => { + return Err(ExecutionError::ExecutionError( + "Failed to evaluate argument to aggregate function" + .to_string(), + )); + } + } + } + _ => { + return Err(ExecutionError::General( + "Invalid aggregate expression".to_string(), + )); + } + } + } + } + + let mut result_columns: Vec = vec![]; + + for i in 0..aggr_expr_count { + let accum = accumulator_set.aggr_values[i].borrow(); + match accum.data_type() { + DataType::UInt8 => { + result_columns.push(array_from_scalar!(UInt8Builder, UInt8, accum)?) + } + DataType::UInt16 => { + result_columns.push(array_from_scalar!(UInt16Builder, UInt16, accum)?) + } + DataType::UInt32 => { + result_columns.push(array_from_scalar!(UInt32Builder, UInt32, accum)?) + } + DataType::UInt64 => { + result_columns.push(array_from_scalar!(UInt64Builder, UInt64, accum)?) + } + DataType::Int8 => { + result_columns.push(array_from_scalar!(Int8Builder, Int8, accum)?) + } + DataType::Int16 => { + result_columns.push(array_from_scalar!(Int16Builder, Int16, accum)?) + } + DataType::Int32 => { + result_columns.push(array_from_scalar!(Int32Builder, Int32, accum)?) + } + DataType::Int64 => { + result_columns.push(array_from_scalar!(Int64Builder, Int64, accum)?) + } + DataType::Float32 => result_columns.push(array_from_scalar!( + Float32Builder, + Float32, + accum + )?), + DataType::Float64 => result_columns.push(array_from_scalar!( + Float64Builder, + Float64, + accum + )?), + _ => return Err(ExecutionError::NotImplemented("tbd".to_string())), + } + } + + Ok(Some(RecordBatch::new(self.schema.clone(), result_columns))) + } + + fn with_group_by(&mut self) -> Result> { + //NOTE this whole method is currently very inefficient with too many per-row operations + // involving pattern matching and downcasting ... I'm sure this can be re-implemented in + // a much more efficient way that takes better advantage of Arrow + + // create map to store aggregate results + let mut map: FnvHashMap, Rc>> = + FnvHashMap::default(); + + while let Some(batch) = self.input.borrow_mut().next()? { + // evaulate the group by expressions on this batch + let group_by_keys: Vec = self + .group_expr + .iter() + .map(|e| e.get_func()(&batch)) + .collect::>>()?; + + // iterate over each row in the batch + for row in 0..batch.num_rows() { + // create key + let key: Vec = group_by_keys + .iter() + .map(|col| match col.data_type() { + DataType::UInt8 => { + let array = + col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::UInt8(array.value(row))) + } + DataType::UInt16 => { + let array = + col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::UInt16(array.value(row))) + } + DataType::UInt32 => { + let array = + col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::UInt32(array.value(row))) + } + DataType::UInt64 => { + let array = + col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::UInt64(array.value(row))) + } + DataType::Int8 => { + let array = col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::Int8(array.value(row))) + } + DataType::Int16 => { + let array = + col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::Int16(array.value(row))) + } + DataType::Int32 => { + let array = + col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::Int32(array.value(row))) + } + DataType::Int64 => { + let array = + col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::Int64(array.value(row))) + } + DataType::Utf8 => { + let array = + col.as_any().downcast_ref::().unwrap(); + Ok(GroupByScalar::Utf8(String::from( + str::from_utf8(array.value(row)).unwrap(), + ))) + } + _ => Err(ExecutionError::ExecutionError( + "Unsupported GROUP BY data type".to_string(), + )), + }) + .collect::>>()?; + + //TODO: find more elegant way to write this instead of hacking around ownership issues + + let updated = match map.get(&key) { + Some(entry) => { + let mut accumulator_set = entry.borrow_mut(); + update_accumulators( + &batch, + row, + &mut accumulator_set, + &self.aggr_expr, + ); + true + } + None => false, + }; + + if !updated { + let accumulator_set = + Rc::new(RefCell::new(create_accumulators(&self.aggr_expr)?)); + { + let mut entry_mut = accumulator_set.borrow_mut(); + update_accumulators(&batch, row, &mut entry_mut, &self.aggr_expr); + } + map.insert(key.clone(), accumulator_set); + } + } + } + + // convert the map to a vec to make it easier to build arrays + let entries: Vec = map + .iter() + .map(|(k, v)| { + let x = v.borrow(); + MapEntry { + k: k.clone(), + v: x.values(), + } + }) + .collect(); + + // build the result arrays + let mut result_arrays: Vec = + Vec::with_capacity(self.group_expr.len() + self.aggr_expr.len()); + + // grouping values + for i in 0..self.group_expr.len() { + let array: Result = match self.group_expr[i].get_type() { + DataType::UInt8 => { + group_array_from_map_entries!(UInt8Builder, UInt8, entries, i) + } + DataType::UInt16 => { + group_array_from_map_entries!(UInt16Builder, UInt16, entries, i) + } + DataType::UInt32 => { + group_array_from_map_entries!(UInt32Builder, UInt32, entries, i) + } + DataType::UInt64 => { + group_array_from_map_entries!(UInt64Builder, UInt64, entries, i) + } + DataType::Int8 => { + group_array_from_map_entries!(Int8Builder, Int8, entries, i) + } + DataType::Int16 => { + group_array_from_map_entries!(Int16Builder, Int16, entries, i) + } + DataType::Int32 => { + group_array_from_map_entries!(Int32Builder, Int32, entries, i) + } + DataType::Int64 => { + group_array_from_map_entries!(Int64Builder, Int64, entries, i) + } + DataType::Utf8 => { + let mut builder = BinaryBuilder::new(1); + for j in 0..entries.len() { + match &entries[j].k[i] { + GroupByScalar::Utf8(s) => builder.append_string(&s).unwrap(), + _ => {} + } + } + Ok(Arc::new(builder.finish()) as ArrayRef) + } + _ => Err(ExecutionError::ExecutionError( + "Unsupported group by expr".to_string(), + )), + }; + result_arrays.push(array?); + } + + // aggregate values + for i in 0..self.aggr_expr.len() { + let array = match self.aggr_expr[i].get_type() { + DataType::UInt8 => { + aggr_array_from_map_entries!(UInt8Builder, UInt8, entries, i) + } + DataType::UInt16 => { + aggr_array_from_map_entries!(UInt16Builder, UInt16, entries, i) + } + DataType::UInt32 => { + aggr_array_from_map_entries!(UInt32Builder, UInt32, entries, i) + } + DataType::UInt64 => { + aggr_array_from_map_entries!(UInt64Builder, UInt64, entries, i) + } + DataType::Int8 => { + group_array_from_map_entries!(Int8Builder, Int8, entries, i) + } + DataType::Int16 => { + aggr_array_from_map_entries!(Int16Builder, Int16, entries, i) + } + DataType::Int32 => { + aggr_array_from_map_entries!(Int32Builder, Int32, entries, i) + } + DataType::Int64 => { + aggr_array_from_map_entries!(Int64Builder, Int64, entries, i) + } + DataType::Float32 => { + aggr_array_from_map_entries!(Float32Builder, Float32, entries, i) + } + DataType::Float64 => { + aggr_array_from_map_entries!(Float64Builder, Float64, entries, i) + } + _ => Err(ExecutionError::ExecutionError( + "Unsupported aggregate expr".to_string(), + )), + }; + result_arrays.push(array?); + } + + Ok(Some(RecordBatch::new(self.schema.clone(), result_arrays))) + } +} + +#[cfg(test)] +mod tests { + use super::super::super::logicalplan::Expr; + use super::super::context::ExecutionContext; + use super::super::datasource::CsvDataSource; + use super::super::expression; + use super::super::relation::DataSourceRelation; + use super::*; + use arrow::datatypes::{DataType, Field, Schema}; + + #[test] + fn min_lat() { + let schema = uk_cities_schema(); + let relation = load_csv("test/data/uk_cities.csv", &schema); + let context = ExecutionContext::new(); + + let aggr_expr = vec![expression::compile_expr( + &context, + &Expr::AggregateFunction { + name: String::from("min"), + args: vec![Expr::Column(1)], + return_type: DataType::Float64, + }, + &schema, + ) + .unwrap()]; + + let aggr_schema = Arc::new(Schema::new(vec![Field::new( + "min_lat", + DataType::Float64, + false, + )])); + + let mut projection = + AggregateRelation::new(aggr_schema, relation, vec![], aggr_expr); + let batch = projection.next().unwrap().unwrap(); + assert_eq!(1, batch.num_columns()); + let min_lat = batch + .column(0) + .as_any() + .downcast_ref::() + .unwrap(); + assert_eq!(50.376289, min_lat.value(0)); + } + + #[test] + fn max_lat() { + let schema = uk_cities_schema(); + let relation = load_csv("test/data/uk_cities.csv", &schema); + let context = ExecutionContext::new(); + + let aggr_expr = vec![expression::compile_expr( + &context, + &Expr::AggregateFunction { + name: String::from("max"), + args: vec![Expr::Column(1)], + return_type: DataType::Float64, + }, + &schema, + ) + .unwrap()]; + + let aggr_schema = Arc::new(Schema::new(vec![Field::new( + "max_lat", + DataType::Float64, + false, + )])); + + let mut projection = + AggregateRelation::new(aggr_schema, relation, vec![], aggr_expr); + let batch = projection.next().unwrap().unwrap(); + assert_eq!(1, batch.num_columns()); + let max_lat = batch + .column(0) + .as_any() + .downcast_ref::() + .unwrap(); + assert_eq!(57.477772, max_lat.value(0)); + } + + #[test] + fn test_min_max_sum_group_by() { + let schema = aggr_test_schema(); + let relation = load_csv("test/data/aggregate_test_1.csv", &schema); + + let context = ExecutionContext::new(); + + let group_by_expr = + expression::compile_expr(&context, &Expr::Column(0), &schema).unwrap(); + + let min_expr = expression::compile_expr( + &context, + &Expr::AggregateFunction { + name: String::from("min"), + args: vec![Expr::Column(1)], + return_type: DataType::Float64, + }, + &schema, + ) + .unwrap(); + + let max_expr = expression::compile_expr( + &context, + &Expr::AggregateFunction { + name: String::from("max"), + args: vec![Expr::Column(1)], + return_type: DataType::Float64, + }, + &schema, + ) + .unwrap(); + + let sum_expr = expression::compile_expr( + &context, + &Expr::AggregateFunction { + name: String::from("sum"), + args: vec![Expr::Column(1)], + return_type: DataType::Float64, + }, + &schema, + ) + .unwrap(); + + let aggr_schema = Arc::new(Schema::new(vec![ + Field::new("a", DataType::Int32, false), + Field::new("min", DataType::Float64, false), + Field::new("max", DataType::Float64, false), + Field::new("sum", DataType::Float64, false), + ])); + + let mut projection = AggregateRelation::new( + aggr_schema, + relation, + vec![group_by_expr], + vec![min_expr, max_expr, sum_expr], + ); + let batch = projection.next().unwrap().unwrap(); + assert_eq!(4, batch.num_columns()); + assert_eq!(3, batch.num_rows()); + + let a = batch + .column(0) + .as_any() + .downcast_ref::() + .unwrap(); + let min = batch + .column(1) + .as_any() + .downcast_ref::() + .unwrap(); + let max = batch + .column(2) + .as_any() + .downcast_ref::() + .unwrap(); + let sum = batch + .column(3) + .as_any() + .downcast_ref::() + .unwrap(); + + assert_eq!(2, a.value(0)); + assert_eq!(3.3, min.value(0)); + assert_eq!(5.5, max.value(0)); + assert_eq!(13.2, sum.value(0)); + + assert_eq!(3, a.value(1)); + assert_eq!(1.0, min.value(1)); + assert_eq!(2.0, max.value(1)); + assert_eq!(3.0, sum.value(1)); + + assert_eq!(1, a.value(2)); + assert_eq!(1.1, min.value(2)); + assert_eq!(2.2, max.value(2)); + assert_eq!(3.3000000000000003, sum.value(2)); + } + + fn uk_cities_schema() -> Arc { + Arc::new(Schema::new(vec![ + Field::new("name", DataType::Utf8, false), + Field::new("lat", DataType::Float64, false), + Field::new("lng", DataType::Float64, false), + ])) + } + + fn aggr_test_schema() -> Arc { + Arc::new(Schema::new(vec![ + Field::new("a", DataType::Int32, false), + Field::new("b", DataType::Float64, false), + ])) + } + + fn load_csv(filename: &str, schema: &Arc) -> Rc> { + let ds = CsvDataSource::new(filename, schema.clone(), 1024); + Rc::new(RefCell::new(DataSourceRelation::new(Rc::new( + RefCell::new(ds), + )))) + } + +} diff --git a/rust/datafusion/src/execution/context.rs b/rust/datafusion/src/execution/context.rs new file mode 100644 index 000000000000..86d7c99c2190 --- /dev/null +++ b/rust/datafusion/src/execution/context.rs @@ -0,0 +1,228 @@ +// 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::cell::RefCell; +use std::collections::HashMap; +use std::rc::Rc; +use std::sync::Arc; + +use arrow::datatypes::{Field, Schema}; + +use super::super::dfparser::{DFASTNode, DFParser}; +use super::super::logicalplan::*; +use super::super::sqlplanner::{SchemaProvider, SqlToRel}; +use super::aggregate::AggregateRelation; +use super::datasource::DataSource; +use super::error::{ExecutionError, Result}; +use super::expression::*; +use super::filter::FilterRelation; +use super::projection::ProjectRelation; +use super::relation::{DataSourceRelation, Relation}; + +pub struct ExecutionContext { + datasources: Rc>>>>, +} + +impl ExecutionContext { + pub fn new() -> Self { + Self { + datasources: Rc::new(RefCell::new(HashMap::new())), + } + } + + pub fn sql(&mut self, sql: &str) -> Result>> { + let ast = DFParser::parse_sql(String::from(sql))?; + + match ast { + DFASTNode::ANSI(ansi) => { + let schema_provider: Rc = + Rc::new(ExecutionContextSchemaProvider { + datasources: self.datasources.clone(), + }); + + // create a query planner + let query_planner = SqlToRel::new(schema_provider); + + // plan the query (create a logical relational plan) + let plan = query_planner.sql_to_rel(&ansi)?; + //println!("Logical plan: {:?}", plan); + + let optimized_plan = plan; //push_down_projection(&plan, &HashSet::new()); + //println!("Optimized logical plan: {:?}", new_plan); + + let relation = self.execute(&optimized_plan)?; + + Ok(relation) + } + _ => unimplemented!(), + } + } + + pub fn register_datasource(&mut self, name: &str, ds: Rc>) { + self.datasources.borrow_mut().insert(name.to_string(), ds); + } + + pub fn execute(&mut self, plan: &LogicalPlan) -> Result>> { + println!("Logical plan: {:?}", plan); + + match *plan { + LogicalPlan::TableScan { ref table_name, .. } => { + match self.datasources.borrow().get(table_name) { + Some(ds) => { + //TODO: projection + Ok(Rc::new(RefCell::new(DataSourceRelation::new(ds.clone())))) + } + _ => Err(ExecutionError::General(format!( + "No table registered as '{}'", + table_name + ))), + } + } + LogicalPlan::Selection { + ref expr, + ref input, + } => { + let input_rel = self.execute(input)?; + let input_schema = input_rel.as_ref().borrow().schema().clone(); + let runtime_expr = compile_scalar_expr(&self, expr, &input_schema)?; + let rel = FilterRelation::new( + input_rel, + runtime_expr, /* .get_func().clone() */ + input_schema, + ); + Ok(Rc::new(RefCell::new(rel))) + } + LogicalPlan::Projection { + ref expr, + ref input, + .. + } => { + let input_rel = self.execute(input)?; + + let input_schema = input_rel.as_ref().borrow().schema().clone(); + + let project_columns: Vec = + exprlist_to_fields(&expr, &input_schema); + + let project_schema = Arc::new(Schema::new(project_columns)); + + let compiled_expr: Result> = expr + .iter() + .map(|e| compile_scalar_expr(&self, e, &input_schema)) + .collect(); + + let rel = ProjectRelation::new(input_rel, compiled_expr?, project_schema); + + Ok(Rc::new(RefCell::new(rel))) + } + LogicalPlan::Aggregate { + ref input, + ref group_expr, + ref aggr_expr, + .. + } => { + let input_rel = self.execute(&input)?; + + let input_schema = input_rel.as_ref().borrow().schema().clone(); + + let compiled_group_expr_result: Result> = group_expr + .iter() + .map(|e| compile_scalar_expr(&self, e, &input_schema)) + .collect(); + let compiled_group_expr = compiled_group_expr_result?; + + let compiled_aggr_expr_result: Result> = aggr_expr + .iter() + .map(|e| compile_expr(&self, e, &input_schema)) + .collect(); + let compiled_aggr_expr = compiled_aggr_expr_result?; + + let rel = AggregateRelation::new( + Arc::new(Schema::empty()), //(expr_to_field(&compiled_group_expr, &input_schema))), + input_rel, + compiled_group_expr, + compiled_aggr_expr, + ); + + Ok(Rc::new(RefCell::new(rel))) + } + + _ => unimplemented!(), + } + } +} + +#[derive(Debug, Clone)] +pub enum ExecutionResult { + Unit, + Count(usize), + Str(String), +} + +pub fn expr_to_field(e: &Expr, input_schema: &Schema) -> Field { + match e { + Expr::Column(i) => input_schema.fields()[*i].clone(), + Expr::Literal(ref lit) => Field::new("lit", lit.get_datatype(), true), + Expr::ScalarFunction { + ref name, + ref return_type, + .. + } => Field::new(&name, return_type.clone(), true), + Expr::AggregateFunction { + ref name, + ref return_type, + .. + } => Field::new(&name, return_type.clone(), true), + Expr::Cast { ref data_type, .. } => Field::new("cast", data_type.clone(), true), + Expr::BinaryExpr { + ref left, + ref right, + .. + } => { + let left_type = left.get_type(input_schema); + let right_type = right.get_type(input_schema); + Field::new( + "binary_expr", + get_supertype(&left_type, &right_type).unwrap(), + true, + ) + } + _ => unimplemented!("Cannot determine schema type for expression {:?}", e), + } +} + +pub fn exprlist_to_fields(expr: &Vec, input_schema: &Schema) -> Vec { + expr.iter() + .map(|e| expr_to_field(e, input_schema)) + .collect() +} + +struct ExecutionContextSchemaProvider { + datasources: Rc>>>>, +} +impl SchemaProvider for ExecutionContextSchemaProvider { + fn get_table_meta(&self, name: &str) -> Option> { + match self.datasources.borrow().get(name) { + Some(ds) => Some(ds.borrow().schema().clone()), + None => None, + } + } + + fn get_function_meta(&self, _name: &str) -> Option> { + unimplemented!() + } +} diff --git a/rust/datafusion/src/execution/datasource.rs b/rust/datafusion/src/execution/datasource.rs new file mode 100644 index 000000000000..379632b95a37 --- /dev/null +++ b/rust/datafusion/src/execution/datasource.rs @@ -0,0 +1,74 @@ +// 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. + +//! Data sources + +use std::fs::File; +use std::rc::Rc; +use std::sync::Arc; + +use arrow::csv; +use arrow::datatypes::Schema; +use arrow::record_batch::RecordBatch; + +use super::error::Result; + +pub trait DataSource { + fn schema(&self) -> &Arc; + fn next(&mut self) -> Result>; +} + +/// CSV data source +pub struct CsvDataSource { + schema: Arc, + reader: csv::Reader, +} + +impl CsvDataSource { + pub fn new(filename: &str, schema: Arc, batch_size: usize) -> Self { + let file = File::open(filename).unwrap(); + let reader = csv::Reader::new(file, schema.clone(), true, batch_size, None); + Self { schema, reader } + } +} + +impl DataSource for CsvDataSource { + fn schema(&self) -> &Arc { + &self.schema + } + + fn next(&mut self) -> Result> { + Ok(self.reader.next()?) + } +} + +#[derive(Serialize, Deserialize, Clone)] +pub enum DataSourceMeta { + /// Represents a CSV file with a provided schema + CsvFile { + filename: String, + schema: Rc, + has_header: bool, + projection: Option>, + }, + /// Represents a Parquet file that contains schema information + ParquetFile { + filename: String, + schema: Rc, + projection: Option>, + }, +} diff --git a/rust/datafusion/src/execution/error.rs b/rust/datafusion/src/execution/error.rs new file mode 100644 index 000000000000..5b8d04d3dca3 --- /dev/null +++ b/rust/datafusion/src/execution/error.rs @@ -0,0 +1,69 @@ +// 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. + +//! Error types + +use std::io::Error; +use std::result; + +use arrow::error::ArrowError; + +use sqlparser::sqlparser::ParserError; + +pub type Result = result::Result; + +#[derive(Debug)] +pub enum ExecutionError { + IoError(Error), + ParserError(ParserError), + General(String), + InvalidColumn(String), + NotImplemented(String), + InternalError(String), + ArrowError(ArrowError), + ExecutionError(String), +} + +impl From for ExecutionError { + fn from(e: Error) -> Self { + ExecutionError::IoError(e) + } +} + +impl From for ExecutionError { + fn from(e: String) -> Self { + ExecutionError::General(e) + } +} + +impl From<&'static str> for ExecutionError { + fn from(e: &'static str) -> Self { + ExecutionError::General(e.to_string()) + } +} + +impl From for ExecutionError { + fn from(e: ArrowError) -> Self { + ExecutionError::ArrowError(e) + } +} + +impl From for ExecutionError { + fn from(e: ParserError) -> Self { + ExecutionError::ParserError(e) + } +} diff --git a/rust/datafusion/src/execution/expression.rs b/rust/datafusion/src/execution/expression.rs new file mode 100644 index 000000000000..9f390ea4c3da --- /dev/null +++ b/rust/datafusion/src/execution/expression.rs @@ -0,0 +1,508 @@ +// 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::rc::Rc; +use std::sync::Arc; + +use arrow::array::*; +use arrow::array_ops; +use arrow::datatypes::{DataType, Schema}; +use arrow::record_batch::RecordBatch; + +use super::super::logicalplan::{Expr, Operator, ScalarValue}; +use super::context::ExecutionContext; +use super::error::{ExecutionError, Result}; + +/// Compiled Expression (basically just a closure to evaluate the expression at runtime) +pub type CompiledExpr = Rc Result>; + +pub type CompiledCastFunction = Rc Result>; + +pub enum AggregateType { + Min, + Max, + Sum, + Count, + CountDistinct, + Avg, +} + +/// Runtime expression +pub enum RuntimeExpr { + Compiled { + name: String, + f: CompiledExpr, + t: DataType, + }, + AggregateFunction { + name: String, + f: AggregateType, + args: Vec, + t: DataType, + }, +} + +impl RuntimeExpr { + pub fn get_func(&self) -> CompiledExpr { + match self { + &RuntimeExpr::Compiled { ref f, .. } => f.clone(), + _ => panic!(), + } + } + + pub fn get_name(&self) -> &String { + match self { + &RuntimeExpr::Compiled { ref name, .. } => name, + &RuntimeExpr::AggregateFunction { ref name, .. } => name, + } + } + + pub fn get_type(&self) -> DataType { + match self { + &RuntimeExpr::Compiled { ref t, .. } => t.clone(), + &RuntimeExpr::AggregateFunction { ref t, .. } => t.clone(), + } + } +} + +/// Compiles a scalar expression into a closure +pub fn compile_expr( + ctx: &ExecutionContext, + expr: &Expr, + input_schema: &Schema, +) -> Result { + match *expr { + Expr::AggregateFunction { + ref name, + ref args, + ref return_type, + } => { + assert_eq!(1, args.len()); + + let compiled_args: Result> = args + .iter() + .map(|e| compile_scalar_expr(&ctx, e, input_schema)) + .collect(); + + let func = match name.to_lowercase().as_ref() { + "min" => Ok(AggregateType::Min), + "max" => Ok(AggregateType::Max), + "count" => Ok(AggregateType::Count), + "sum" => Ok(AggregateType::Sum), + _ => Err(ExecutionError::General(format!( + "Unsupported aggregate function '{}'", + name + ))), + }; + + Ok(RuntimeExpr::AggregateFunction { + name: name.to_string(), + f: func?, + args: compiled_args? + .iter() + .map(|e| e.get_func().clone()) + .collect(), + t: return_type.clone(), + }) + } + _ => Ok(compile_scalar_expr(&ctx, expr, input_schema)?), + } +} + +macro_rules! binary_op { + ($LEFT:expr, $RIGHT:expr, $OP:ident, $DT:ident) => {{ + let ll = $LEFT.as_any().downcast_ref::<$DT>().unwrap(); + let rr = $RIGHT.as_any().downcast_ref::<$DT>().unwrap(); + Ok(Arc::new(array_ops::$OP(&ll, &rr)?)) + }}; +} + +macro_rules! math_ops { + ($LEFT:expr, $RIGHT:expr, $BATCH:expr, $OP:ident) => {{ + let left_values = $LEFT.get_func()($BATCH)?; + let right_values = $RIGHT.get_func()($BATCH)?; + match (left_values.data_type(), right_values.data_type()) { + (DataType::Int8, DataType::Int8) => { + binary_op!(left_values, right_values, $OP, Int8Array) + } + (DataType::Int16, DataType::Int16) => { + binary_op!(left_values, right_values, $OP, Int16Array) + } + (DataType::Int32, DataType::Int32) => { + binary_op!(left_values, right_values, $OP, Int32Array) + } + (DataType::Int64, DataType::Int64) => { + binary_op!(left_values, right_values, $OP, Int64Array) + } + (DataType::UInt8, DataType::UInt8) => { + binary_op!(left_values, right_values, $OP, UInt8Array) + } + (DataType::UInt16, DataType::UInt16) => { + binary_op!(left_values, right_values, $OP, UInt16Array) + } + (DataType::UInt32, DataType::UInt32) => { + binary_op!(left_values, right_values, $OP, UInt32Array) + } + (DataType::UInt64, DataType::UInt64) => { + binary_op!(left_values, right_values, $OP, UInt64Array) + } + (DataType::Float32, DataType::Float32) => { + binary_op!(left_values, right_values, $OP, Float32Array) + } + (DataType::Float64, DataType::Float64) => { + binary_op!(left_values, right_values, $OP, Float64Array) + } + _ => Err(ExecutionError::ExecutionError(format!("math_ops"))), + } + }}; +} + +macro_rules! comparison_ops { + ($LEFT:expr, $RIGHT:expr, $BATCH:expr, $OP:ident) => {{ + let left_values = $LEFT.get_func()($BATCH)?; + let right_values = $RIGHT.get_func()($BATCH)?; + match (left_values.data_type(), right_values.data_type()) { + (DataType::Int8, DataType::Int8) => { + binary_op!(left_values, right_values, $OP, Int8Array) + } + (DataType::Int16, DataType::Int16) => { + binary_op!(left_values, right_values, $OP, Int16Array) + } + (DataType::Int32, DataType::Int32) => { + binary_op!(left_values, right_values, $OP, Int32Array) + } + (DataType::Int64, DataType::Int64) => { + binary_op!(left_values, right_values, $OP, Int64Array) + } + (DataType::UInt8, DataType::UInt8) => { + binary_op!(left_values, right_values, $OP, UInt8Array) + } + (DataType::UInt16, DataType::UInt16) => { + binary_op!(left_values, right_values, $OP, UInt16Array) + } + (DataType::UInt32, DataType::UInt32) => { + binary_op!(left_values, right_values, $OP, UInt32Array) + } + (DataType::UInt64, DataType::UInt64) => { + binary_op!(left_values, right_values, $OP, UInt64Array) + } + (DataType::Float32, DataType::Float32) => { + binary_op!(left_values, right_values, $OP, Float32Array) + } + (DataType::Float64, DataType::Float64) => { + binary_op!(left_values, right_values, $OP, Float64Array) + } + //TODO other types + _ => Err(ExecutionError::ExecutionError(format!("comparison_ops"))), + } + }}; +} + +macro_rules! boolean_ops { + ($LEFT:expr, $RIGHT:expr, $BATCH:expr, $OP:ident) => {{ + let left_values = $LEFT.get_func()($BATCH)?; + let right_values = $RIGHT.get_func()($BATCH)?; + Ok(Arc::new(array_ops::$OP( + left_values.as_any().downcast_ref::().unwrap(), + right_values + .as_any() + .downcast_ref::() + .unwrap(), + )?)) + }}; +} + +macro_rules! literal_array { + ($VALUE:expr, $ARRAY_TYPE:ident, $TY:ident) => {{ + let nn = *$VALUE; + Ok(RuntimeExpr::Compiled { + name: format!("{}", nn), + f: Rc::new(move |batch: &RecordBatch| { + let capacity = batch.num_rows(); + let mut builder = $ARRAY_TYPE::builder(capacity); + for _ in 0..capacity { + builder.append_value(nn)?; + } + let array = builder.finish(); + Ok(Arc::new(array) as ArrayRef) + }), + t: DataType::$TY, + }) + }}; +} + +/// Casts a column to an array with a different data type +macro_rules! cast_column { + ($INDEX:expr, $FROM_TYPE:ty, $TO_TYPE:ident, $DT:ty) => {{ + Rc::new(move |batch: &RecordBatch| { + // get data and cast to known type + match batch.column($INDEX).as_any().downcast_ref::<$FROM_TYPE>() { + Some(array) => { + // create builder for desired type + let mut builder = $TO_TYPE::builder(batch.num_rows()); + for i in 0..batch.num_rows() { + if array.is_null(i) { + builder.append_null()?; + } else { + builder.append_value(array.value(i) as $DT)?; + } + } + Ok(Arc::new(builder.finish()) as ArrayRef) + } + None => Err(ExecutionError::InternalError(format!( + "Column at index {} is not of expected type", + $INDEX + ))), + } + }) + }}; +} + +macro_rules! cast_column_outer { + ($INDEX:expr, $FROM_TYPE:ty, $TO_TYPE:expr) => {{ + match $TO_TYPE { + DataType::Int16 => cast_column!($INDEX, $FROM_TYPE, Int16Array, i16), + DataType::Int32 => cast_column!($INDEX, $FROM_TYPE, Int32Array, i32), + _ => unimplemented!(), + } + }}; +} + +/// Compiles a scalar expression into a closure +pub fn compile_scalar_expr( + ctx: &ExecutionContext, + expr: &Expr, + input_schema: &Schema, +) -> Result { + match expr { + &Expr::Literal(ref value) => match value { + //NOTE: this is a temporary hack .. due to the way expressions like 'a > 1' are + // evaluated, currently the left and right are evaluated separately and must result + // in arrays and then the '>' operator is evaluated against the two arrays. This works + // but is dumb ... I intend to optimize this soon to add special handling for + // binary expressions that involve literal values to avoid creating arrays of literals + // filed as https://github.com/andygrove/datafusion/issues/191 + ScalarValue::Int8(n) => literal_array!(n, Int8Array, Int8), + ScalarValue::Int16(n) => literal_array!(n, Int16Array, Int16), + ScalarValue::Int32(n) => literal_array!(n, Int32Array, Int32), + ScalarValue::Int64(n) => literal_array!(n, Int64Array, Int64), + ScalarValue::UInt8(n) => literal_array!(n, UInt8Array, UInt8), + ScalarValue::UInt16(n) => literal_array!(n, UInt16Array, UInt16), + ScalarValue::UInt32(n) => literal_array!(n, UInt32Array, UInt32), + ScalarValue::UInt64(n) => literal_array!(n, UInt64Array, UInt64), + ScalarValue::Float32(n) => literal_array!(n, Float32Array, Float32), + ScalarValue::Float64(n) => literal_array!(n, Float64Array, Float64), + other => Err(ExecutionError::ExecutionError(format!( + "No support for literal type {:?}", + other + ))), + }, + &Expr::Column(index) => Ok(RuntimeExpr::Compiled { + name: input_schema.field(index).name().clone(), + f: Rc::new(move |batch: &RecordBatch| Ok((*batch.column(index)).clone())), + t: input_schema.field(index).data_type().clone(), + }), + &Expr::Cast { + ref expr, + ref data_type, + } => match expr.as_ref() { + &Expr::Column(index) => { + let col = input_schema.field(index); + Ok(RuntimeExpr::Compiled { + name: col.name().clone(), + t: col.data_type().clone(), + f: match col.data_type() { + DataType::Int8 => { + cast_column_outer!(index, Int8Array, &data_type) + } + DataType::Int16 => { + cast_column_outer!(index, Int16Array, &data_type) + } + DataType::Int32 => { + cast_column_outer!(index, Int32Array, &data_type) + } + DataType::Int64 => { + cast_column_outer!(index, Int64Array, &data_type) + } + DataType::UInt8 => { + cast_column_outer!(index, UInt8Array, &data_type) + } + DataType::UInt16 => { + cast_column_outer!(index, UInt16Array, &data_type) + } + DataType::UInt32 => { + cast_column_outer!(index, UInt32Array, &data_type) + } + DataType::UInt64 => { + cast_column_outer!(index, UInt64Array, &data_type) + } + DataType::Float32 => { + cast_column_outer!(index, Float32Array, &data_type) + } + DataType::Float64 => { + cast_column_outer!(index, Float64Array, &data_type) + } + _ => panic!("unsupported CAST operation"), /*TODO */ + /*Err(ExecutionError::NotImplemented(format!( + "CAST column from {:?} to {:?}", + col.data_type(), + data_type + )))*/ + }, + }) + } + &Expr::Literal(ref value) => { + //NOTE this is all very inefficient and needs to be optimized - tracking + // issue is https://github.com/andygrove/datafusion/issues/191 + match value { + ScalarValue::Int64(n) => { + let nn = *n; + match data_type { + DataType::Float64 => Ok(RuntimeExpr::Compiled { + name: "lit".to_string(), + f: Rc::new(move |batch: &RecordBatch| { + let mut b = Float64Array::builder(batch.num_rows()); + for _ in 0..batch.num_rows() { + b.append_value(nn as f64)?; + } + Ok(Arc::new(b.finish()) as ArrayRef) + }), + t: data_type.clone(), + }), + other => Err(ExecutionError::NotImplemented(format!( + "CAST from Int64 to {:?}", + other + ))), + } + } + other => Err(ExecutionError::NotImplemented(format!( + "CAST from {:?} to {:?}", + other, data_type + ))), + } + } + other => Err(ExecutionError::General(format!( + "CAST not implemented for expression {:?}", + other + ))), + }, + &Expr::BinaryExpr { + ref left, + ref op, + ref right, + } => { + let left_expr = compile_scalar_expr(ctx, left, input_schema)?; + let right_expr = compile_scalar_expr(ctx, right, input_schema)?; + let name = format!("{:?} {:?} {:?}", left, op, right); + let op_type = left_expr.get_type().clone(); + match op { + &Operator::Eq => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + comparison_ops!(left_expr, right_expr, batch, eq) + }), + t: DataType::Boolean, + }), + &Operator::NotEq => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + comparison_ops!(left_expr, right_expr, batch, neq) + }), + t: DataType::Boolean, + }), + &Operator::Lt => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + comparison_ops!(left_expr, right_expr, batch, lt) + }), + t: DataType::Boolean, + }), + &Operator::LtEq => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + comparison_ops!(left_expr, right_expr, batch, lt_eq) + }), + t: DataType::Boolean, + }), + &Operator::Gt => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + comparison_ops!(left_expr, right_expr, batch, gt) + }), + t: DataType::Boolean, + }), + &Operator::GtEq => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + comparison_ops!(left_expr, right_expr, batch, gt_eq) + }), + t: DataType::Boolean, + }), + &Operator::And => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + boolean_ops!(left_expr, right_expr, batch, and) + }), + t: DataType::Boolean, + }), + &Operator::Or => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + boolean_ops!(left_expr, right_expr, batch, or) + }), + t: DataType::Boolean, + }), + &Operator::Plus => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + math_ops!(left_expr, right_expr, batch, add) + }), + t: op_type, + }), + &Operator::Minus => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + math_ops!(left_expr, right_expr, batch, subtract) + }), + t: op_type, + }), + &Operator::Multiply => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + math_ops!(left_expr, right_expr, batch, multiply) + }), + t: op_type, + }), + &Operator::Divide => Ok(RuntimeExpr::Compiled { + name, + f: Rc::new(move |batch: &RecordBatch| { + math_ops!(left_expr, right_expr, batch, divide) + }), + t: op_type, + }), + other => Err(ExecutionError::ExecutionError(format!( + "operator: {:?}", + other + ))), + } + } + other => Err(ExecutionError::ExecutionError(format!( + "expression {:?}", + other + ))), + } +} diff --git a/rust/datafusion/src/execution/filter.rs b/rust/datafusion/src/execution/filter.rs new file mode 100644 index 000000000000..9fe23edd6a5f --- /dev/null +++ b/rust/datafusion/src/execution/filter.rs @@ -0,0 +1,120 @@ +// 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. + +//! Execution of a filter (predicate) + +use std::cell::RefCell; +use std::rc::Rc; +use std::sync::Arc; + +use arrow::array::{Array, ArrayRef, BinaryArray, BooleanArray, Float64Array}; +use arrow::datatypes::{DataType, Schema}; +use arrow::record_batch::RecordBatch; + +use super::error::{ExecutionError, Result}; +use super::expression::RuntimeExpr; +use super::relation::Relation; + +pub struct FilterRelation { + schema: Arc, + input: Rc>, + expr: RuntimeExpr, +} + +impl FilterRelation { + pub fn new( + input: Rc>, + expr: RuntimeExpr, + schema: Arc, + ) -> Self { + Self { + schema, + input, + expr, + } + } +} + +impl Relation for FilterRelation { + fn next(&mut self) -> Result> { + match self.input.borrow_mut().next()? { + Some(batch) => { + // evaluate the filter expression against the batch + match self.expr.get_func()(&batch)? + .as_any() + .downcast_ref::() + { + Some(filter_bools) => { + let filtered_columns: Result> = (0..batch + .num_columns()) + .map(|i| filter(batch.column(i), &filter_bools)) + .collect(); + + let filtered_batch: RecordBatch = RecordBatch::new( + Arc::new(Schema::empty()), + filtered_columns?, + ); + + Ok(Some(filtered_batch)) + } + _ => Err(ExecutionError::ExecutionError( + "Filter expression did not evaluate to boolean".to_string(), + )), + } + } + None => Ok(None), + } + } + + fn schema(&self) -> &Arc { + &self.schema + } +} + +//TODO: move into Arrow array_ops +fn filter(array: &Arc, filter: &BooleanArray) -> Result { + let a = array.as_ref(); + + match a.data_type() { + DataType::Float64 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = Float64Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::Utf8 => { + //TODO: this is inefficient and we should improve the Arrow impl to help make this more concise + let b = a.as_any().downcast_ref::().unwrap(); + let mut values: Vec = Vec::with_capacity(b.len()); + for i in 0..b.len() { + if filter.value(i) { + values.push(b.get_string(i)); + } + } + let tmp: Vec<&str> = values.iter().map(|s| s.as_str()).collect(); + Ok(Arc::new(BinaryArray::from(tmp))) + } + other => Err(ExecutionError::ExecutionError(format!( + "filter not supported for {:?}", + other + ))), + } +} diff --git a/rust/datafusion/src/execution/mod.rs b/rust/datafusion/src/execution/mod.rs new file mode 100644 index 000000000000..23144bb5173c --- /dev/null +++ b/rust/datafusion/src/execution/mod.rs @@ -0,0 +1,26 @@ +// 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. + +pub mod aggregate; +pub mod context; +pub mod datasource; +pub mod error; +pub mod expression; +pub mod filter; +pub mod physicalplan; +pub mod projection; +pub mod relation; diff --git a/rust/datafusion/src/execution/physicalplan.rs b/rust/datafusion/src/execution/physicalplan.rs new file mode 100644 index 000000000000..23aa4312bfbf --- /dev/null +++ b/rust/datafusion/src/execution/physicalplan.rs @@ -0,0 +1,37 @@ +// 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 super::super::logicalplan::LogicalPlan; +use std::rc::Rc; + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub enum PhysicalPlan { + /// Run a query and return the results to the client + Interactive { + plan: Rc, + }, + /// Execute a logical plan and write the output to a file + Write { + plan: Rc, + filename: String, + kind: String, + }, + Show { + plan: Rc, + count: usize, + }, +} diff --git a/rust/datafusion/src/execution/projection.rs b/rust/datafusion/src/execution/projection.rs new file mode 100644 index 000000000000..ff6c17b65227 --- /dev/null +++ b/rust/datafusion/src/execution/projection.rs @@ -0,0 +1,115 @@ +// 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. + +//! Execution of a projection + +use std::cell::RefCell; +use std::rc::Rc; +use std::sync::Arc; + +use arrow::array::ArrayRef; +use arrow::datatypes::{Field, Schema}; +use arrow::record_batch::RecordBatch; + +use super::error::Result; +use super::expression::RuntimeExpr; +use super::relation::Relation; + +pub struct ProjectRelation { + schema: Arc, + input: Rc>, + expr: Vec, +} + +impl ProjectRelation { + pub fn new( + input: Rc>, + expr: Vec, + schema: Arc, + ) -> Self { + ProjectRelation { + input, + expr, + schema, + } + } +} + +impl Relation for ProjectRelation { + fn next(&mut self) -> Result> { + match self.input.borrow_mut().next()? { + Some(batch) => { + let projected_columns: Result> = + self.expr.iter().map(|e| e.get_func()(&batch)).collect(); + + let schema = Schema::new( + self.expr + .iter() + .map(|e| Field::new(&e.get_name(), e.get_type(), true)) + .collect(), + ); + + let projected_batch: RecordBatch = + RecordBatch::new(Arc::new(schema), projected_columns?); + + Ok(Some(projected_batch)) + } + None => Ok(None), + } + } + + fn schema(&self) -> &Arc { + &self.schema + } +} + +#[cfg(test)] +mod tests { + use super::super::super::logicalplan::Expr; + use super::super::context::ExecutionContext; + use super::super::datasource::CsvDataSource; + use super::super::expression; + use super::super::relation::DataSourceRelation; + use super::*; + use arrow::datatypes::{DataType, Field, Schema}; + + #[test] + fn project_all_columns() { + let schema = Arc::new(Schema::new(vec![ + Field::new("id", DataType::Int32, false), + Field::new("first_name", DataType::Utf8, false), + ])); + let ds = CsvDataSource::new("test/data/people.csv", schema.clone(), 1024); + let relation = Rc::new(RefCell::new(DataSourceRelation::new(Rc::new( + RefCell::new(ds), + )))); + let context = ExecutionContext::new(); + + let projection_expr = + vec![ + expression::compile_expr(&context, &Expr::Column(0), schema.as_ref()) + .unwrap(), + ]; + + let mut projection = ProjectRelation::new(relation, projection_expr, schema); + let batch = projection.next().unwrap().unwrap(); + assert_eq!(1, batch.num_columns()); + + assert_eq!("id", batch.schema().field(0).name()); + } + +} diff --git a/rust/datafusion/src/execution/relation.rs b/rust/datafusion/src/execution/relation.rs new file mode 100644 index 000000000000..88eefabba67a --- /dev/null +++ b/rust/datafusion/src/execution/relation.rs @@ -0,0 +1,57 @@ +// 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::cell::RefCell; +use std::rc::Rc; +use std::sync::Arc; + +use arrow::datatypes::Schema; +use arrow::record_batch::RecordBatch; + +use super::datasource::DataSource; +use super::error::Result; + +/// trait for all relations (a relation is essentially just an iterator over rows with +/// a known schema) +pub trait Relation { + fn next(&mut self) -> Result>; + + /// get the schema for this relation + fn schema(&self) -> &Arc; +} + +pub struct DataSourceRelation { + schema: Arc, + ds: Rc>, +} + +impl DataSourceRelation { + pub fn new(ds: Rc>) -> Self { + let schema = ds.borrow().schema().clone(); + Self { ds, schema } + } +} + +impl Relation for DataSourceRelation { + fn next(&mut self) -> Result> { + self.ds.borrow_mut().next() + } + + fn schema(&self) -> &Arc { + &self.schema + } +} diff --git a/rust/datafusion/src/lib.rs b/rust/datafusion/src/lib.rs new file mode 100644 index 000000000000..efcad5d88692 --- /dev/null +++ b/rust/datafusion/src/lib.rs @@ -0,0 +1,30 @@ +// 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. + +//! DataFusion is a modern distributed compute platform implemented in Rust that uses Apache Arrow +//! as the memory model + +extern crate arrow; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; +extern crate sqlparser; + +pub mod dfparser; +pub mod execution; +pub mod logicalplan; +pub mod sqlplanner; diff --git a/rust/datafusion/src/logicalplan.rs b/rust/datafusion/src/logicalplan.rs new file mode 100644 index 000000000000..b3e6bda54599 --- /dev/null +++ b/rust/datafusion/src/logicalplan.rs @@ -0,0 +1,650 @@ +// 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. + +//! Logical query plan + +use std::fmt; +use std::fmt::{Error, Formatter}; +use std::rc::Rc; +use std::sync::Arc; + +use arrow::datatypes::*; + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub enum FunctionType { + Scalar, + Aggregate, +} + +#[derive(Debug, Clone)] +pub struct FunctionMeta { + name: String, + args: Vec, + return_type: DataType, + function_type: FunctionType, +} + +impl FunctionMeta { + pub fn new( + name: String, + args: Vec, + return_type: DataType, + function_type: FunctionType, + ) -> Self { + FunctionMeta { + name, + args, + return_type, + function_type, + } + } + pub fn name(&self) -> &String { + &self.name + } + pub fn args(&self) -> &Vec { + &self.args + } + pub fn return_type(&self) -> &DataType { + &self.return_type + } + pub fn function_type(&self) -> &FunctionType { + &self.function_type + } +} + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] +pub enum Operator { + Eq, + NotEq, + Lt, + LtEq, + Gt, + GtEq, + Plus, + Minus, + Multiply, + Divide, + Modulus, + And, + Or, + Not, + Like, + NotLike, +} + +impl Operator { + /// Get the result type of applying this operation to its left and right inputs + pub fn get_datatype(&self, l: &Expr, _r: &Expr, schema: &Schema) -> DataType { + //TODO: implement correctly, just go with left side for now + l.get_type(schema).clone() + } +} + +/// ScalarValue enumeration +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +pub enum ScalarValue { + Null, + Boolean(bool), + Float32(f32), + Float64(f64), + Int8(i8), + Int16(i16), + Int32(i32), + Int64(i64), + UInt8(u8), + UInt16(u16), + UInt32(u32), + UInt64(u64), + Utf8(Rc), + Struct(Vec), +} + +impl ScalarValue { + pub fn get_datatype(&self) -> DataType { + match *self { + ScalarValue::Boolean(_) => DataType::Boolean, + ScalarValue::UInt8(_) => DataType::UInt8, + ScalarValue::UInt16(_) => DataType::UInt16, + ScalarValue::UInt32(_) => DataType::UInt32, + ScalarValue::UInt64(_) => DataType::UInt64, + ScalarValue::Int8(_) => DataType::Int8, + ScalarValue::Int16(_) => DataType::Int16, + ScalarValue::Int32(_) => DataType::Int32, + ScalarValue::Int64(_) => DataType::Int64, + ScalarValue::Float32(_) => DataType::Float32, + ScalarValue::Float64(_) => DataType::Float64, + ScalarValue::Utf8(_) => DataType::Utf8, + ScalarValue::Struct(_) => unimplemented!(), + ScalarValue::Null => unimplemented!(), + } + } +} + +/// Relation Expression +#[derive(Serialize, Deserialize, Clone, PartialEq)] +pub enum Expr { + /// index into a value within the row or complex value + Column(usize), + /// literal value + Literal(ScalarValue), + /// binary expression e.g. "age > 21" + BinaryExpr { + left: Rc, + op: Operator, + right: Rc, + }, + /// unary IS NOT NULL + IsNotNull(Rc), + /// unary IS NULL + IsNull(Rc), + /// cast a value to a different type + Cast { expr: Rc, data_type: DataType }, + /// sort expression + Sort { expr: Rc, asc: bool }, + /// scalar function + ScalarFunction { + name: String, + args: Vec, + return_type: DataType, + }, + /// aggregate function + AggregateFunction { + name: String, + args: Vec, + return_type: DataType, + }, +} + +impl Expr { + pub fn get_type(&self, schema: &Schema) -> DataType { + match self { + Expr::Column(n) => schema.field(*n).data_type().clone(), + Expr::Literal(l) => l.get_datatype(), + Expr::Cast { data_type, .. } => data_type.clone(), + Expr::ScalarFunction { return_type, .. } => return_type.clone(), + Expr::AggregateFunction { return_type, .. } => return_type.clone(), + Expr::IsNull(_) => DataType::Boolean, + Expr::IsNotNull(_) => DataType::Boolean, + Expr::BinaryExpr { + ref left, + ref right, + ref op, + } => { + match op { + Operator::Eq | Operator::NotEq => DataType::Boolean, + Operator::Lt | Operator::LtEq => DataType::Boolean, + Operator::Gt | Operator::GtEq => DataType::Boolean, + Operator::And | Operator::Or => DataType::Boolean, + _ => { + let left_type = left.get_type(schema); + let right_type = right.get_type(schema); + get_supertype(&left_type, &right_type).unwrap_or(DataType::Utf8) //TODO ??? + } + } + } + Expr::Sort { ref expr, .. } => expr.get_type(schema), + } + } + + pub fn cast_to( + &self, + cast_to_type: &DataType, + schema: &Schema, + ) -> Result { + let this_type = self.get_type(schema); + if this_type == *cast_to_type { + Ok(self.clone()) + } else if can_coerce_from(cast_to_type, &this_type) { + Ok(Expr::Cast { + expr: Rc::new(self.clone()), + data_type: cast_to_type.clone(), + }) + } else { + Err(format!( + "Cannot automatically convert {:?} to {:?}", + this_type, cast_to_type + )) + } + } + + pub fn eq(&self, other: &Expr) -> Expr { + Expr::BinaryExpr { + left: Rc::new(self.clone()), + op: Operator::Eq, + right: Rc::new(other.clone()), + } + } + + pub fn not_eq(&self, other: &Expr) -> Expr { + Expr::BinaryExpr { + left: Rc::new(self.clone()), + op: Operator::NotEq, + right: Rc::new(other.clone()), + } + } + + pub fn gt(&self, other: &Expr) -> Expr { + Expr::BinaryExpr { + left: Rc::new(self.clone()), + op: Operator::Gt, + right: Rc::new(other.clone()), + } + } + + pub fn gt_eq(&self, other: &Expr) -> Expr { + Expr::BinaryExpr { + left: Rc::new(self.clone()), + op: Operator::GtEq, + right: Rc::new(other.clone()), + } + } + + pub fn lt(&self, other: &Expr) -> Expr { + Expr::BinaryExpr { + left: Rc::new(self.clone()), + op: Operator::Lt, + right: Rc::new(other.clone()), + } + } + + pub fn lt_eq(&self, other: &Expr) -> Expr { + Expr::BinaryExpr { + left: Rc::new(self.clone()), + op: Operator::LtEq, + right: Rc::new(other.clone()), + } + } +} + +impl fmt::Debug for Expr { + fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { + match self { + Expr::Column(i) => write!(f, "#{}", i), + Expr::Literal(v) => write!(f, "{:?}", v), + Expr::Cast { expr, data_type } => { + write!(f, "CAST({:?} AS {:?})", expr, data_type) + } + Expr::IsNull(expr) => write!(f, "{:?} IS NULL", expr), + Expr::IsNotNull(expr) => write!(f, "{:?} IS NOT NULL", expr), + Expr::BinaryExpr { left, op, right } => { + write!(f, "{:?} {:?} {:?}", left, op, right) + } + Expr::Sort { expr, asc } => { + if *asc { + write!(f, "{:?} ASC", expr) + } else { + write!(f, "{:?} DESC", expr) + } + } + Expr::ScalarFunction { name, ref args, .. } => { + write!(f, "{}(", name)?; + for i in 0..args.len() { + if i > 0 { + write!(f, ", ")?; + } + write!(f, "{:?}", args[i])?; + } + + write!(f, ")") + } + Expr::AggregateFunction { name, ref args, .. } => { + write!(f, "{}(", name)?; + for i in 0..args.len() { + if i > 0 { + write!(f, ", ")?; + } + write!(f, "{:?}", args[i])?; + } + + write!(f, ")") + } + } + } +} + +/// The LogicalPlan represents different types of relations (such as Projection, Selection, etc) and +/// can be created by the SQL query planner and the DataFrame API. +#[derive(Serialize, Deserialize, Clone)] +pub enum LogicalPlan { + /// A Projection (essentially a SELECT with an expression list) + Projection { + expr: Vec, + input: Rc, + schema: Arc, + }, + /// A Selection (essentially a WHERE clause with a predicate expression) + Selection { expr: Expr, input: Rc }, + /// Represents a list of aggregate expressions with optional grouping expressions + Aggregate { + input: Rc, + group_expr: Vec, + aggr_expr: Vec, + schema: Arc, + }, + /// Represents a list of sort expressions to be applied to a relation + Sort { + expr: Vec, + input: Rc, + schema: Arc, + }, + /// A table scan against a table that has been registered on a context + TableScan { + schema_name: String, + table_name: String, + schema: Arc, + projection: Option>, + }, + /// An empty relation with an empty schema + EmptyRelation { schema: Arc }, +} + +impl LogicalPlan { + /// Get a reference to the logical plan's schema + pub fn schema(&self) -> &Arc { + match self { + LogicalPlan::EmptyRelation { schema } => &schema, + LogicalPlan::TableScan { schema, .. } => &schema, + LogicalPlan::Projection { schema, .. } => &schema, + LogicalPlan::Selection { input, .. } => input.schema(), + LogicalPlan::Aggregate { schema, .. } => &schema, + LogicalPlan::Sort { schema, .. } => &schema, + } + } +} + +impl LogicalPlan { + fn fmt_with_indent(&self, f: &mut Formatter, indent: usize) -> Result<(), Error> { + if indent > 0 { + writeln!(f)?; + for _ in 0..indent { + write!(f, " ")?; + } + } + match *self { + LogicalPlan::EmptyRelation { .. } => write!(f, "EmptyRelation"), + LogicalPlan::TableScan { + ref table_name, + ref projection, + .. + } => write!(f, "TableScan: {} projection={:?}", table_name, projection), + LogicalPlan::Projection { + ref expr, + ref input, + .. + } => { + write!(f, "Projection: ")?; + for i in 0..expr.len() { + if i > 0 { + write!(f, ", ")?; + } + write!(f, "{:?}", expr[i])?; + } + input.fmt_with_indent(f, indent + 1) + } + LogicalPlan::Selection { + ref expr, + ref input, + .. + } => { + write!(f, "Selection: {:?}", expr)?; + input.fmt_with_indent(f, indent + 1) + } + LogicalPlan::Aggregate { + ref input, + ref group_expr, + ref aggr_expr, + .. + } => { + write!( + f, + "Aggregate: groupBy=[{:?}], aggr=[{:?}]", + group_expr, aggr_expr + )?; + input.fmt_with_indent(f, indent + 1) + } + LogicalPlan::Sort { + ref input, + ref expr, + .. + } => { + write!(f, "Sort: ")?; + for i in 0..expr.len() { + if i > 0 { + write!(f, ", ")?; + } + write!(f, "{:?}", expr[i])?; + } + input.fmt_with_indent(f, indent + 1) + } + } + } +} + +impl fmt::Debug for LogicalPlan { + fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { + self.fmt_with_indent(f, 0) + } +} + +//TODO move to Arrow DataType impl? +pub fn get_supertype(l: &DataType, r: &DataType) -> Option { + match _get_supertype(l, r) { + Some(dt) => Some(dt), + None => match _get_supertype(r, l) { + Some(dt) => Some(dt), + None => None, + }, + } +} + +fn _get_supertype(l: &DataType, r: &DataType) -> Option { + use self::DataType::*; + match (l, r) { + (UInt8, Int8) => Some(Int8), + (UInt8, Int16) => Some(Int16), + (UInt8, Int32) => Some(Int32), + (UInt8, Int64) => Some(Int64), + + (UInt16, Int16) => Some(Int16), + (UInt16, Int32) => Some(Int32), + (UInt16, Int64) => Some(Int64), + + (UInt32, Int32) => Some(Int32), + (UInt32, Int64) => Some(Int64), + + (UInt64, Int64) => Some(Int64), + + (Int8, UInt8) => Some(Int8), + + (Int16, UInt8) => Some(Int16), + (Int16, UInt16) => Some(Int16), + + (Int32, UInt8) => Some(Int32), + (Int32, UInt16) => Some(Int32), + (Int32, UInt32) => Some(Int32), + + (Int64, UInt8) => Some(Int64), + (Int64, UInt16) => Some(Int64), + (Int64, UInt32) => Some(Int64), + (Int64, UInt64) => Some(Int64), + + (UInt8, UInt8) => Some(UInt8), + (UInt8, UInt16) => Some(UInt16), + (UInt8, UInt32) => Some(UInt32), + (UInt8, UInt64) => Some(UInt64), + (UInt8, Float32) => Some(Float32), + (UInt8, Float64) => Some(Float64), + + (UInt16, UInt8) => Some(UInt16), + (UInt16, UInt16) => Some(UInt16), + (UInt16, UInt32) => Some(UInt32), + (UInt16, UInt64) => Some(UInt64), + (UInt16, Float32) => Some(Float32), + (UInt16, Float64) => Some(Float64), + + (UInt32, UInt8) => Some(UInt32), + (UInt32, UInt16) => Some(UInt32), + (UInt32, UInt32) => Some(UInt32), + (UInt32, UInt64) => Some(UInt64), + (UInt32, Float32) => Some(Float32), + (UInt32, Float64) => Some(Float64), + + (UInt64, UInt8) => Some(UInt64), + (UInt64, UInt16) => Some(UInt64), + (UInt64, UInt32) => Some(UInt64), + (UInt64, UInt64) => Some(UInt64), + (UInt64, Float32) => Some(Float32), + (UInt64, Float64) => Some(Float64), + + (Int8, Int8) => Some(Int8), + (Int8, Int16) => Some(Int16), + (Int8, Int32) => Some(Int32), + (Int8, Int64) => Some(Int64), + (Int8, Float32) => Some(Float32), + (Int8, Float64) => Some(Float64), + + (Int16, Int8) => Some(Int16), + (Int16, Int16) => Some(Int16), + (Int16, Int32) => Some(Int32), + (Int16, Int64) => Some(Int64), + (Int16, Float32) => Some(Float32), + (Int16, Float64) => Some(Float64), + + (Int32, Int8) => Some(Int32), + (Int32, Int16) => Some(Int32), + (Int32, Int32) => Some(Int32), + (Int32, Int64) => Some(Int64), + (Int32, Float32) => Some(Float32), + (Int32, Float64) => Some(Float64), + + (Int64, Int8) => Some(Int64), + (Int64, Int16) => Some(Int64), + (Int64, Int32) => Some(Int64), + (Int64, Int64) => Some(Int64), + (Int64, Float32) => Some(Float32), + (Int64, Float64) => Some(Float64), + + (Float32, Float32) => Some(Float32), + (Float32, Float64) => Some(Float64), + (Float64, Float32) => Some(Float64), + (Float64, Float64) => Some(Float64), + + (Utf8, Utf8) => Some(Utf8), + + (Boolean, Boolean) => Some(Boolean), + + _ => None, + } +} + +pub fn can_coerce_from(left: &DataType, other: &DataType) -> bool { + use self::DataType::*; + match left { + Int8 => match other { + Int8 => true, + _ => false, + }, + Int16 => match other { + Int8 | Int16 => true, + _ => false, + }, + Int32 => match other { + Int8 | Int16 | Int32 => true, + _ => false, + }, + Int64 => match other { + Int8 | Int16 | Int32 | Int64 => true, + _ => false, + }, + UInt8 => match other { + UInt8 => true, + _ => false, + }, + UInt16 => match other { + UInt8 | UInt16 => true, + _ => false, + }, + UInt32 => match other { + UInt8 | UInt16 | UInt32 => true, + _ => false, + }, + UInt64 => match other { + UInt8 | UInt16 | UInt32 | UInt64 => true, + _ => false, + }, + Float32 => match other { + Int8 | Int16 | Int32 | Int64 => true, + UInt8 | UInt16 | UInt32 | UInt64 => true, + Float32 => true, + _ => false, + }, + Float64 => match other { + Int8 | Int16 | Int32 | Int64 => true, + UInt8 | UInt16 | UInt32 | UInt64 => true, + Float32 | Float64 => true, + _ => false, + }, + _ => false, + } +} + +#[cfg(test)] +mod tests { + use super::*; + use serde_json; + + #[test] + fn serialize_plan() { + let schema = Schema::new(vec![ + Field::new("first_name", DataType::Utf8, false), + Field::new("last_name", DataType::Utf8, false), + Field::new( + "address", + DataType::Struct(vec![ + Field::new("street", DataType::Utf8, false), + Field::new("zip", DataType::UInt16, false), + ]), + false, + ), + ]); + + let plan = LogicalPlan::TableScan { + schema_name: "".to_string(), + table_name: "people".to_string(), + schema: Arc::new(schema), + projection: Some(vec![0, 1, 4]), + }; + + let serialized = serde_json::to_string(&plan).unwrap(); + + assert_eq!( + "{\"TableScan\":{\ + \"schema_name\":\"\",\ + \"table_name\":\"people\",\ + \"schema\":{\"fields\":[\ + {\"name\":\"first_name\",\"data_type\":\"Utf8\",\"nullable\":false},\ + {\"name\":\"last_name\",\"data_type\":\"Utf8\",\"nullable\":false},\ + {\"name\":\"address\",\"data_type\":{\"Struct\":\ + [\ + {\"name\":\"street\",\"data_type\":\"Utf8\",\"nullable\":false},\ + {\"name\":\"zip\",\"data_type\":\"UInt16\",\"nullable\":false}]},\"nullable\":false}\ + ]},\ + \"projection\":[0,1,4]}}", + serialized + ); + } +} diff --git a/rust/datafusion/src/sqlplanner.rs b/rust/datafusion/src/sqlplanner.rs new file mode 100644 index 000000000000..dcb69ebc33f0 --- /dev/null +++ b/rust/datafusion/src/sqlplanner.rs @@ -0,0 +1,687 @@ +// 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. + +//! SQL Query Planner (produces logical plan from SQL AST) + +use std::collections::HashSet; +use std::rc::Rc; +use std::string::String; +use std::sync::Arc; + +use super::execution::error::*; +use super::logicalplan::*; + +use arrow::datatypes::*; + +use sqlparser::sqlast::*; + +pub trait SchemaProvider { + fn get_table_meta(&self, name: &str) -> Option>; + fn get_function_meta(&self, name: &str) -> Option>; +} + +/// SQL query planner +pub struct SqlToRel { + schema_provider: Rc, +} + +impl SqlToRel { + /// Create a new query planner + pub fn new(schema_provider: Rc) -> Self { + SqlToRel { schema_provider } + } + + /// Generate a logic plan from a SQL AST node + pub fn sql_to_rel(&self, sql: &ASTNode) -> Result> { + match sql { + &ASTNode::SQLSelect { + ref projection, + ref relation, + ref selection, + ref order_by, + ref group_by, + ref having, + .. + } => { + // parse the input relation so we have access to the row type + let input = match relation { + &Some(ref r) => self.sql_to_rel(r)?, + &None => Rc::new(LogicalPlan::EmptyRelation { + schema: Arc::new(Schema::empty()), + }), + }; + + let input_schema = input.schema(); + + // selection first + let selection_plan = match selection { + &Some(ref filter_expr) => Some(LogicalPlan::Selection { + expr: self.sql_to_rex(&filter_expr, &input_schema.clone())?, + input: input.clone(), + }), + _ => None, + }; + + let expr: Vec = projection + .iter() + .map(|e| self.sql_to_rex(&e, &input_schema)) + .collect::>>()?; + + // collect aggregate expressions + let aggr_expr: Vec = expr + .iter() + .filter(|e| match e { + Expr::AggregateFunction { .. } => true, + _ => false, + }) + .map(|e| e.clone()) + .collect(); + + if aggr_expr.len() > 0 { + let aggregate_input: Rc = match selection_plan { + Some(s) => Rc::new(s), + _ => input.clone(), + }; + + let group_expr: Vec = match group_by { + Some(gbe) => gbe + .iter() + .map(|e| self.sql_to_rex(&e, &input_schema)) + .collect::>>()?, + None => vec![], + }; + //println!("GROUP BY: {:?}", group_expr); + + let mut all_fields: Vec = group_expr.clone(); + aggr_expr.iter().for_each(|x| all_fields.push(x.clone())); + + let aggr_schema = + Schema::new(exprlist_to_fields(&all_fields, input_schema)); + + //TODO: selection, projection, everything else + Ok(Rc::new(LogicalPlan::Aggregate { + input: aggregate_input, + group_expr, + aggr_expr, + schema: Arc::new(aggr_schema), + })) + } else { + let projection_input: Rc = match selection_plan { + Some(s) => Rc::new(s), + _ => input.clone(), + }; + + let projection_schema = Arc::new(Schema::new(exprlist_to_fields( + &expr, + input_schema.as_ref(), + ))); + + let projection = LogicalPlan::Projection { + expr: expr, + input: projection_input, + schema: projection_schema.clone(), + }; + + if let &Some(_) = having { + return Err(ExecutionError::General( + "HAVING is not implemented yet".to_string(), + )); + } + + let order_by_plan = match order_by { + &Some(ref order_by_expr) => { + let input_schema = projection.schema(); + let order_by_rex: Result> = order_by_expr + .iter() + .map(|e| { + Ok(Expr::Sort { + expr: Rc::new( + self.sql_to_rex(&e.expr, &input_schema) + .unwrap(), + ), + asc: e.asc, + }) + }) + .collect(); + + LogicalPlan::Sort { + expr: order_by_rex?, + input: Rc::new(projection.clone()), + schema: input_schema.clone(), + } + } + _ => projection, + }; + + Ok(Rc::new(order_by_plan)) + } + } + + &ASTNode::SQLIdentifier(ref id) => { + match self.schema_provider.get_table_meta(id.as_ref()) { + Some(schema) => Ok(Rc::new(LogicalPlan::TableScan { + schema_name: String::from("default"), + table_name: id.clone(), + schema: schema.clone(), + projection: None, + })), + None => Err(ExecutionError::General(format!( + "no schema found for table {}", + id + ))), + } + } + + _ => Err(ExecutionError::ExecutionError(format!( + "sql_to_rel does not support this relation: {:?}", + sql + ))), + } + } + + /// Generate a relational expression from a SQL expression + pub fn sql_to_rex(&self, sql: &ASTNode, schema: &Schema) -> Result { + match sql { + &ASTNode::SQLValue(sqlparser::sqlast::Value::Long(n)) => { + Ok(Expr::Literal(ScalarValue::Int64(n))) + } + &ASTNode::SQLValue(sqlparser::sqlast::Value::Double(n)) => { + Ok(Expr::Literal(ScalarValue::Float64(n))) + } + &ASTNode::SQLValue(sqlparser::sqlast::Value::SingleQuotedString(ref s)) => { + Ok(Expr::Literal(ScalarValue::Utf8(Rc::new(s.clone())))) + } + + &ASTNode::SQLIdentifier(ref id) => { + match schema.fields().iter().position(|c| c.name().eq(id)) { + Some(index) => Ok(Expr::Column(index)), + None => Err(ExecutionError::ExecutionError(format!( + "Invalid identifier '{}' for schema {}", + id, + schema.to_string() + ))), + } + } + + &ASTNode::SQLWildcard => { + // schema.columns().iter().enumerate() + // .map(|(i,c)| Ok(Expr::Column(i))).collect() + unimplemented!("SQL wildcard operator is not supported in projection - please use explicit column names") + } + + &ASTNode::SQLCast { + ref expr, + ref data_type, + } => Ok(Expr::Cast { + expr: Rc::new(self.sql_to_rex(&expr, schema)?), + data_type: convert_data_type(data_type)?, + }), + + &ASTNode::SQLIsNull(ref expr) => { + Ok(Expr::IsNull(Rc::new(self.sql_to_rex(expr, schema)?))) + } + + &ASTNode::SQLIsNotNull(ref expr) => { + Ok(Expr::IsNotNull(Rc::new(self.sql_to_rex(expr, schema)?))) + } + + &ASTNode::SQLBinaryExpr { + ref left, + ref op, + ref right, + } => { + let operator = match op { + &SQLOperator::Gt => Operator::Gt, + &SQLOperator::GtEq => Operator::GtEq, + &SQLOperator::Lt => Operator::Lt, + &SQLOperator::LtEq => Operator::LtEq, + &SQLOperator::Eq => Operator::Eq, + &SQLOperator::NotEq => Operator::NotEq, + &SQLOperator::Plus => Operator::Plus, + &SQLOperator::Minus => Operator::Minus, + &SQLOperator::Multiply => Operator::Multiply, + &SQLOperator::Divide => Operator::Divide, + &SQLOperator::Modulus => Operator::Modulus, + &SQLOperator::And => Operator::And, + &SQLOperator::Or => Operator::Or, + &SQLOperator::Not => Operator::Not, + &SQLOperator::Like => Operator::Like, + &SQLOperator::NotLike => Operator::NotLike, + }; + + let left_expr = self.sql_to_rex(&left, &schema)?; + let right_expr = self.sql_to_rex(&right, &schema)?; + let left_type = left_expr.get_type(schema); + let right_type = right_expr.get_type(schema); + + match get_supertype(&left_type, &right_type) { + Some(supertype) => Ok(Expr::BinaryExpr { + left: Rc::new(left_expr.cast_to(&supertype, schema)?), + op: operator, + right: Rc::new(right_expr.cast_to(&supertype, schema)?), + }), + None => { + return Err(ExecutionError::General(format!( + "No common supertype found for binary operator {:?} \ + with input types {:?} and {:?}", + operator, left_type, right_type + ))); + } + } + } + + // &ASTNode::SQLOrderBy { ref expr, asc } => Ok(Expr::Sort { + // expr: Rc::new(self.sql_to_rex(&expr, &schema)?), + // asc, + // }), + &ASTNode::SQLFunction { ref id, ref args } => { + //TODO: fix this hack + match id.to_lowercase().as_ref() { + "min" | "max" | "sum" | "avg" => { + let rex_args = args + .iter() + .map(|a| self.sql_to_rex(a, schema)) + .collect::>>()?; + + // return type is same as the argument type for these aggregate functions + let return_type = rex_args[0].get_type(schema).clone(); + + Ok(Expr::AggregateFunction { + name: id.clone(), + args: rex_args, + return_type, + }) + } + "count" => { + let rex_args = args + .iter() + .map(|a| match a { + // this feels hacky but translate COUNT(1)/COUNT(*) to COUNT(first_column) + ASTNode::SQLValue(sqlparser::sqlast::Value::Long(1)) => { + Ok(Expr::Column(0)) + } + ASTNode::SQLWildcard => Ok(Expr::Column(0)), + _ => self.sql_to_rex(a, schema), + }) + .collect::>>()?; + + Ok(Expr::AggregateFunction { + name: id.clone(), + args: rex_args, + return_type: DataType::UInt64, + }) + } + _ => match self.schema_provider.get_function_meta(id) { + Some(fm) => { + let rex_args = args + .iter() + .map(|a| self.sql_to_rex(a, schema)) + .collect::>>()?; + + let mut safe_args: Vec = vec![]; + for i in 0..rex_args.len() { + safe_args.push( + rex_args[i] + .cast_to(fm.args()[i].data_type(), schema)?, + ); + } + + Ok(Expr::ScalarFunction { + name: id.clone(), + args: safe_args, + return_type: fm.return_type().clone(), + }) + } + _ => Err(ExecutionError::General(format!( + "Invalid function '{}'", + id + ))), + }, + } + } + + _ => Err(ExecutionError::General(format!( + "Unsupported ast node {:?} in sqltorel", + sql + ))), + } + } +} + +/// Convert SQL data type to relational representation of data type +pub fn convert_data_type(sql: &SQLType) -> Result { + match sql { + SQLType::Boolean => Ok(DataType::Boolean), + SQLType::SmallInt => Ok(DataType::Int16), + SQLType::Int => Ok(DataType::Int32), + SQLType::BigInt => Ok(DataType::Int64), + SQLType::Float(_) | SQLType::Real => Ok(DataType::Float64), + SQLType::Double => Ok(DataType::Float64), + SQLType::Char(_) | SQLType::Varchar(_) => Ok(DataType::Utf8), + other => Err(ExecutionError::NotImplemented(format!( + "Unsupported SQL type {:?}", + other + ))), + } +} + +pub fn expr_to_field(e: &Expr, input_schema: &Schema) -> Field { + match e { + Expr::Column(i) => input_schema.fields()[*i].clone(), + Expr::Literal(ref lit) => Field::new("lit", lit.get_datatype(), true), + Expr::ScalarFunction { + ref name, + ref return_type, + .. + } => Field::new(name, return_type.clone(), true), + Expr::AggregateFunction { + ref name, + ref return_type, + .. + } => Field::new(name, return_type.clone(), true), + Expr::Cast { ref data_type, .. } => Field::new("cast", data_type.clone(), true), + Expr::BinaryExpr { + ref left, + ref right, + .. + } => { + let left_type = left.get_type(input_schema); + let right_type = right.get_type(input_schema); + Field::new( + "binary_expr", + get_supertype(&left_type, &right_type).unwrap(), + true, + ) + } + _ => unimplemented!("Cannot determine schema type for expression {:?}", e), + } +} + +pub fn exprlist_to_fields(expr: &Vec, input_schema: &Schema) -> Vec { + expr.iter() + .map(|e| expr_to_field(e, input_schema)) + .collect() +} + +fn collect_expr(e: &Expr, accum: &mut HashSet) { + match e { + Expr::Column(i) => { + accum.insert(*i); + } + Expr::Cast { ref expr, .. } => collect_expr(expr, accum), + Expr::Literal(_) => {} + Expr::IsNotNull(ref expr) => collect_expr(expr, accum), + Expr::IsNull(ref expr) => collect_expr(expr, accum), + Expr::BinaryExpr { + ref left, + ref right, + .. + } => { + collect_expr(left, accum); + collect_expr(right, accum); + } + Expr::AggregateFunction { ref args, .. } => { + args.iter().for_each(|e| collect_expr(e, accum)); + } + Expr::ScalarFunction { ref args, .. } => { + args.iter().for_each(|e| collect_expr(e, accum)); + } + Expr::Sort { ref expr, .. } => collect_expr(expr, accum), + } +} + +pub fn push_down_projection( + plan: &Rc, + projection: &HashSet, +) -> Rc { + //println!("push_down_projection() projection={:?}", projection); + match plan.as_ref() { + LogicalPlan::Aggregate { + ref input, + ref group_expr, + ref aggr_expr, + ref schema, + } => { + //TODO: apply projection first + let mut accum: HashSet = HashSet::new(); + group_expr.iter().for_each(|e| collect_expr(e, &mut accum)); + aggr_expr.iter().for_each(|e| collect_expr(e, &mut accum)); + Rc::new(LogicalPlan::Aggregate { + input: push_down_projection(&input, &accum), + group_expr: group_expr.clone(), + aggr_expr: aggr_expr.clone(), + schema: schema.clone(), + }) + } + LogicalPlan::Selection { + ref expr, + ref input, + } => { + let mut accum: HashSet = projection.clone(); + collect_expr(expr, &mut accum); + Rc::new(LogicalPlan::Selection { + expr: expr.clone(), + input: push_down_projection(&input, &accum), + }) + } + LogicalPlan::TableScan { + ref schema_name, + ref table_name, + ref schema, + .. + } => Rc::new(LogicalPlan::TableScan { + schema_name: schema_name.to_string(), + table_name: table_name.to_string(), + schema: schema.clone(), + projection: Some(projection.iter().cloned().collect()), + }), + LogicalPlan::Projection { .. } => plan.clone(), + LogicalPlan::Sort { .. } => plan.clone(), + LogicalPlan::EmptyRelation { .. } => plan.clone(), + } +} + +#[cfg(test)] +mod tests { + + use super::*; + use sqlparser::sqlparser::*; + + #[test] + fn select_no_relation() { + quick_test( + "SELECT 1", + "Projection: Int64(1)\ + \n EmptyRelation", + ); + } + + #[test] + fn select_scalar_func_with_literal_no_relation() { + quick_test( + "SELECT sqrt(9)", + "Projection: sqrt(CAST(Int64(9) AS Float64))\ + \n EmptyRelation", + ); + } + + #[test] + fn select_simple_selection() { + let sql = "SELECT id, first_name, last_name \ + FROM person WHERE state = 'CO'"; + let expected = "Projection: #0, #1, #2\ + \n Selection: #4 Eq Utf8(\"CO\")\ + \n TableScan: person projection=None"; + quick_test(sql, expected); + } + + #[test] + fn select_compound_selection() { + let sql = "SELECT id, first_name, last_name \ + FROM person WHERE state = 'CO' AND age >= 21 AND age <= 65"; + let expected = + "Projection: #0, #1, #2\ + \n Selection: #4 Eq Utf8(\"CO\") And CAST(#3 AS Int64) GtEq Int64(21) And CAST(#3 AS Int64) LtEq Int64(65)\ + \n TableScan: person projection=None"; + quick_test(sql, expected); + } + + #[test] + fn select_all_boolean_operators() { + let sql = "SELECT age, first_name, last_name \ + FROM person \ + WHERE age = 21 \ + AND age != 21 \ + AND age > 21 \ + AND age >= 21 \ + AND age < 65 \ + AND age <= 65"; + let expected = "Projection: #3, #1, #2\ + \n Selection: CAST(#3 AS Int64) Eq Int64(21) \ + And CAST(#3 AS Int64) NotEq Int64(21) \ + And CAST(#3 AS Int64) Gt Int64(21) \ + And CAST(#3 AS Int64) GtEq Int64(21) \ + And CAST(#3 AS Int64) Lt Int64(65) \ + And CAST(#3 AS Int64) LtEq Int64(65)\ + \n TableScan: person projection=None"; + quick_test(sql, expected); + } + + #[test] + fn select_simple_aggregate() { + quick_test( + "SELECT MIN(age) FROM person", + "Aggregate: groupBy=[[]], aggr=[[MIN(#3)]]\ + \n TableScan: person projection=None", + ); + } + + #[test] + fn test_sum_aggregate() { + quick_test( + "SELECT SUM(age) from person", + "Aggregate: groupBy=[[]], aggr=[[SUM(#3)]]\ + \n TableScan: person projection=None", + ); + } + + #[test] + fn select_simple_aggregate_with_groupby() { + quick_test( + "SELECT state, MIN(age), MAX(age) FROM person GROUP BY state", + "Aggregate: groupBy=[[#4]], aggr=[[MIN(#3), MAX(#3)]]\ + \n TableScan: person projection=None", + ); + } + + #[test] + fn select_count_one() { + let sql = "SELECT COUNT(1) FROM person"; + let expected = "Aggregate: groupBy=[[]], aggr=[[COUNT(#0)]]\ + \n TableScan: person projection=None"; + quick_test(sql, expected); + } + + #[test] + fn select_scalar_func() { + let sql = "SELECT sqrt(age) FROM person"; + let expected = "Projection: sqrt(CAST(#3 AS Float64))\ + \n TableScan: person projection=None"; + quick_test(sql, expected); + } + + #[test] + fn select_order_by() { + let sql = "SELECT id FROM person ORDER BY id"; + let expected = "Sort: #0 ASC\ + \n Projection: #0\ + \n TableScan: person projection=None"; + quick_test(sql, expected); + } + + #[test] + fn select_order_by_desc() { + let sql = "SELECT id FROM person ORDER BY id DESC"; + let expected = "Sort: #0 DESC\ + \n Projection: #0\ + \n TableScan: person projection=None"; + quick_test(sql, expected); + } + + #[test] + fn test_collect_expr() { + let mut accum: HashSet = HashSet::new(); + collect_expr( + &Expr::Cast { + expr: Rc::new(Expr::Column(3)), + data_type: DataType::Float64, + }, + &mut accum, + ); + collect_expr( + &Expr::Cast { + expr: Rc::new(Expr::Column(3)), + data_type: DataType::Float64, + }, + &mut accum, + ); + println!("accum: {:?}", accum); + assert_eq!(1, accum.len()); + assert!(accum.contains(&3)); + } + + /// Create logical plan, write with formatter, compare to expected output + fn quick_test(sql: &str, expected: &str) { + use sqlparser::dialect::*; + let dialect = GenericSqlDialect {}; + let planner = SqlToRel::new(Rc::new(MockSchemaProvider {})); + let ast = Parser::parse_sql(&dialect, sql.to_string()).unwrap(); + let plan = planner.sql_to_rel(&ast).unwrap(); + assert_eq!(expected, format!("{:?}", plan)); + } + + struct MockSchemaProvider {} + + impl SchemaProvider for MockSchemaProvider { + fn get_table_meta(&self, name: &str) -> Option> { + match name { + "person" => Some(Arc::new(Schema::new(vec![ + Field::new("id", DataType::UInt32, false), + Field::new("first_name", DataType::Utf8, false), + Field::new("last_name", DataType::Utf8, false), + Field::new("age", DataType::Int32, false), + Field::new("state", DataType::Utf8, false), + Field::new("salary", DataType::Float64, false), + ]))), + _ => None, + } + } + + fn get_function_meta(&self, name: &str) -> Option> { + match name { + "sqrt" => Some(Arc::new(FunctionMeta::new( + "sqrt".to_string(), + vec![Field::new("n", DataType::Float64, false)], + DataType::Float64, + FunctionType::Scalar, + ))), + _ => None, + } + } + } + +} diff --git a/rust/datafusion/test/data/aggregate_test_1.csv b/rust/datafusion/test/data/aggregate_test_1.csv new file mode 100644 index 000000000000..4712c773041b --- /dev/null +++ b/rust/datafusion/test/data/aggregate_test_1.csv @@ -0,0 +1,8 @@ +a,b +1,2.2 +1,1.1 +2,4.4 +2,5.5 +2,3.3 +3,1.0 +3,2.0 diff --git a/rust/datafusion/test/data/aggregate_test_2.csv b/rust/datafusion/test/data/aggregate_test_2.csv new file mode 100644 index 000000000000..c9215495ca94 --- /dev/null +++ b/rust/datafusion/test/data/aggregate_test_2.csv @@ -0,0 +1,8 @@ +a,b +"one",2.2 +"one",1.1 +"two",4.4 +"two",5.5 +"two",3.3 +"three",1.0 +"three",2.0 diff --git a/rust/datafusion/test/data/all_types.csv b/rust/datafusion/test/data/all_types.csv new file mode 100644 index 000000000000..3b2eb00baa06 --- /dev/null +++ b/rust/datafusion/test/data/all_types.csv @@ -0,0 +1,3 @@ +c_int,c_float,c_string +1,1.1,"1.11" +2,2.2,"2.22" \ No newline at end of file diff --git a/rust/datafusion/test/data/all_types_flat.csv b/rust/datafusion/test/data/all_types_flat.csv new file mode 100644 index 000000000000..5a6b607263d6 --- /dev/null +++ b/rust/datafusion/test/data/all_types_flat.csv @@ -0,0 +1,257 @@ +false,2,3,13,1531241020,-60,-1596,1234231326,-3707023917728695883,0.35193855,0.24829962755879142,⍕趧쨻鬛溮ꠃ铊숎戳뺘蛮봔큖潛叐桕୉촸駲쿦 +false,4,9,19,206695022,74,-18088,1508731446,-7958412917705956932,0.7267874,0.2375179592454354,섦藑⼿㊳㠪봰鼔Ễꈈ壮࿉만餈䴐핫⢤휙崭粌猡 +false,0,7,20,818075781,57,-23777,-1121737404,3923416169952057646,0.91558653,0.4981203861148582,햷㫼釭燇⍱냃ጆ㱔伛립⺗Ჱ抰单Ⰿ㚎의綎⾘㷤 +false,1,6,15,584334584,-61,13870,164409925,-9153360329814749238,0.51842016,0.29422932552059233,벋罴个뗒팕鑗氺✒䭑툟෾胑厹姼悪ᮞ貝췤ࣔ▋ +false,4,12,10,1088152525,-27,-26421,-879181593,8925632445420578596,0.358496,0.17348140475392826,⎷鵷芝ⱆ鎍ꂻ〽ꆲ꒧㌴먣⣨淼燊땗耶誂鰹珐窚 +false,0,1,28,1675416048,-78,19157,1570913558,-1539534406690282878,0.6369339,0.501613048032352,衸貕ῠఃꠌ讟ꏉ坟豁ຕ虮拍誕冊龆崷般垿郊ᑥ +false,2,5,12,868812003,-37,-17933,-1373926101,8842876120447285340,0.16038722,0.9848153564240777,┙睴ㆿᑳ羇⪱猿죝랭᮪⨧ꊢ葻ᖬげ뫯㗲擞ݽ㚇 +false,3,3,12,1089699136,42,27606,984961643,6569147229399117619,0.5143737,0.263043606194834,觊ʑŶğ⅊頨븑⥘ࡾ貀퐅톧풺꠷䌱ᯙꆠ쥡佂䭘 +true,4,11,20,1361773026,-89,1081,-1629763360,-8012109879546454244,0.81791216,0.5429001544619461,첆凭造ꘫ穿䑛닯㕈偃㯣㫚㧢汵樊╛⻛䬁޿鞿뽺 +false,1,1,18,1517414054,-51,25205,702694219,-391842732204935620,0.62861645,0.5096163904352368,뷀妘Ꮤ鶑식啥ᢺち㊹藀䗀널懵褏䥯᪪筽䠵齗蓏 +true,2,7,26,986672784,-93,-207,497049627,-796714470026579345,0.9637603,0.14779665189566116,◴䒨픏敼깡袸鱪鲤駖奵㭰䘭阯夏௿☥獹웖鄞؏ +true,1,1,28,2130843314,-34,-32096,-869481407,143228945056456631,0.6729386,0.1880123385211735,䮾鹀纑䑓넕뛛آ㛚ạ虗眱䰏컛Ꝋ炴姖閛韫ᇯ嘎 +true,1,3,9,270745351,51,18860,-9255144,-4164310042088722601,0.5022637,0.2592869241443291,痫捄얷菚뮳닏扩䣧부ꊸ삾ި尀ቈ罀믊倶䜪泚 +true,4,6,18,1515848610,-109,19355,-212839128,20701021643807815,0.7171558,0.5121134304724516,㷗澈᾵뾥뤄㊲ฑ綍퍭䑸ְꞮ䋨੔텲匲擣競鿥疽 +true,3,8,26,1932631261,70,-23786,-1804138479,-6252303781092136744,0.56148523,0.8102583970068632,魗毈旐쑮섷鄑篴Ꮄ靟놜붆칗鄓碒媐ꏌ宯䠎䭨븘 +false,1,3,28,1089538590,7,2090,-1539182058,1056716721061520581,0.7738669,0.33625578665565203,譻㺠慖꜡঺툓䤼⫯ᾟ长ᴕ籡蔫癝縯噳峼뛬䃼냛 +true,1,8,2,519817179,-54,4207,85696742,-6585487401183055348,0.13161778,0.3765691217587185,봹瓡┓◎妤扭৮牚댰ᒃ䟆␨㴲鑜y៲읳礇궘⟳ +true,1,6,7,1284297466,71,7947,-926560209,2355616434385030368,0.029641032,0.08748462506515176,൤筹뫓䍃ⶬ譓滄⇼窄흀쇲扴캄蕾ㄒ宦㵬클瓱郋 +true,1,8,0,2118139912,-5,-7250,211059659,6535067329646013840,0.29698944,0.9060969102791906,⑎㘞긁ㅯ囅䊿ఞ늬쯘ᡃ婺㽔⏏ቄ楹繅径ꌱ㩐刓 +true,1,9,5,1734869757,61,6900,1555964510,1419282613021825007,0.4986608,0.10782045437731824,䶲ڤ칛㷐쳨섙峣鑌꿁꒠Ȋ竾耒ᜡ쿚㜄᫁Ͷ߳≢ +false,3,8,19,1786835579,-83,17805,-517239196,-4146065602579576811,0.4512084,0.8663958325385142,䣼寊ᓗ㌶Ľ隶춀ꩇ휪盟쇽㠟똝隽앴؝┕ຐ졜ᴠ +false,0,2,21,1853660290,-111,-28298,1141579081,4443132472147709052,0.6613548,0.5910969431428907,曱贲렘危鏍䠾텊딤江፺圄잿歙ꜝ蒚휸␴챲꤃鿹 +true,2,11,7,1617498451,3,-17142,346465510,624487320592771035,0.44425493,0.9987703202471936,恺ퟩ唷ᵫ辇뛟䟮虸㵲貵毆驿햽嗸䴥駇邶ெ坟刍 +false,2,11,3,1344241364,-70,2684,131563263,6621485749046145630,0.48962414,0.6548679910576786,浵ꘗ帤ᒏ킞꼯䋒ᷙ볃饌ꅈ春ꨕ촫ҩ䔘춈桽徴៘ +false,2,6,2,311526785,60,-8919,-1822497989,-8094366414051042988,0.7012702,0.3485618824317698,"靊呣ួ漬쫶卟懡罾࠙뾳ᔭ뺣싩削 +й⇤Ꮇᆰㄡ" +true,2,1,15,1045609427,-52,28213,-1147990479,4018628870944688215,0.58028233,0.9719428637234058,䮳殾ᗒ揿岇㌺硧䷼滞ᜤኬ딎ᬺ睯✲ㅩ쳪੫싲蔺 +false,2,2,18,1255733166,107,4274,-1962535867,-4906431753521378993,0.67805874,0.7457059463748047,싺暈曷ꐣ잦솶폸嵱⽯໿죍ꠍ闛뻄波匝醊譬둷 +true,4,12,5,483321637,-49,23978,-176052757,-1152680452773224056,0.45312655,0.5279233199598208,죩촗䣙綡羓斶렶鐚爅賗漂ᒳ茇媛穴䫬妚࡬짍馦 +true,4,1,18,174520530,97,15628,-1711315035,2994687010251554643,0.95071757,0.1779888254873827,゙춊벉터᯼蜟䀦䋍䓀泉鰯㼙겡ᆍ✤ୈᦱᥕ뺥㶯 +false,4,6,23,28029682,-100,-15788,1606534704,-5154175125068656566,0.59714806,0.6984254061219464,㬋Ǣ澒遌愚双箭ゐᝩ疆ؓ劮緽卙捅岓ᠹ짳뱜엍 +false,2,10,14,1049003644,16,-1960,1428177081,164642702238865172,0.25761652,0.6396288470398015,Ĵ㭮慰ꌧ靵碉鴕₻镊䯊鄸넼覆⎈榓揦郠竤損ჸ +false,2,4,21,265370207,-104,-7315,-227928338,5355321136858340128,0.76446146,0.9569563272783185,់骧곑⡦ɖ඿ຨ읷쓭찮渞쐹㖕䶊㪉ꅘାగ䶽좿 +false,0,8,23,998526696,46,9342,-944863825,-2209107919116321238,0.016121447,0.057659034649668706,瘕許速괋䚙ģ˿쏙肨꺏᡽䴂৵宒ꭂ熋ⶳ洪䆹䭀 +true,0,12,24,1476204031,-61,-1070,466035216,-7679277413407079967,0.76205754,0.02795727978930862,騫榵垮䢏ণሬ团㢱灸뾻䱣傇藗䘅Ⲣ럀ታ勖⇋魵 +false,0,0,26,883035612,-29,14287,-1623843875,5394994146196081516,0.83667356,0.4732095210027568,ᷠ㭭੽䒩䮅閁Ҳ兯Ꮄ羇鎽쟇⚥뀎뇊㍽띁뷌䱳㮗 +true,4,0,26,1329614038,-14,-20058,-1902144824,-3906417007632767922,0.04562819,0.2921431977782333,롨늃㛠饌ৢȮ㏢䈫⋃宥㶏‘䬫逻헟跆쀎뜷괥⚄ +false,3,7,25,1261465891,-60,9562,-730280258,363962205986566052,0.6499184,0.22428236737824025,梋᣿랶⢱쿕化慳ؑ唽ꖾs贬휡僿䔵캝꒳ᓹ齮싓 +false,3,5,20,657415491,52,-32474,-624438455,6729598730405181612,0.18841183,0.7013442366533913,쿛吘ᭉ卪ⅾ㑯縡鎮렅腶謐⎽娠瓲ṏ蘩䫟硠㌎⹄ +false,0,6,16,694557375,109,570,1178519874,5910019470167397237,0.30245435,0.3282605064249652,뾜첉ꄇન鄧ᅇ犤⇕ꍞ责테␨㣍★⛐ん苶蛇湀鬏 +false,0,5,4,1503653029,-84,13893,-215433347,5780921237045002271,0.94893974,0.3805155918372052,⑻錝鉷䛡ॣ㜹킮갳딹⿻腒ჵ࠮ᡩ祾븿퇍儅돺ᨴ +false,1,6,18,152873783,118,604,-1930125995,-7954139520243645276,0.33012044,0.857483012880279,橗霖吞騆ᰕ棛⭫簹挥打യ欟῜툫墑䎰䓀斾ꦘּ +true,1,9,6,1321790172,104,-31483,490185344,-2142068600586430508,0.9912891,0.6990022692847451,❉껄಼뤩췫徶觇䝞Σ꯲锶蓅Πག捧ဋ뜷䉭뺦콤 +true,4,5,19,1287225845,-107,-31097,1762894796,3323691255778749741,0.15909088,0.9628895636174963,ϧさ䭥✕೚䥀쾋쑐鑫⋕䂺〥틜붥惻鄲앙๋䧇곊 +false,1,1,22,1088009139,-3,-16719,-2069387796,-9136614041513084610,0.49108446,0.4171152142888477,촼㡂恇ᛐ৺賽袤앉ꧬ㢝갸တ帢Ǎ靭虌ℿ曓蓫⌦ +false,3,11,10,1754701450,46,-31044,-783427820,-5846744023232872251,0.11973965,0.5855272636174155,蓤摺同䰿Ǝ㺓ോꢏ띱㼹຃編陬凫垓撒籮ᖨਸ਼鈀 +true,2,7,15,1092923336,-16,6754,1931644210,8423434239078433009,0.7775541,0.2714871256536533,䗞毨돪ࠋꝺ륭㙱努Ʉ㏣৵氢졚ⷓꥸ祈뫟眜籵듒 +true,4,8,10,498455696,-96,-2274,-1190838950,6913488027442637238,0.64277047,0.6277049685488401,淯谹휵텓鴷뭭㹱蕊ꔏ㝸廏롫䋐큷⏳ⰺ㱞鯚踒∆ +true,3,3,25,1213693592,54,6509,-1294672738,1541550608598153956,0.23732436,0.337610267576799,ৌ憗㻸띥ᄏᗖ誴Ⱊ䩮瘱敢甾ꦋꝛ⛐꫻䦀❬ꮔ杍 +false,4,5,23,229745057,15,-21760,1267012355,4861802455287862336,0.5675772,0.20829674198517034,蜅껭쩻0ⅴ䦄⇌⺢羞燷炓䜁㠟ᐴ঻ᦓ巵闥뢑ꢙ +true,2,10,10,2139595848,75,-13131,1173467820,-4346154021836583909,0.47078454,0.5642848201640165,릠✣ǩ⇹繀绞횐툎뭸䌒僢쯭㶠훖쓚⑫Ꞻ푮২掎 +true,1,4,1,998721306,121,213,-623428436,-5954897226712164389,0.12356734,0.09415645257989425,갗풜숓툨⁵셳ꕼ蠟ǂ긆໭滓螔ꠕ琪拸㇡ꪐ๞쀙 +true,1,2,13,588710295,-72,13815,-1570868257,8144498362863709452,0.06767273,0.696608188191791,펵쩻邗䊌ၡ䭥暝㮄鴤쨳ⰳ䊉戢밖템ۄ漢쿪넃湹 +false,1,12,12,1283109638,91,6925,-938432496,4488234234349287441,0.7009651,0.20419981170860768,졂苫緭殺귕ف䭂ꏇ豨⁙캚ঔᦋ뺑Ợ鞰ꄴ䣤髾淕 +true,0,3,10,1780573279,-7,16511,1648116798,-4010522296881539778,0.49354666,0.76214839914083,竵ᜊ䛓ᰔ֕硘㯙彠ꑇ땂淕뀬侍้곙駚䁅矻フ๦ +true,3,12,14,1941178506,50,-6873,35863937,-500409598773634350,0.0035754442,0.923795394851777,ⱄ쌀រ푑粠ᾡ䥒텢쬊᤯๦ꖊ⬏宰쥯樻懰㷡ዎ簦 +true,2,10,15,1145886737,39,-6413,-305400046,-5792585860452956181,0.19058514,0.3632467230669233,釈ỹ斒ች纰п殿ꃯ뚥쪌蟅拤锡乲恍崵潈봧旎ᨼ +true,2,0,5,768907620,-106,29055,448423894,7147952938476908636,0.6016194,0.420481376975951,Ῑ㟱₄絹㝭⼏ⴥ怫ᄫㄡ䞅깍ꖐ吁ꐹ᨟즺麧㲁뺲 +false,3,11,12,1078985869,-49,-24562,1605102767,3459639484266869426,0.7760923,0.4504094938089088,퇑볟좵궨⑺嵚ো睴橻ꉏ堆筙쀫᲌ᔔ▤劾✇졌 +true,3,0,4,2136785513,-54,-21595,1351161599,-4215474026183872190,0.55648285,0.2866919957795735,┡ል㩃꥚蚡獬픛䊯䪕坏ᥩ扥⏶罧젓洆쁞瘚䈒쮋 +false,2,8,22,1518342226,-34,10888,867309376,3719016504427893406,0.16995096,0.25232259590626993,根蝗㧌냠꠫⣢珡䐫婣獛ↄЁ㝸껶㔴ꏚ糚丩쾉묃 +true,1,8,19,734416642,-21,-17349,591727007,245833550551406861,0.4722255,0.020039612901084802,ᦟစ혟添龾Ⱋ⠲셗貁ꂷ䜢덽ⴣ饅싺틴❚筗踠໭ +false,1,3,18,449851569,-116,-10115,-2061016334,1666693256291559690,0.29327798,0.4517175352013263,讟軛矿둠攼붅솋₱䒿뵯緈坲ꇘ綢떇䷐⁙⥜灂뾖 +false,2,5,11,401313053,47,7852,1914514519,8902320515066654855,0.21719217,0.3811163177553121,慘檠骃㽤ⷳ䏍睅籼왃핹࢓숲㬾ख驖䝝⾈䓋ᄵ㷲 +false,4,1,3,700348801,-91,-25335,167629554,5957393991977287973,0.55365586,0.7626051219937391,㍿솰ꉜ弙ゆ子랄鷞謕඲爸䙶㫟船ឨ糽꠰ᐭ퉇⽱ +true,0,9,8,1789974023,-50,7745,-833058389,-8475892967406247745,0.18611157,0.24211579179324005,ᰜ쬾ᷦ霪ꚲⰠ餄퉠䓱폖瑤専嗊洐領睺ࣕ坒一䥂 +true,0,7,3,831373904,-84,-5378,966073370,-7123230281893220309,0.9451594,0.5717575205156706,뷩厚Ⱛ壋홳⇄䎦쫳붎ㅭ毂䬋㽑ㅮ苊㰩윃냓ᬁ㢃 +false,1,5,4,1575527324,-121,-30889,1601416104,-3032310109863430091,0.17169523,0.28616553688834667,ᄌ貊파⚀ꁦ훊犃乬줗鵋輫泯倞䏐ᯁ좃䄾虠弫㫝 +true,4,9,18,1770440563,-94,-1577,-927977663,5064208619045430671,0.9329869,0.009589347996759257,뾨㏑ꊍ㚸㚥䶩≑밒ꆫ期誅㾧䜹얍ᴭ캬희ằ뉬㠥 +false,3,5,20,1708128607,-29,-23866,1336737969,-1922381870112074274,0.085885346,0.5644386692056418,㥷᳛힀ߩ閠掐ㆇ꣜ᵆ౸倗撥ᐝꟻ懠െ鬦挸鯋⊎ +true,3,3,3,325594285,124,-10662,-925151094,-5898663357950632544,0.4516369,0.7549911117119996,ᚪ蚍픘峘셌蝸䰋丣䶭ᜟ耓䯿꠪闈쪷鮗䧴㏳빛癧 +true,3,12,2,135734197,-86,23735,767156003,4617478254209884634,0.62046945,0.8562151131699631,炶㧤鍎뀯苯柌殧끚뵊㤻䪬빀ꡞ켩섈泗똗搇䶎ꇾ +false,3,6,10,130466921,-115,-12666,1464391210,4165891724677523574,0.008584857,0.2914030832205625,졃៾迢᪵憥鷆膁묿㘯Ǚ宿ਈ뛮๋㾎䬾耯솂鋷髏 +false,1,5,0,1406653387,30,-27263,-2035828826,-6152654796407870961,0.85783935,0.1815576433955779,ᙬ֏ꅂ텢宩밍制㓅嘑삽圄屷ǰ䛓詫뷎䍁礔樛欿 +false,4,10,13,351441140,110,-9032,143247473,-4629701276086450132,0.4037001,0.09279902688553465,࿝㠘酇ជ碆霠ነ窧靴㑶߄翨뒢ຑ㡭礉䜀쿙⏇佄 +true,1,9,27,1896057511,-14,23105,-591072145,7050648459405897992,0.39962548,0.6434247139812375,嬡⁌蔬젦跔룰Ꚃ漵荆绾뤕껔钎횔갳糟૚㡂ְ뀳 +true,3,1,2,1037868643,39,-15298,949431846,4771852763069643949,0.2180531,0.3156515718067934,⳰髢厧邟㵛䦍띗燰ꐦ瓬聖⯊곥쉒놞䡰蕥ꛄ▹筙 +false,3,10,3,1660899380,42,-3004,-958497859,7120620435592122318,0.08403635,0.35478892533333795,̴곣꡼᯴ᝮꂱ垯䛛魞絡铇圈楇ꕷ猕쀐젰訩涺뗝 +false,0,11,4,147870142,-83,10654,-1290460299,2144998523095333024,0.8448413,0.8761476467052858,蕎អ㬋ḥ铿ᶭ礞叚셸౴✼䔛雊ᖁᄋ䟷㇎큌킃訵 +true,0,0,25,1303037366,55,-20089,1008197199,2796359392582420369,0.30247223,0.3052065612133401,漄呇꾚ධᥗ蟰蝽ࠐ욊癤ꨃ⣏䧜㮭腼갩᧬欀쓡䇪 +false,3,2,4,1214458706,-20,9059,-973684999,-6574922049684700616,0.31087244,0.4215452606660476,傶뀴⍈玾⼹谵轃ႜ௝Ⴝꑄ夀蚬翩뉧꿵棐໣ꨲ≁ +false,2,1,11,1471946189,14,-12850,-1636206929,4565177683312531032,0.06814504,0.675652242741229,⟕如ꒁ싱젬⼇⾵텪唃⊑䳵ჿᚾ㥜ꋰԨ켥턘䬹磱 +true,1,0,19,1765602393,-13,7221,-1829072979,-6942403670248424465,0.40330583,0.5807528551152212,υ쾻뇜餅⽫ᙜ錇쁳餤㿙演獖瑝Í䄞틉倱๠凵䒓 +false,4,9,16,387372753,21,19242,1222653058,1320671179524366868,0.2127701,0.15135181769502282,꽫繪夔됿ͦ烄๖臦騼ഐꚪ존쨠㣴ࠥ࿢콭䎠據ไ +true,4,8,20,1581928087,7,30071,1180497866,-416676517875626885,0.69673395,0.5637189738424164,B⇞扯䩐糍䒷刪蝣錢쾴ਵ䒵⠮䀈磚줔⟱莈薾촆 +false,4,11,20,2048754964,13,-24097,-1250685124,-1979751288669640757,0.5773193,0.9147462460144969,믶䙒㰰䱨涍滳ľ⭍╿綟飂樞⭹맺ᠼ뺣턊ꊴ땢ꐃ +false,0,12,16,778075956,-102,-17968,1942365141,4411863822111419006,0.48187488,0.905490779234353,躮⭇ᱺ㑁雤襨ుሤ藇ᯊ㊼새抳刪ዜ쮉겿떈᠓׽ +true,0,5,14,1904569058,111,19214,-234080791,-5473568741056175944,0.2555343,0.434825030523886,鱃得꺁換댐쑻絳㙾蔸돩곝ૻ㲆뿤邋휛걯촣ᵅ黒 +true,4,0,2,554917662,-123,26943,72591987,2224586585060278198,0.59320647,0.9678466125587091,㦟ꝷꂲ侇熑톰ᡤ㌈ȫ┍飳㷜飰⁝짨닝ꈧ束奾㝫 +false,4,10,17,1605770338,-50,5773,1317639664,3328498683828456843,0.65183306,0.21517202088141052,Ⱐ星꺦秗෺緝攷续썐釃衋⇽츷ꔫय़噩༦됸⤦曥 +true,2,1,27,916115615,-15,3246,1561153724,6640586874325022912,0.7753064,0.048453399897169014,粢릘⥅䎖䤱늱섞䌡顨෥⮶⦝莊㴑ല涵쓿驈嘤粽 +true,0,0,16,698633209,56,19407,-2094903057,4491125346907381815,0.51078033,0.3561153179185831,՜힖턿방ᶩ搰㊯婭ۥ亿浉吥䬴믓ᵌ㍛㇞⭍኉ꤔ +false,1,10,9,331717930,-51,23844,21286937,3224160792289524144,0.74783224,0.7377421998597028,欞䅘襶肃跿઴伄⡴㰀좉潞픘朒㻢諜⸞넋ぞඕ搏 +false,2,6,7,450726051,-68,-26923,493535785,3066437650902048487,0.8460534,0.5129705241041475,홠䟜詼၂菘䙭ꘞ㉒㭄뉺椈鮋壡嶠쮤❘荤ᬦ林萬 +false,4,2,22,186639041,-48,29438,-1506140672,-2018840238644402942,0.13049966,0.5466370818473373,举뭧뒛䤦̟葷鉝幠⯘蒮݊鶛硋떍ഝ⒃苚䩴㎍劢 +false,1,1,9,683974670,112,1395,1017959972,1576350744315291421,0.29213196,0.08914172928832309,㈕舶ƚ骩絽慈澅栄미䬎銠꫅宆腂稨牌꿐Ʋ힡ഗ +true,3,8,1,1926050631,79,13276,-2120652033,-1505944159283906126,0.4889694,0.9814992515656239,╧㟨즊旪׈溓뼣ㆴ䗶뎡ⴖ豅닞유韵㟵镧ꀯ䯍塖 +true,0,2,23,159409222,-81,-20876,569197401,908482088768601596,0.49604642,0.3213157883357525,岩ꑜ賣忙ࣀꌷ趇뉐ij〣鶦쳯檑覜鄙䜹㚽࿒ꑃ篔 +true,3,0,2,668198746,110,8739,-1195170308,1819445355373663874,0.7106179,0.6749794359634981,ཱྀ蕣쀳⺫渙ꄇ㯲촨致彸⁎쎉滭↟⹲̷㗹造⌓팞 +true,1,10,24,1629969491,108,21345,-400901845,4601093771773799249,0.6409457,0.143335247625615,、ѯ驴쁟굡渺唱꽕ⱷ翺᭦㽋瘴劌헃妟ꆗ骼꫃籈 +false,1,2,2,964921733,122,22344,-1654744681,-6750618225918461002,0.890248,0.2508628317430849,䦷ỽꂅṞ㔒㹒閿캗Ḍ塹㪠⛃柞渿꺯㯲쎣훘썝洫 +true,4,10,5,753159665,-53,14071,-1652626809,-2078510067519764775,0.5061584,0.26075374684018604,响쪯䴓軆ꭙ恽ꥼ㼟䑆亜톐ઇ嵾焎䶶氵ḡ붂嫦亡 +true,3,2,22,102069306,113,25145,-866155263,321794347904500166,0.55716026,0.5016446783724774,ᥕ⪞嚂텀辨⿯눰掀὿ⱝ筪㳊㦞誦胏혱忨傪扒飨 +false,2,9,23,653707285,90,-12911,-1356299307,-4523475253013105708,0.05585593,0.13857950330272173,䡷潤엨旦Ἱ붌ὂ툚䬍橿云薢맾닝鎣掑钓ꐁ뎝嗳 +false,2,3,3,2059881038,-13,3488,-911659303,6598453538542729952,0.12730539,0.8520859737571457,⫆飪┸翘䬼䱎㷒䷤꜋饨瑐騔㄄潱녡蓂ꎑ쏙쬭 +false,4,6,20,409734065,-89,-22000,1669476380,4112848153032561892,0.93294895,0.8305740538524686,㇄⬈۵෥뮰ퟦ⏻箔髚갟챢ࢗ느秹退嬗迁گ䭽琰 +true,2,3,19,1259996683,69,17880,-181588028,3821731361044833835,0.9642894,0.8355453825918163,䥙█巎욙缂쓈飉ꞯ숮닿Ѿ្䃜塱겂儽뗰吮ëᐖ +false,0,12,0,1839720673,4,26885,-1032134770,-4166283961398142264,0.7988619,0.31472051144986646,뚀Ẑ킸쀓夌葆ᐖṦ陙汌ꌮޡ䏯鵝儃邦琝꙼魁瘽 +false,2,1,6,1301693720,4,-31540,151610328,-9216439232345632980,0.5150462,0.3147516785904575,밇ሇ㣋뷁⺚唬䇸斌۴쭅␣㣎ɟ哷솦탯ꕮ뺏⺬幇 +true,0,7,27,240962410,-78,11563,379197915,-2090515699168836997,0.37161523,0.03804835023179365,㽿익櫀촅ꤏ琬睦ꁏ뽾承ང埛拇䤳៉噽齎࿈帆㤽 +true,4,1,6,491938874,-78,-7657,-1713674985,2120880350861883579,0.8542008,0.03864944648071922,轝功⃟釮辯쳄柺Жᵭ꺂彷現҉튼䠓왥熵칦ែᨷ +false,2,1,12,292523091,-45,-11401,-1571923721,1292379374708880307,0.57682896,0.44352114747118687,叉尹À᡾칯⵸柘鿇걭㘶ӆ㰵흰䖚ꧺ㧼뺟彮ᤜ甜 +true,0,1,9,573870887,82,14356,172848785,1164858801793800808,0.9821998,0.5023261268239142,ㆎ⇐㼣濁軂೭ꊍⓈ틁罟滦쬔⍸塨ဠፍ㥰㱘忕뇧 +false,4,5,24,2101996079,-47,10816,9422129,-7718886336742930723,0.9474292,0.2899923531077021,诫鳘觟㐩⻣ቄ쪶墁㜎밷쫎粕ᵈ쎃빋鼒⼧㾦檂䓹 +true,2,10,8,1985551670,-88,19155,-419811620,1356873541588406340,0.35318744,0.7723502098850213,Ⱎ캫䓈꠲퇺覲દȑ鈫龮醦췥透굱閄꙱൤䙖ꑞ簌 +false,1,7,20,701041872,23,32339,1161707988,2776691022936185348,0.37926137,0.01702500540212859,㏸㍍剝홖덺ꢴ謐縬鱮╹뚗窂䠚祣ᢏࡀⲝ馴∷ۣ +false,0,2,26,701083461,-46,-27652,-170702331,5700970230235297892,0.75121415,0.34755680027822267,ᨠ㳮꒺衱織躯咜갗ꈬ일ބ뽌앶㎚䌗䧥Ⱬ㉇ߟ봂 +false,4,8,19,308099843,77,-30230,1084496302,790867450853168714,0.040717006,0.8277609838234431,穗겂࣏ꙟ撥Ꙇ罰爿揢䢏铂㫳電㒽퉞쳔蚙甐ꢱ䇍 +true,4,1,27,770426034,92,-10448,1473455669,5305041486930110117,0.5631632,0.4198956617315416,駆悌ㄲ餪豦鿉骄⸥䥓暾漎ࡅ姙墚䁺ᥙ憁㽓瞔 +true,3,7,7,1527844932,-124,-29466,644273448,9155374553061731286,0.6002374,0.8017213523855212,鞷滔뗆桳쥶娂ᤩ섘㰽ꌮ芆悇ᦨ梳G⤐∛匴蘴猰 +false,0,4,12,1360802956,-3,-919,1476287370,-7823988326463117720,0.019938052,0.40837258850021263,⫵柅㚧䐻塖ꭔ䵑᰸䊦株족㚁醶ឪ봌甔쌱眒盺坎 +false,2,8,25,424937890,-21,-7496,-116627502,-5539144888875980695,0.7646779,0.3908420873239533,哥៤㊁뎃覅⡙댻⟑텃憂ו㺈ឯ銵걥瀁䲲눴倧諍 +false,1,7,28,2048821577,-103,29279,-1410928897,9201665022718575466,0.6662327,0.0945252022944818,濋잲鏷ᱨ僁臭텱魸딿で㮡레嚹㥭答켍葮蹎몫貜 +true,0,12,20,714237037,-1,6615,466420125,7337279928358679796,0.82842743,0.8627083185855362,歋軉ၼ霍㳖襲岽콊摛掍湌㝻㩓⬹㙳萎⠜쏳៉Ǣ +false,3,7,1,1475093755,66,-26361,1683005790,-5139170029485337114,0.4021532,0.6049396837870864,끆朽ޫ唴叵쫑꼣क़⾂劗䁪蚈ፘ苝ꛇ閵쥶珵輽Ҳ +false,1,6,25,1975095528,92,12739,-532088819,-6712302346253743895,0.53511935,0.42977725574305814,ᚖ閍⻉嬝튶ர쳩꾴君쒲䑭뭏༦쌰厉ⓒ࿇炇밠峢 +false,3,9,2,1990728669,79,-863,93724289,-8101309980276055142,0.8195417,0.677618337887574,პꮑ퍶⪓ᆼᑃ賙辇ௌኑკ쩬푹閰봝뺩꺺꼹鑕슿 +false,3,6,16,996835606,-102,-30762,37781033,-9122277453893808611,0.35121644,0.6568968892971336,᛺눢⸱뛵槛䕾悥ض䱴뤕幁㥜䎛ん㐛섫妱㘨崻鍅 +false,2,12,25,910769856,-68,-29714,1969366652,-7962518126606180752,0.5824734,0.9333612416875543,㠉䒸娩㮕呌九襰舁դ䀉㾁櫕㱴䎦楎讄Ꚕ絠ᆒ쐅 +false,2,4,14,1229079897,-41,-3969,1513672192,60226721086805611,0.76236916,0.27593425461119236,㽄読調䛙泯薣煚⟧椼ⴝ뚐⡮쭆阭ꏓ㹟⹖Ƛ砣咑 +true,1,7,0,702437653,111,139,-639925920,-974771215430995249,0.13883227,0.3080164797755379,씶꺙頫璂赫⦑㯇姹㨝恋鷉ᜀ鱕芿萺⽗㥋۹뿠 +false,4,4,9,774692787,-36,-11885,-82113298,6291341386209588360,0.18730986,0.5904764978405083,穧⹾⌅혗՝졳툽胀聴꿲樰鵭㚗ꨛꐹ㗄뤬ꠠ彗섵 +false,0,1,21,166810683,36,30338,63207346,4665618113923515115,0.023733556,0.30168615595975146,呹ꈔ럲欝㌗朹㨝嫗ܥ鲞埜픂ᬑ莸ԫ箢ↁ鑾踰੨ +false,1,2,7,2125241159,3,-25642,-1215945719,-3254320722874379362,0.028709888,0.1990353927336258,ꦯ⳩빬䚉䘧菴㞼뻺྅⦢钛␞ᅏ맀뚳粷攔寛힮偈 +false,1,12,24,127665671,-5,16524,1569780950,8484517148267817351,0.54221433,0.6910549838842718,᳛犁둘峽Ӎ⥴웑䭘첵堗骰ᄆ鲌矕렀䔕خ㳌ⅇ⍢ +true,4,4,18,219535881,70,3314,2089947233,4607500669321780649,0.49014562,0.7452829547728306,¿ᓋ۔吻ꣲ狺䰱⧥ࡥ⅓乷इ筕뛕雩싉吕凋⏵畈 +true,1,11,18,1727138559,8,28827,1979987443,-1070128557870580220,0.96864915,0.12304694505257907,嶼ۍ꓎瑭㰁쵡囸싀烍텘곎⟖蹤ᑩ쮰曌뽵㋇펞ェ +false,2,7,14,1288123073,27,114,-326933763,-4538677862736040277,0.9383131,0.2442881913524514,ᴅꔐ槛涪琜젓뱾板鹱㫞㳖౤녨笭㧢ꄦ㇑꪿Ҽ疀 +true,2,9,22,521409816,87,-8021,1103054626,-5803603774572649287,0.4566242,0.7451840097388837,냠奱졕밗麽側鎋㍆ề⍃㘼㱺Ⲅ枨պ搪曕袣酴 +true,0,2,28,1729380619,18,-27268,-2063214930,-5386022942906873035,0.30840534,0.15391640344898394,࿐⣁⏫揭暝ᲀ᣼秲쯼饉옓䮌瓭겚픣踷켫郢Ɩ㏭ +true,2,4,1,1580335224,60,-10778,-541826583,6298546146407188963,0.3797847,0.9806368435475767,௶븫럇쎪箱䯔촰㹕ꮓ葿᎚륊ㅟ梸䷾婘뻮㳌귒纬 +true,1,5,8,1825815563,76,-8103,2064685622,-997433072488275245,0.8175702,0.4060677982338461,卂ಮ㳉錯턭娞ᪧ沞엚꯴霴Ꮽ흥꯱ହ䌗캋婥䜮준 +false,4,11,6,219229032,-27,12437,-1858809022,5285234520967596715,0.7698803,0.639934628631153,윑㍛℉욕騿盍ګ뜬樦쟛鐽ꪉ∴姤؎璵⪜냮摉㲤 +true,2,1,24,500434828,61,-28137,924073819,8265337405046498147,0.7594864,0.7876082540140072,粡菙鲿経녂퉈姜◗迋ᡃ䨈皃᳭ᆬԺ據뤌闦䷊랜 +true,2,2,26,1191561227,-112,-29302,-1845742387,7701109651724719902,0.73088354,0.6797434264577749,ᲂꆴ䋯⼌迚혳ꗫⷀ靁赱王命똥亰謒圚믃ᬌ䟺쌛 +true,2,8,15,1186735829,96,-14913,837139408,-5250188028060280745,0.35682666,0.8465942672091502,O鶴ꢸᐋ㤭숏궭諎甛滳⠓낺Ἢؽࣝ垓䈿䬱뀂᝽ +false,4,1,19,1409639194,-47,22998,223202271,2765650454778188034,0.8483804,0.5890937225273637,补륷㏴쫎ᓖ/菬駆㗶颯❰딗ꂣ醚㧾纯䥒춵志ۥ +false,4,1,17,505461611,-58,-13832,1030922026,-8505461947064856204,0.6796592,0.19772741284905904,⊚⚭ᘆ᫣쇷翨玣ᡴ燛㭒랔푌❒䆲벹ਜꢯ甲ᮤ␯ +false,1,6,23,755389207,-61,-20467,-423519622,-956832623771146513,0.7071798,0.7811886581582305,줙ࢊ냫劸쎳횸悄턪䊰ᚵ뤛ᤨ覓䷀ลⁿ镚㲍冭䥈 +false,0,5,1,1516086503,-96,5911,249962800,-7839649174118521193,0.20281577,0.05378145868940831,໑何䠐ꦘꞍ牉؏悲Ⓐ쏝쳦掠빵듉䝨靳쭯콉趈㱦 +false,2,6,22,1720613484,40,30310,1639737736,-544610854867257318,0.60717714,0.6881121482310578,㻼렆聸㺡욽ᶂᓪ냵렿꺝ᕖ껰ῼ⡒䨻嗃ᐙ⹒ퟻ桏 +false,3,12,5,167732375,56,-807,-185268669,-5605352300474289547,0.22660851,0.7958555216678562,䭨㢚䥆⁆虍ģ鼐蓡岩赌㔞妜끼㪓쥁✜슣壠ᘈ싂 +false,0,5,16,1793225363,-73,-20616,-444620608,-2974078663424361303,0.2918396,0.30441670021080536,橍ꍌࣃ⭿쯮ꏫ▚졻㳥뜸뭯䞄疗⍼縘鴦酚ѵঁ蝥 +false,3,1,26,6036300,-10,-16278,237902789,108153940198218877,0.09570438,0.6158853671300282,횬熴钐뺺趷⫎䫱싱菖◲鹧⨟럦ꆄ픞驹㫂Ễꔚ屘 +false,4,7,7,1726331706,47,-11417,1182167074,-5239040597459791977,0.20388937,0.16892493843508882,힛攲촘ⅅ쿜△桠晴烧舷陨൚̜怺恊႗Ɽ歧཮ꏹ +false,3,7,2,1100084362,102,12903,1190087826,-7437790280021405118,0.8950938,0.9835923929247793,꯯绽ꫩ᳏鹜᡻ꭠ왏紳т煾ᨕ艑꡽㣷鴠뮞੏쾪瘓 +true,0,7,19,1896145160,-26,26041,-815697931,-9042118254009968025,0.45021224,0.5613780027608319,뛚篗흰胁䂑ㅋ骯閗⪉ἤ鲩哘邱杇Ⓣ썾₴헅禌ഒ +true,0,12,8,549691465,82,1516,211523089,-7954246658343292133,0.88485366,0.5008493503109895,ళ⃚骨Ὅ흈揚ꅯ๢繴鍪ᒍ躓痼礽ᇇ䈰⍳幦챗汌 +true,2,9,23,1239733478,-15,25644,922271646,-2717017794490574789,0.88475823,0.1855868367858331,怈㸓สꋒꊹℴ鸵狾።희榹돭㭴ᴥꬽ㤇㧛៧윜䱮 +true,1,6,25,2095680238,117,-19203,-1064925075,-7593157191549944626,0.08662772,0.5573373437370076,Ѣג熠鈙෿㙱뭇ᰐ㣧蘜贙뽘ሽ쭠꒬⠥䰭蝰Ň걣 +true,2,9,23,247029838,20,-21176,-1533566767,5580648357785566471,0.6037678,0.9766644947415974,엇늡货œ䢭䏮쪸㖿澿᫨豹ⵆᣓ蚌쯗᐀厣簼횖巎 +false,3,8,22,764261877,79,21451,1994852586,-849066385018286446,0.22055316,0.7100596889249792,籋윥憇뎮옂ꚡ뷡샾系㟺꧘㞎⢃팖럨戾鏫얎疒ッ +false,4,9,8,1062782840,25,-22147,-971971603,7601043534721898233,0.30986643,0.34061056731209205,嫍狱丛뫀网⽢꘼捹ᬹ틁綕朄붼䜷癟㗃⫸뚫㿸㢢 +true,3,4,9,1890302684,30,-21609,450351994,-5195432491042805854,0.07456052,0.9615190890855236,환ꈋ๢৹渼샩楝햵ԙ䕿푞榳⇼㹺쭭駴矯롭凒䘉 +true,1,7,6,846560533,70,26637,-1068563589,8645682135229516630,0.3827533,0.5355630566407764,ȜМ휤ᒫ䒭⨃괵맔爸읅躼쀈醜䆸冾꥗삵胑[拊 +true,0,10,24,1762253986,21,8010,507136253,-1611897952838717131,0.8006082,0.03993674675026826,⻡⬕멊촛쬫帲澳寠狊鉹뵃瘹ꚍꭆ딛ꯞ೟␚쮊꣮ +false,3,12,5,110574873,2,-28391,-124790736,4829839445128605002,0.56046015,0.7679634224261329,ꋗ鈗쳭쵾㮰䡢Ⳁ焐곍ِ᝭庳郦㇇䥲๱Й裺뗖귧 +true,4,2,12,864761995,52,-30976,-2041871921,-6980373723786070110,0.7050925,0.3830327364641034,䜳ᗍꝷ焦䪩瞥䣩Ꜭ餂Ӱᔿ燫堕ꁸ悐媤៯㓿㙄廒 +true,0,9,1,1677399018,-14,6272,-2139804706,7341782609509084299,0.22262114,0.02844783454047195,Ꭿ俲ऩ샇麕氒쌉挟᢬욦棌繾鹈瞀絲췖쮨쑴ꤌ瓦 +true,3,6,28,1942653741,127,11534,-724635501,-4830074867727432466,0.22438735,0.556372608878059,拣辗틭툚冖㾭姭꽄࣑䔳洃탱랶쎚⦞刋奾躨᭙㫚 +true,1,4,4,1753166636,12,4475,519074099,405538164706495167,0.235416,0.5607727803885736,ꀂ뿰릲榡⹄揢峏ᝑ幡⡭꘏峗໖䐌䌞瘿⮓穏⿲찖 +false,1,0,23,693877312,99,-18867,2000826202,3826199197102548759,0.9539606,0.3475227749887002,㦏簄葝漟氘랯袅籓䔶菿ꐱ趣뒈碔㗀ɓ꒩嗒죣壳 +true,3,0,12,1932467860,118,28946,-338667711,-3811638934217246215,0.3267156,0.20398103766939302,⩆䇧┭蠞锊鎕\䥍蛳藙쩱ꨋペ븄颣㑋읆ެ棭 +true,0,7,2,457130070,-128,-12105,146696599,-3789283977526124832,0.07452023,0.6580880563970105,踴舄翛竀쑢덓䟢ᓋ멝ୠ틗扰淤钙筩Ğ提℁ⅺ㐬 +true,4,0,12,1621197357,48,-31264,-1185471716,5333041377946667991,0.09279096,0.479485457280151,ま㠠躄⣲粵뢂㽿潰鏐⁤뗓갚豾倶䪟ۖ碵㮅봾櫦 +true,2,4,6,393046421,59,22159,-440187006,-2937718484805791768,0.9524316,0.26279223578429056,跎랑ⷲ噱ꊖ뾂⸼獀Ẅሀ沄ꠠ⑥ヿ暈悠材雲ໆ궽 +false,4,9,27,1694238063,-50,32203,-1726120170,5469539346156519424,0.34970838,0.0598221750681448,鲏쬺⋜ⳅ➤菡᎔쒛毴쭔핦ᖔ园⾨鏛㔶돨殓뤛븇 +true,3,1,10,86040064,-61,-1614,1427233750,3944657029466120525,0.18776399,0.18274288889404178,恟鑚繦䖬댋挺虅案辫첚¯魊绨ジ偃蒲欅随輝ꌡ +false,4,6,14,1412164238,-42,3720,1503663711,8263063637702236690,0.6182978,0.2122121824162333,㏤춵☺헭뭯Ӛ䊪헤ꄟ碎䞉蚆ᕬЈ띳큕萲외⚀䣘 +false,4,6,7,624873238,108,-11837,1261628174,8124458865858010666,0.9424731,0.2648091438304201,戧ഘ펱쯤갳햰霸樭轆䲘ý玌㩢讳꽷ꚾ㽊⸙푞ڵ +false,1,3,14,734893259,-127,19507,-30888687,-2288471342949481916,0.9966397,0.8709637544292466,㜊㐸瀙؁裙脓꺆遗蒊蓜憳廻㸩꘍쎟₉媎沋ݫ뾓 +true,0,8,9,905397311,-111,8524,1502118792,3473644655523422137,0.89963603,0.566950855656357,㠹 栃癋ᮇ䈳䡾웩骹⩆ⵞ냸ڿ紐റ矌ဖ譊釓ꤟ +false,2,3,28,2091415377,-27,31036,-1212956684,-4857670553866706619,0.5033241,0.4490898393630405,ᢈꉖ瘬굠ⷆ葘踵롱㶴뽟둀왕躎⥊퍈唻╦䀴த䫚 +false,2,6,10,361195459,83,-24307,-1432922043,-7710681500716716325,0.91039294,0.15693491492054112,蝸ᗘ䂉쾨鷕獒輗ⵞ䠂㮩쉙዁黠菀揻舝…䁨㩕䜨 +true,2,6,3,929181548,-37,13685,1533600891,3039390349100660513,0.10556418,0.8435500043206446,흢곧᜾꿤㽼䀀ㇾ孑쥓襯笨蒌㬂隇੮訓ϸ돻컭栞 +false,1,0,24,2140323720,-9,28170,1152857104,-7198140148660377265,0.6383702,0.296694844829575,炝ꬰ냯ꑳꑲ龺䌈ꅙ홠츋㗷䂠荻ਹ혥鱀쿸ᄄ弳趾 +false,1,5,0,1449145810,27,30224,1011970251,3117522684378328623,0.10422468,0.845653885856783,䝁덄뵁ꡜ迗뎄ᄣꑙ颂꘶塹秧樟᛼响鱡읏뭡뚃ꑏ +true,3,5,9,1787062807,-76,-23003,2145139030,-3193250702534549782,0.17477554,0.23315610007297094,縗䎶챟ꂜ魒䙾റ迱犾큠걠桰鯋鐺뺘୬膩㿅阑峿 +false,3,10,24,190356155,97,11969,-657312568,-1117803367748784547,0.8527578,0.9753528491547591,趝嫞줜ᾓ㏾䂡ᰗ퇔ꀦꑵᐰ鉳峣ᮍ楸舽Ɛᇝ뀙캂 +false,0,4,3,219242968,39,-24520,-1974203649,3642627760280722819,0.71685743,0.7321159644886541,佧岪訋擌靊㊗뿤ꘋ劃繕혜䯈㉋Ӹꥄ虓饏兤譨쐬 +false,2,11,18,1994859279,-97,7273,-785739649,-3384152560995186100,0.6111811,0.7085026394528402,ᢰ硾⒗췂㱍覉₏韲떶炮玤糘䇙釡ῖDz钟洕坷쩲 +false,2,0,26,884721435,-56,-12272,453803257,8675061408112971386,0.71527416,0.2719236684679943,磷ꢴ뉆芜萙ᓽܓᣡ‹㹾궻⮳킸톯⎺⺶풾볍塺ᾝ +false,4,9,17,96588005,-127,-15374,411945319,7252811393769297694,0.5438788,0.3703581922997703,ꭟ诰贎৉纋鯕뱗Ⲡ嫊㊗ᶞ휀䣫莻姃敌⁽昆袋㴈 +true,0,12,14,2022855930,30,-25665,-1258973346,-5345375259489784071,0.71885854,0.32998426533103375,葁ᇩ龉棁뤃揟浂⾪鈇舃훃Ԑ저犢ඝ帲怲ᩆ켯햹 +false,1,5,19,1477853573,-45,1089,1774745418,2281603937128163561,0.4736452,0.2651492629459913,旛⊩쿋ꢭ쨶狒╒࢚솛㾿骪휽᫫雰⽸嚵楒ঃ葭쀈 +false,3,1,23,163907572,122,-237,468294998,2724238383658753127,0.47393662,0.04998213882456293,爾㿥僅玎⓻ǟꧡ⪤珯弎作ⸯ㷽젖㲌䯉⶟샕ʿ쬁 +true,2,9,10,1385062481,-119,-24464,-1789326631,-6949848426361579234,0.22867829,0.789663420394937,ㄼ适☧稡ᶒ㓨셐㶛ਾ㒑㇤ꭥ틅笆쨺䢸䬛ᓬ飞ᔳ +true,1,9,7,1968915629,-122,-23749,394590508,-8219198316803458907,0.01843369,0.5537035869173044,莩薨ਛ튣ᝏ漉춮갬䊗㏑馕余衛샙⊳Ꙃ⡜ꓐꏙ㺓 +true,1,11,11,276724257,111,30633,1250564920,-3465333809121248905,0.97064084,0.45721629419942944,⏉ᒾ䇌畃ĕ牖⪀焖繫⅚ဈ쭎ǐ鴴⯄嚗ᚂ雦膪ಘ +false,4,8,6,1478402725,-19,23524,182024486,670456397367139848,0.64356726,0.8172198386294783,ው䗦㏏끨逅㑑臨廹곀⺸釋腬箝Ὡ刿䳻ຟ餞昵瓐 +false,4,6,26,1947499328,-39,-13737,-105765628,7891961009888818461,0.687745,0.09773734165086989,ᬫθ覇Ꜳ⋯륟짧랕合ȣߛꤶ诃齼䃒䱛妙믣ㄣ늡 +true,4,4,2,751351361,-34,-26548,324975908,-4985229514747786958,0.80785763,0.6054332047911015,仂뭫꼠ឧ쪺횗챐鱐뭰ꉙ佣㱈읩䛞绽臏ᧈ㻢ⴝᗅ +true,0,0,15,2117512386,-54,-32625,-649198433,6806138664214278948,0.053943872,0.8034771236941767,蘶ᕥ笖틒謘꯸睇曛㯅叕⁋嵅侲裮턓꺠䁤쯜䔢⊐ +true,3,10,24,1545692391,65,-27102,1679434520,1477808950836860726,0.18460625,0.3966274533417897,燠ퟷ鬑뼌渉췣䗣䎸궇廞謈혯䘒ꥀ콃䉱붹겊 ž +true,3,1,8,1690286716,92,-3112,871466697,-5023265279643967337,0.41487402,0.7838036604719485,ꪹ࢐鷱譍戃펥쭂㈐޿䁡旎㱪婗炢濶鵃㳩툜䢯⟥ +true,4,5,8,783628,-41,-10964,1960736964,-752871478250714969,0.46603346,0.05442721715046017,孼㥨䍧葇菁售稉底ᐈ甌ᯘ铻≙驱䂒狴鳏鋄杦㾆 +false,2,8,23,614922851,122,-10560,-1185399346,-7774726185513849433,0.3720122,0.4512584059320437,骔쬸䳱ச镬淄ⰴ鴒颾⇼슍믾怄惑䄮狦蚈ワ纗桄 +false,3,6,0,1522475364,-106,-16889,1808092021,-1236033946341067124,0.5427082,0.9210818477939374,ힼઠ靶ゾ瀹蠓藋쫰䌩鸤휛䣧翹굗㪁迾뉪ꖈƋ屍 +false,4,6,9,2125344243,51,-31009,792538835,-7853989582454992713,0.17614293,0.28256220081287675,ᦱ돃ସ宼Ǖ辱珚ၛֈ릁맮ᚓↈ䱿ꚏ〪ᨥ綑㟊ঃ +false,1,2,24,1552813180,1,29569,353725066,6186298840390736967,0.18146902,0.5022242480091891,殮毎鍰틀㨠溧菺鷂ᓡ⑝씀閆᫾鄖ꠄ汧✇ഇⲄ捻 +false,2,0,22,1857139486,31,-3536,150155779,7820193225032620891,0.8597146,0.70908397935545,녛蜚㓯邶䳎潃猳⿱峝ꡛᵼ伇勏ꛨ㴸赒봭恑蚬揗 +false,4,2,22,1071339242,80,-21157,1252730885,7586340282937154032,0.036323726,0.8246641436719843,豆ⷰ钣㤕ዤ궃鉾颤ᾚᇏႈ儳㬒왦鞞⹠ิ㶭ᓙษ +false,1,9,9,742819789,-77,20213,-1423713872,3543203616318744714,0.82544696,0.0946642619465724,꓅攤ꄙ࿩藺篡躁㕵륦캝槎㇧쑜簆Њヵ숯됤䵬鵰 +true,0,5,27,468916404,-90,5235,83141248,7283651347220016313,0.78424275,0.4167184761641931,㐓⮝꿍텗긬⃀㍼梤䒬෾ዏ筩❠춢ଐ䤒푕롺녃Ց +false,3,4,2,2026564449,123,-14983,-294801502,8382086564535564431,0.3762604,0.22098288969051738,읡遜К놨剖℄᣺혩穊ꗢ䔍ᶠđⷈꪱ鳤ბ䰤刾ᆘ +true,0,8,13,326586959,-99,13227,-407962060,-4610716468070162606,0.3629434,0.09498698285175156,忠꒢蓅䏈뭀鍶⑍┙瑵쬩࡫兴峼팺ᐓ縪驌餋ⵤ㜜 +false,3,10,14,1208384845,-111,-6809,-521968346,20553134549368439,0.9454982,0.0014460175058255142,참띇Ḻএ᠆ࠚň쪴쁂䆎엲㥶ᓃᏑ᭏意஗敿㕐᧍ +true,2,8,21,964499581,-11,32257,1350530810,3194629316961088104,0.6511946,0.9968826450233449,㸒ቧꩋ畚썌뽀ဩꠈ叶서와᭵튀⿫鱺羽듐셌䃰뢥 +false,0,9,20,95742180,-58,-7007,-760249949,5412155990366864411,0.5297432,0.29754757702705936,㿤籯쬧扩⋔콐㮿貣ꤵ滑ώ켺襼唐鄹튾Ⳛ쀱㝀☦ +true,1,0,16,1071509982,51,31162,-1252674704,727226771807372723,0.5532096,0.12958961975675531,䪜ᆷ긵倥힕ຟ䶺᪓報䤪棎늄팆쩖ᡳꬷ⛟ꌡ僟뤣 +true,3,10,18,1188807674,91,17320,1193737407,4776742583075073262,0.8531791,0.09465088299568925,⩜㖌쭑世塳ጄ짯㆑Á儤閌닑ᆪ೪ಊ廞䏍一듉努 +false,3,5,16,698906415,98,-24177,938166686,3002013368078838828,0.0670923,0.4770979497091494,탞띯蜂毌饭螲酂嫗쨧허໦䯱ꦦ웗㛡䗠۠揀鶕ㄔ +true,3,12,27,17570265,64,7199,-51817396,-2103749563615537867,0.24547786,0.5076847755859427,屦픻ᾮڃ쐍聃顬颗扲ᦚ糅力苬莨戆Ὢ퐕Ꜯ䙞镱 +true,0,12,7,735489609,93,20535,-371128363,-2674416610700795288,0.8558959,0.879519270992787,瘋₻䍽也駨ボ囖䤬絯쭮㐅쓈⪏⵸䖉삝⚄孳憫䎯 +true,4,1,20,915091167,41,8179,1889985445,5792681898786644575,0.7393128,0.09262331822987424,㹼섬널䮈஬㜥ꅛ紦哈쐤頶쏷榌䶙磕蕅䤇枯哼닏 +false,4,0,8,552057524,76,-8253,623239332,-3375634575315459031,0.36911923,0.23940023791448506,靵㩰鸺矾喒‎芕펞멃ळ䂀듅繆⢅⢎컻䗛ⲑ픰溗 +false,1,4,21,510613993,6,-17377,-64759520,-3974808341229739387,0.5365573,0.40824405676263453,淛㉡ቿ뿔᎚䱕챡᧫炇⇺앤签ᰚҠ톪Ὧ⽨ᒃἑ稣 +true,1,6,18,692406315,56,23984,-538943732,6802013956830195359,0.039002776,0.5030474475649561,ӯ灥ᕳ녌㊋䡱䲓咀Ԉఱᕈެ夾䰺뀷蠎⠖塇Ꭱ횃 +true,3,3,12,924528952,-108,-1996,1757736884,7975414790775317613,0.52667034,0.01023964046913095,샯꟨熟쒐쏥ᘊ擬낢훆⼨ꮥ臚绂꧴⺟佞為팊ᐉ朁 +true,1,11,5,274430582,-32,-25198,-1101801378,2627066092072658678,0.7182265,0.8338279864158362,祕蛎秥媧꟦㐟㇂鰫攱텪ꗈ椾ὤ褋ѕ䍯嵷ы峐끻 +false,1,5,14,1751536026,41,7172,-605725162,-3283950910421578121,0.8041417,0.6496595368142363,熤ᗉ窠朢檦⳽톷㿚 뒒憱럢࡫㷄ௐꀇ둪屶粊ি +false,1,6,1,1507465631,58,24518,1607613295,-8873966780457438942,0.4712336,0.07898064162389484,墻䥵ঢ៽릕枼鮴䛨ᎀ႐讫閹ऐ霫䍕蓿岫䡴鋥䪉 +false,3,4,23,958006470,-25,-4313,407243213,9070365160125430370,0.1382814,0.789289871346883,ㆦ⹯휧㘍釫摧⤈㒖떹㛙띳窽잲썊謆粂㌘颣汪턡 +true,3,12,26,1045919070,61,32405,498397434,5010692401093873922,0.15231031,0.8874324151846106,猃ḹ㮁芍逺ꡨ酳躩ᓆ㯰샋鵣唵軉哰㑤帆섳틾찫 +true,2,6,24,1972845497,-5,6703,1879854093,-2222896549059064624,0.3328836,0.7508437586551192,鍿뭯淠⼶㹬ඖꎵ批䌢覀℅妹↉좍蕸ぽ会౛죿퀤 +true,1,10,16,926210712,-13,-3167,1736953712,2081307451813152858,0.83534896,0.2697580960717878,펩逵ᮾ㛹췬ᗹ଱䢮珲品瓱抚ꡞ哠펥꽞쿓隨ᜬ騺 +true,0,0,16,98375280,-108,-8255,-1126021273,5121349134294840037,0.62340224,0.9058936980566197,䝐溲鿌瞖蔮릞苿㢗嶫쮧炠藮畺띯럣쟞٬ආ⿁㠫 +true,2,5,7,579584653,-39,-10080,1295793286,-5512594733186640333,0.2345826,0.5529858916888012,䒁櫃몶圉઱ꭂ輰鐏纸팝艵᝽⧍뿆䕧埇仩庈峊긁 +true,3,5,28,192413889,-84,-25602,-1399308161,-4999321731499002492,0.2202034,0.6453989782043966,笘츷琸私멮รᲨ䉘⫋틂㢆硵⌎ᵇ䱴ꄋ⾪ᗂ淹墚 +true,4,12,0,2034800013,23,-26202,1672890683,-3201068453518124906,0.10491228,0.29764615198420163,칻죫끧嚗ृ⠉鰨㾓砥爼Ɂ뒔稧႑ട戧둾傛䭠뎥 +true,3,0,23,1824726680,-23,19151,-976064148,-5866625933452838677,0.23397148,0.2567099989300493,⇔犪徢绕毜볛ፑ݋仞㸺ӹ煜樻䅌겗苮籴ᚽ䶜↶ +true,0,11,8,201318545,34,13460,-867274444,664269413064484815,0.745774,0.7662250808178842,恊ᤒ칗०艨靺狵큮džꆔ裳䣑茑ꠍⲕ彞㖍춴㧣ᑐ +true,2,7,26,665464125,21,21014,-1884637579,-7243505533089654587,0.0690732,0.9264561736443667,员蓨땀ʘ摓緅㍾鹻䶀ɳ꧟耪鸱밎尗㪓䭥螜猓䯨 +false,4,3,18,1477391018,-69,-6041,1505737882,-2932679718644882803,0.37644255,0.4616319718363274,᧿ỌÉ䊽▕㬠淬踥굡딦懔潨폝뱈᜔켙᮱⿐瑷万 +false,0,0,12,27536489,2,732,-150795199,6079111845833599979,0.46385628,0.11918711984988928,睏ꎸ조硼ಉ걁㾍湺滘꽴≳㰹겙⡁呌钴꺀㓳㺋있 +true,1,12,23,1457100270,103,-3980,-926882849,-4562545035019281250,0.4389583,0.06844656232765345,ᐱ랿팢ꀔ⥘ѹ먧ᦌ싃鳭뮊バ匟븲譬憸⡳뫂ṥ竃 +false,0,5,22,1783942973,-45,17637,1640723130,-1896563881960380322,0.43040425,0.2749355068497815,㞥칟抉⏨쾾蘠☝₴죖䔠┻筴揫꽿鼟踇噺⹒ꟸ麳 +false,2,4,12,1532666296,-35,8922,-176173288,-8955014781461314016,0.6307863,0.3274990362903428,㞚䛷攓眎愹퉝梋촖᦮鼻ꪩ麨ԗ늷ᡉꧦҾ邹俽ዣ +true,2,4,5,73962897,0,-17832,1634350374,6258605060818382676,0.031057596,0.5940351613053869,䮓訊傸쒪漬햫컠බ摖딯뀼헼醌샇ቀ맖睄佒閕㺼 +false,3,1,2,1207239595,-8,22197,1033891533,4788989286431932240,0.41694415,0.04790633102108133,잎犣캘⮝㖄ấꌮᴟ友Ǟ੼옯(䀒稐胧ᠭⰧ圭ꈁ +true,3,4,26,828547331,-105,-4767,833890130,1297637434204179010,0.26653832,0.26469010287736106,Ⳅჹ톋뎵䧆휒⥍歔㺈ꓨ✿꿍桶款쭭힧驵皐Ꮦ㷸 +false,1,6,14,744993075,42,-23091,-150042007,-3245065061820959388,0.54456913,0.9590753194830887,狢嗔콪᮫Λ쁈揭ʩ♏炙坕ⱃൺዖ쵇彔⨰鎑⸓曻 +false,2,4,16,792636561,123,-10251,-228136768,6946322014254064963,0.21435279,0.40973968548511475,텚價䭑昘࣓㬦쁄ꖋ쏿ḵ䈫軁㦽쌻摞ч㟄宠椎䏕 +true,4,6,5,1486287868,-116,-16678,-894187338,-5609981245581940964,0.5686012,0.7628660139787938,烾亼稒엾뙴襎㸒藗흶뺃ᡖ녳蟄禩휍曅䰣蚜ɛ犾 +true,0,6,4,1733761461,-68,-8682,1624375853,-8116302398722627489,0.95081633,0.9699169373953178,↹鶥䉩슧㵋㋟퇭戤✪ƺ瓁컨洄Ⰰ쓍맬槿ꭿ佔͎ +true,4,12,9,1779584435,-5,-8039,-516556536,-1182163242051036192,0.081951976,0.3054443670484893,趋፰xӗꀱ⫦㐞쮗ᒝ捂캍ؼݽ뒷씀⭅⽐⯳㕮⮃ +false,4,1,0,1725357266,54,13652,1397589747,8354763653702371440,0.15626663,0.11666006317601962,ꀺ碸싔ㆿ㫕젭톮ᵵ㳁脉똓ɩ⽆ㅕꕰᣖꏠ坨詓阂 diff --git a/rust/datafusion/test/data/all_types_flat.parquet b/rust/datafusion/test/data/all_types_flat.parquet new file mode 100644 index 0000000000000000000000000000000000000000..467a44299d1a0d525a3dfc6b248aa08f28d4cc19 GIT binary patch literal 29137 zcmZs>2Y3?MzdlYhQB>4elC`fbuDy2?PVBwA_FmSq?ykKTNFWeWAcb@SBtQzigq8sI z-g{eRU>Js(L8Gg?>bjf%;d_7g`QQ6IH_!9tJ;R*(Y3FkeESb7&R2(fXIc~<#I94<) z(c|bnxUW%leV zYc+Y?>m?;o%~ve@QI)&eG_ZfC=|k4dJ=xK5M7(<3`0WXOJ9p|bWL{VEtqa}9HK&i+ zt2)_Zd))qsH`k_(x!%=U-9O5^)d_Nqq;=4x$T0SBO}Mh*Tny zi>NRnx&M}0cUbNK5z&0JxLf~QT9GmThqNl98s#xld-JCXM)_p9?FR2L#=knTr|ih) zLreOOjnQ6Bo8O{Xw0ZNK9=9KLUv%c{<9_9R8GAnwnn_Fg>{@Z^q2<>LOXfZveyZ=t zdhOh0Z94xs+DuQ3ljJ1W&`Iy(HQE{d_VItK+*Kn(IIDgbQhHuFtupiX{<@;p$8!_D zwDXNhHkoGbnWOD9|HErb9DmWh>3?;6(eq*7v^mS1ty8=8Y_8wkdghBgTj5Grz2gMk z{->MJ`JUXfa51zlbjGL1(*H{kG*;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6xj{pCid2wA|Z*>el0&DGt+wZvT z*PeRjtM^`d`V#n*d*601_dfdvPuvTB<`15~{M^0IJoO*${o3W{E>)Gd?dH#{-?)vOqk3D|*iASHk>-_J&aMzQUzIJlynmd9^@BH+{IbFW= zBz*DY^G`f+>ES2fM~_{4;@Qiez3W}ecb$LXo8SEGbr#H;z z-+$_vliq%~9z1aW`xd|tUjFLkXFjxzbDw|T#uHCH`PC0);KUcd-~8bZI|^_6?)Te& z_(1>zf7dYp6Mv^6cxO*}|1RGC;zNz%+byo|#G_9=e=-X{)O3Kg{C*!`_CNk}j}q3y z&rj%o`^_6}`>l5t(&xVR%$;Aq{LHhDKlS9D_uc#8z4zbws}Dc__!E!b`N+91+<*TU zAAIoK{SRIK!b87)=?f2Be)x+IJ^01XKm5=a9y|BQ1CKp+-+hnWckYp2yWvK7bH{JP H%N+kN<+@qv literal 0 HcmV?d00001 diff --git a/rust/datafusion/test/data/alltypes_plain.parquet b/rust/datafusion/test/data/alltypes_plain.parquet new file mode 100755 index 0000000000000000000000000000000000000000..a63f5dca7c3821909748f34752966a0d7e08d47f GIT binary patch literal 1851 zcmb7F&ui0g6#pje+AM2l7<*qVv_zM;YQD;X!1G_`Ye@W}TbqmweOL$NPTX=lg!8G{0y<66Rp8 z2pS|Aqlfj;PSH-&mT4zwizU$p1|0Y`VGJoyS_YbwNId;`jBg|z+DN8!b`S=|Sr$Ee51+|8u<)E>*X#arx$Xz24Q}8O`6X`}Xhr%F1Zjm_hG6In z7b&rg?-Cs*15K~?$g4Hmpi6uSk7fKqck31Rd$NO@X;dxW?*`sZ;$!02EAVEj1Dx*0 z{MLuNloZ0uLp~A&5eQYhXi-eh3&y9k4#_aQs_m^t;cL8xuhMu#`94GW^Wlpd7r_2h zbWlRre%G&Crz3oz;A@fee~~T(>&n~(=)0;8>IvyeeZ%&hb^-l_Dsj zFvuM<3gd=3Zp;SqWJI2b$YdaF$o()3pD7?YQ98!mj1HO5|D}r6be0>LFTr05hN163Gw zN`^s(6x}&&X(N%RnM7u%??nSFr{~`PZ?MG}V6i6>#vU;kXJ%l`=Er#5j4|7?$M(UP z-GIH6Am3BD#zq&s>YC+S`G?MW!>iZw=2&6OxPE8h?#;!8`C@+5-thcNe#V-dsZ?y! oaow58so4p;;FgVPyFBeqnNHc9FdWl$-SX^Jc0`|z5`8xR0vs|-V*mgE literal 0 HcmV?d00001 diff --git a/rust/datafusion/test/data/null_test.csv b/rust/datafusion/test/data/null_test.csv new file mode 100644 index 000000000000..80830606563b --- /dev/null +++ b/rust/datafusion/test/data/null_test.csv @@ -0,0 +1,6 @@ +c_int,c_float,c_string,c_bool +1,1.1,"1.11",true +2,2.2,"2.22",true +3,,"3.33",true +4,4.4,,false +5,6.6,"",false \ No newline at end of file diff --git a/rust/datafusion/test/data/numerics.csv b/rust/datafusion/test/data/numerics.csv new file mode 100644 index 000000000000..910083c7e9b8 --- /dev/null +++ b/rust/datafusion/test/data/numerics.csv @@ -0,0 +1,4 @@ +a,b,a_f,b_f +2,3,3.14,-2.13 +5,5,3.0,3 +0,2,2.1,4.00 \ No newline at end of file diff --git a/rust/datafusion/test/data/people.csv b/rust/datafusion/test/data/people.csv new file mode 100644 index 000000000000..0594bbace7d1 --- /dev/null +++ b/rust/datafusion/test/data/people.csv @@ -0,0 +1,11 @@ +id,first_name +1,Andy +2,Brian +3,Chris +4,Donna +5,Edward +6,Fiona +7,Gary +8,Helen +9,Irene +10,Juliet \ No newline at end of file diff --git a/rust/datafusion/test/data/uk_cities.csv b/rust/datafusion/test/data/uk_cities.csv new file mode 100644 index 000000000000..db9e6da8c7af --- /dev/null +++ b/rust/datafusion/test/data/uk_cities.csv @@ -0,0 +1,37 @@ +"Elgin, Scotland, the UK",57.653484,-3.335724 +"Stoke-on-Trent, Staffordshire, the UK",53.002666,-2.179404 +"Solihull, Birmingham, UK",52.412811,-1.778197 +"Cardiff, Cardiff county, UK",51.481583,-3.179090 +"Eastbourne, East Sussex, UK",50.768036,0.290472 +"Oxford, Oxfordshire, UK",51.752022,-1.257677 +"London, UK",51.509865,-0.118092 +"Swindon, Swindon, UK",51.568535,-1.772232 +"Gravesend, Kent, UK",51.441883,0.370759 +"Northampton, Northamptonshire, UK",52.240479,-0.902656 +"Rugby, Warwickshire, UK",52.370876,-1.265032 +"Sutton Coldfield, West Midlands, UK",52.570385,-1.824042 +"Harlow, Essex, UK",51.772938,0.102310 +"Aberdeen, Aberdeen City, UK",57.149651,-2.099075 +"Swansea, Swansea, UK",51.621441,-3.943646 +"Chesterfield, Derbyshire, UK",53.235046,-1.421629 +"Londonderry, Derry, UK",55.006763,-7.318268 +"Salisbury, Wiltshire, UK",51.068787,-1.794472 +"Weymouth, Dorset, UK",50.614429,-2.457621 +"Wolverhampton, West Midlands, UK",52.591370,-2.110748 +"Preston, Lancashire, UK",53.765762,-2.692337 +"Bournemouth, UK",50.720806,-1.904755 +"Doncaster, South Yorkshire, UK",53.522820,-1.128462 +"Ayr, South Ayrshire, UK",55.458565,-4.629179 +"Hastings, East Sussex, UK",50.854259,0.573453 +"Bedford, UK",52.136436,-0.460739 +"Basildon, Essex, UK",51.572376,0.470009 +"Chippenham, Wiltshire, UK",51.458057,-2.116074 +"Belfast, UK",54.607868,-5.926437 +"Uckfield, East Sussex, UK",50.967941,0.085831 +"Worthing, West Sussex, UK",50.825024,-0.383835 +"Leeds, West Yorkshire, UK",53.801277,-1.548567 +"Kendal, Cumbria, UK",54.328506,-2.743870 +"Plymouth, UK",50.376289,-4.143841 +"Haverhill, Suffolk, UK",52.080875,0.444517 +"Frankton, Warwickshire, UK",52.328415,-1.377561 +"Inverness, the UK",57.477772,-4.224721 \ No newline at end of file diff --git a/rust/datafusion/test/data/uk_cities.parquet b/rust/datafusion/test/data/uk_cities.parquet new file mode 100644 index 0000000000000000000000000000000000000000..998cc86a6f781644e2ba4d9f9a7ae944373bfb5d GIT binary patch literal 1788 zcmbtVZ)_7~7{4oJ>qeV(qgPti$*s`E;;n3B-5)Z>`j+9=c3at~6>#F)-rM%v^=^Cb zj#0;=D3K2)iipaesQ3Xt_(d>kNDz8aqK0S;0*U$oBLpKL$qWf5k{I7Bn+)Rz67NIr zeee1G-sgFK&+|TwhlZOOiut;VnW^NM2w9df7LUuFl(Cu*YZP-kOO^mOa6mQ9h|lMqh| z=`p63T29MPX{stqY*-fgjDSRvbVgSO zX(5XGYbwrqprjy3l&LnN@(@%wN6LY)O}4K`I8|U?qntszgGU$_IFe#HmGHmgfTEzJ zG`iZF6hxJ2qos}{D&%EN&2j8{87s(Fzk(%)C1r6t!olU>5>?My;}|KvkUa*aG-Q(Y zDgpq$^R_LXMD!uDUN6%=2XRfJp|O?SEaT1u9XE#xjK>lxU?xtvefCIQhh5>EFg}i?-oq{BbVb-IW}ve0FPgI?(qoM|t5Lhr{d66b z40TzJ_VYV8AE)c=F@$)1IH-#Z0^7v_ph;T*_fr&{k43@rtx3SgHv=QAbHi~Ei*E#LuOaYX37q?;W}VC2 zv+BD3uLO4OOz2yu7U{PSUn#b2kLtw}`@3JcbEMeuO~~(vdCh`|aIg z@R@7HU-z6_yDnL#f5`9DXa4xOXdDTSUoF1hU#CCoEZ2L6IDNslw~7-Jdy8G({kq}! z&ea>I7apDI{w!avZ##NQU-{JsYZtzF<}_~qqWJ3JRr=$HcIzkKywZJRAf$_J%jC9>y~3#E7Eg<4=?G`31z(<+{IJ<`WN8 z%_mCPdBg)%gm_<><`JEjoX!a4_PG2q&IaH(B&q~T0tJ)_F+h}>(2yFy@?;>7RLDaW zy1t{QylP<_dDnOq6>DkL%Xv#g%B0&%;;=FUG zde=-%PjmmUN$&T^8Bs26ACy~iH0$_*xTDjQtA94v#yn=p#Z?3{V4DLSffn}RlqQHg zn{ErXw6u40w6%1iU}qByu12Z$&W`rhRA(^LmR_C7G&g6O+tPk2OKKS>|9gJ}UJVyh literal 0 HcmV?d00001 diff --git a/rust/datafusion/tests/sql.rs b/rust/datafusion/tests/sql.rs new file mode 100644 index 000000000000..64eb46c4e2bf --- /dev/null +++ b/rust/datafusion/tests/sql.rs @@ -0,0 +1,151 @@ +// 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::cell::RefCell; +use std::rc::Rc; +use std::sync::Arc; + +extern crate arrow; +extern crate datafusion; + +use arrow::array::*; +use arrow::datatypes::{DataType, Field, Schema}; + +use datafusion::execution::context::ExecutionContext; +use datafusion::execution::datasource::CsvDataSource; +use datafusion::execution::relation::Relation; + +#[test] +fn csv_query_with_predicate() { + let mut ctx = ExecutionContext::new(); + register_cities_csv(&mut ctx); + let sql = + "SELECT city, lat, lng, lat + lng FROM cities WHERE lat > 51.0 AND lat < 53"; + let actual = execute(&mut ctx, sql); + let expected= "\"Solihull, Birmingham, UK\"\t52.412811\t-1.778197\t50.634614\n\"Cardiff, Cardiff county, UK\"\t51.481583\t-3.17909\t48.302493\n\"Oxford, Oxfordshire, UK\"\t51.752022\t-1.257677\t50.494344999999996\n\"London, UK\"\t51.509865\t-0.118092\t51.391773\n\"Swindon, Swindon, UK\"\t51.568535\t-1.772232\t49.796302999999995\n\"Gravesend, Kent, UK\"\t51.441883\t0.370759\t51.812642\n\"Northampton, Northamptonshire, UK\"\t52.240479\t-0.902656\t51.337823\n\"Rugby, Warwickshire, UK\"\t52.370876\t-1.265032\t51.105844000000005\n\"Sutton Coldfield, West Midlands, UK\"\t52.570385\t-1.824042\t50.746343\n\"Harlow, Essex, UK\"\t51.772938\t0.10231\t51.875248000000006\n\"Swansea, Swansea, UK\"\t51.621441\t-3.943646\t47.677794999999996\n\"Salisbury, Wiltshire, UK\"\t51.068787\t-1.794472\t49.274315\n\"Wolverhampton, West Midlands, UK\"\t52.59137\t-2.110748\t50.480622\n\"Bedford, UK\"\t52.136436\t-0.460739\t51.67569700000001\n\"Basildon, Essex, UK\"\t51.572376\t0.470009\t52.042384999999996\n\"Chippenham, Wiltshire, UK\"\t51.458057\t-2.116074\t49.341983\n\"Haverhill, Suffolk, UK\"\t52.080875\t0.444517\t52.525392\n\"Frankton, Warwickshire, UK\"\t52.328415\t-1.377561\t50.950854\n".to_string(); + assert_eq!(expected, actual); +} + +#[test] +fn csv_query_group_by_int_min_max() { + let mut ctx = ExecutionContext::new(); + let schema = Arc::new(Schema::new(vec![ + Field::new("a", DataType::Int32, false), + Field::new("b", DataType::Float64, false), + ])); + register_csv(&mut ctx, "t1", "test/data/aggregate_test_1.csv", &schema); + //TODO add ORDER BY once supported, to make this test determistic + let sql = "SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a"; + let actual = execute(&mut ctx, sql); + let expected = "2\t3.3\t5.5\n3\t1.0\t2.0\n1\t1.1\t2.2\n".to_string(); + assert_eq!(expected, actual); +} + +#[test] +fn csv_query_group_by_string_min_max() { + let mut ctx = ExecutionContext::new(); + let schema = Arc::new(Schema::new(vec![ + Field::new("a", DataType::Utf8, false), + Field::new("b", DataType::Float64, false), + ])); + register_csv(&mut ctx, "t1", "test/data/aggregate_test_2.csv", &schema); + //TODO add ORDER BY once supported, to make this test determistic + let sql = "SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a"; + let actual = execute(&mut ctx, sql); + let expected = + "\"three\"\t1.0\t2.0\n\"two\"\t3.3\t5.5\n\"one\"\t1.1\t2.2\n".to_string(); + assert_eq!(expected, actual); +} + +#[test] +fn csv_query_cast() { + let mut ctx = ExecutionContext::new(); + register_cities_csv(&mut ctx); + let sql = "SELECT CAST(lat AS int) FROM cities"; + let actual = execute(&mut ctx, sql); + let expected= "53\n52\n51\n50\n51\n51\n51\n51\n52\n52\n52\n51\n57\n51\n53\n55\n51\n50\n52\n53\n50\n53\n55\n50\n52\n51\n51\n54\n50\n50\n53\n54\n50\n52\n52\n57\n".to_string(); + assert_eq!(expected, actual); +} + +fn register_cities_csv(ctx: &mut ExecutionContext) { + let schema = Arc::new(Schema::new(vec![ + Field::new("city", DataType::Utf8, false), + Field::new("lat", DataType::Float64, false), + Field::new("lng", DataType::Float64, false), + ])); + + register_csv(ctx, "cities", "test/data/uk_cities.csv", &schema); +} + +fn register_csv( + ctx: &mut ExecutionContext, + name: &str, + filename: &str, + schema: &Arc, +) { + let csv_datasource = CsvDataSource::new(filename, schema.clone(), 1024); + ctx.register_datasource(name, Rc::new(RefCell::new(csv_datasource))); +} + +/// Execute query and return result set as tab delimited string +fn execute(ctx: &mut ExecutionContext, sql: &str) -> String { + let results = ctx.sql(&sql).unwrap(); + result_str(&results) +} + +fn result_str(results: &Rc>) -> String { + let mut relation = results.borrow_mut(); + let mut str = String::new(); + while let Some(batch) = relation.next().unwrap() { + for row_index in 0..batch.num_rows() { + for column_index in 0..batch.num_columns() { + if column_index > 0 { + str.push_str("\t"); + } + let column = batch.column(column_index); + + match column.data_type() { + DataType::Int32 => { + let array = column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } + DataType::Float32 => { + let array = + column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } + DataType::Float64 => { + let array = + column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } + DataType::Utf8 => { + let array = + column.as_any().downcast_ref::().unwrap(); + let s = + String::from_utf8(array.value(row_index).to_vec()).unwrap(); + + str.push_str(&format!("{:?}", s)); + } + _ => str.push_str("???"), + } + } + str.push_str("\n"); + } + } + str +} From 28d914a2efe157d1f097c1a66282c83d93e12c32 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Fri, 1 Feb 2019 17:32:01 -0700 Subject: [PATCH 02/12] Update 00-prepare.sh to handle datafusion versioning --- dev/release/00-prepare.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/release/00-prepare.sh b/dev/release/00-prepare.sh index bfcfc8382549..90d318145ca0 100755 --- a/dev/release/00-prepare.sh +++ b/dev/release/00-prepare.sh @@ -100,9 +100,9 @@ update_versions() { cd "${SOURCE_DIR}/../../rust" sed -i.bak -E -e \ "s/^version = \".+\"/version = \"${version}\"/g" \ - arrow/Cargo.toml parquet/Cargo.toml - rm -f arrow/Cargo.toml.bak parquet/Cargo.toml.bak - git add arrow/Cargo.toml parquet/Cargo.toml + arrow/Cargo.toml parquet/Cargo.toml datafusion/Cargo.toml + rm -f arrow/Cargo.toml.bak parquet/Cargo.toml.bak datafusion/Cargo.toml.bak + git add arrow/Cargo.toml parquet/Cargo.toml datafusion/Cargo.toml # Update version number for parquet README sed -i.bak -E -e \ From f60e50d9ff8c9451b9b11160f7600fd443d3ddd8 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Fri, 1 Feb 2019 17:42:28 -0700 Subject: [PATCH 03/12] remove unused test data files, manually recreate uk_cities.csv because I can't trace where the original data came from --- rust/datafusion/src/execution/aggregate.rs | 4 +- .../test/data/all_types_flat.parquet | Bin 29137 -> 0 bytes .../test/data/alltypes_plain.parquet | Bin 1851 -> 0 bytes rust/datafusion/test/data/uk_cities.csv | 40 ++---------------- rust/datafusion/test/data/uk_cities.parquet | Bin 1788 -> 0 bytes rust/datafusion/tests/sql.rs | 4 +- 6 files changed, 7 insertions(+), 41 deletions(-) delete mode 100644 rust/datafusion/test/data/all_types_flat.parquet delete mode 100755 rust/datafusion/test/data/alltypes_plain.parquet delete mode 100644 rust/datafusion/test/data/uk_cities.parquet diff --git a/rust/datafusion/src/execution/aggregate.rs b/rust/datafusion/src/execution/aggregate.rs index 328210407a01..5a77c8a055c7 100644 --- a/rust/datafusion/src/execution/aggregate.rs +++ b/rust/datafusion/src/execution/aggregate.rs @@ -1051,7 +1051,7 @@ mod tests { .as_any() .downcast_ref::() .unwrap(); - assert_eq!(50.376289, min_lat.value(0)); + assert_eq!(51.507222, min_lat.value(0)); } #[test] @@ -1086,7 +1086,7 @@ mod tests { .as_any() .downcast_ref::() .unwrap(); - assert_eq!(57.477772, max_lat.value(0)); + assert_eq!(53.479444, max_lat.value(0)); } #[test] diff --git a/rust/datafusion/test/data/all_types_flat.parquet b/rust/datafusion/test/data/all_types_flat.parquet deleted file mode 100644 index 467a44299d1a0d525a3dfc6b248aa08f28d4cc19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29137 zcmZs>2Y3?MzdlYhQB>4elC`fbuDy2?PVBwA_FmSq?ykKTNFWeWAcb@SBtQzigq8sI z-g{eRU>Js(L8Gg?>bjf%;d_7g`QQ6IH_!9tJ;R*(Y3FkeESb7&R2(fXIc~<#I94<) z(c|bnxUW%leV zYc+Y?>m?;o%~ve@QI)&eG_ZfC=|k4dJ=xK5M7(<3`0WXOJ9p|bWL{VEtqa}9HK&i+ zt2)_Zd))qsH`k_(x!%=U-9O5^)d_Nqq;=4x$T0SBO}Mh*Tny zi>NRnx&M}0cUbNK5z&0JxLf~QT9GmThqNl98s#xld-JCXM)_p9?FR2L#=knTr|ih) zLreOOjnQ6Bo8O{Xw0ZNK9=9KLUv%c{<9_9R8GAnwnn_Fg>{@Z^q2<>LOXfZveyZ=t zdhOh0Z94xs+DuQ3ljJ1W&`Iy(HQE{d_VItK+*Kn(IIDgbQhHuFtupiX{<@;p$8!_D zwDXNhHkoGbnWOD9|HErb9DmWh>3?;6(eq*7v^mS1ty8=8Y_8wkdghBgTj5Grz2gMk z{->MJ`JUXfa51zlbjGL1(*H{kG*;};MBj{ck>_8DrHm*#gZu2lNJyU(AN7TF+y62d zQsezs+aUR)uaAkM)00pC5z~d?iyE>tDwd(b_OFGnM8Dph49OJV>@1{~pkFMkSkZiK zOmD{TWup#8#nOAVejk&}czN~jUa-~I2bl|CJ$iET8A$&$+qDzY$q%eOkW$J{{R(M$ zhu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8SEGbr#H;z z-+$_vliq%~9z1aW`xd|tUjFLkXFjxzbDw|T#uHCH`PC0);KUcd-~8bZI|^_6?)Te& z_(1>zf7dYp6Mv^6cxO*}|1RGC;zNz%+byo|#G_9=e=-X{)O3Kg{C*!`_CNk}j}q3y z&rj%o`^_6}`>l5t(&xVR%$;Aq{LHhDKlS9D_uc#8z4zbws}Dc__!E!b`N+91+<*TU zAAIoK{SRIK!b87)=?f2Be)x+IJ^01XKm5=a9y|BQ1CKp+-+hnWckYp2yWvK7bH{JP H%N+kN<+@qv diff --git a/rust/datafusion/test/data/alltypes_plain.parquet b/rust/datafusion/test/data/alltypes_plain.parquet deleted file mode 100755 index a63f5dca7c3821909748f34752966a0d7e08d47f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1851 zcmb7F&ui0g6#pje+AM2l7<*qVv_zM;YQD;X!1G_`Ye@W}TbqmweOL$NPTX=lg!8G{0y<66Rp8 z2pS|Aqlfj;PSH-&mT4zwizU$p1|0Y`VGJoyS_YbwNId;`jBg|z+DN8!b`S=|Sr$Ee51+|8u<)E>*X#arx$Xz24Q}8O`6X`}Xhr%F1Zjm_hG6In z7b&rg?-Cs*15K~?$g4Hmpi6uSk7fKqck31Rd$NO@X;dxW?*`sZ;$!02EAVEj1Dx*0 z{MLuNloZ0uLp~A&5eQYhXi-eh3&y9k4#_aQs_m^t;cL8xuhMu#`94GW^Wlpd7r_2h zbWlRre%G&Crz3oz;A@fee~~T(>&n~(=)0;8>IvyeeZ%&hb^-l_Dsj zFvuM<3gd=3Zp;SqWJI2b$YdaF$o()3pD7?YQ98!mj1HO5|D}r6be0>LFTr05hN163Gw zN`^s(6x}&&X(N%RnM7u%??nSFr{~`PZ?MG}V6i6>#vU;kXJ%l`=Er#5j4|7?$M(UP z-GIH6Am3BD#zq&s>YC+S`G?MW!>iZw=2&6OxPE8h?#;!8`C@+5-thcNe#V-dsZ?y! oaow58so4p;;FgVPyFBeqnNHc9FdWl$-SX^Jc0`|z5`8xR0vs|-V*mgE diff --git a/rust/datafusion/test/data/uk_cities.csv b/rust/datafusion/test/data/uk_cities.csv index db9e6da8c7af..1dceb220cde0 100644 --- a/rust/datafusion/test/data/uk_cities.csv +++ b/rust/datafusion/test/data/uk_cities.csv @@ -1,37 +1,3 @@ -"Elgin, Scotland, the UK",57.653484,-3.335724 -"Stoke-on-Trent, Staffordshire, the UK",53.002666,-2.179404 -"Solihull, Birmingham, UK",52.412811,-1.778197 -"Cardiff, Cardiff county, UK",51.481583,-3.179090 -"Eastbourne, East Sussex, UK",50.768036,0.290472 -"Oxford, Oxfordshire, UK",51.752022,-1.257677 -"London, UK",51.509865,-0.118092 -"Swindon, Swindon, UK",51.568535,-1.772232 -"Gravesend, Kent, UK",51.441883,0.370759 -"Northampton, Northamptonshire, UK",52.240479,-0.902656 -"Rugby, Warwickshire, UK",52.370876,-1.265032 -"Sutton Coldfield, West Midlands, UK",52.570385,-1.824042 -"Harlow, Essex, UK",51.772938,0.102310 -"Aberdeen, Aberdeen City, UK",57.149651,-2.099075 -"Swansea, Swansea, UK",51.621441,-3.943646 -"Chesterfield, Derbyshire, UK",53.235046,-1.421629 -"Londonderry, Derry, UK",55.006763,-7.318268 -"Salisbury, Wiltshire, UK",51.068787,-1.794472 -"Weymouth, Dorset, UK",50.614429,-2.457621 -"Wolverhampton, West Midlands, UK",52.591370,-2.110748 -"Preston, Lancashire, UK",53.765762,-2.692337 -"Bournemouth, UK",50.720806,-1.904755 -"Doncaster, South Yorkshire, UK",53.522820,-1.128462 -"Ayr, South Ayrshire, UK",55.458565,-4.629179 -"Hastings, East Sussex, UK",50.854259,0.573453 -"Bedford, UK",52.136436,-0.460739 -"Basildon, Essex, UK",51.572376,0.470009 -"Chippenham, Wiltshire, UK",51.458057,-2.116074 -"Belfast, UK",54.607868,-5.926437 -"Uckfield, East Sussex, UK",50.967941,0.085831 -"Worthing, West Sussex, UK",50.825024,-0.383835 -"Leeds, West Yorkshire, UK",53.801277,-1.548567 -"Kendal, Cumbria, UK",54.328506,-2.743870 -"Plymouth, UK",50.376289,-4.143841 -"Haverhill, Suffolk, UK",52.080875,0.444517 -"Frankton, Warwickshire, UK",52.328415,-1.377561 -"Inverness, the UK",57.477772,-4.224721 \ No newline at end of file +City,Lat,Lon +"London, UK",51.507222,-0.1275 +"Manchester, UK",53.479444,-2.245278 diff --git a/rust/datafusion/test/data/uk_cities.parquet b/rust/datafusion/test/data/uk_cities.parquet deleted file mode 100644 index 998cc86a6f781644e2ba4d9f9a7ae944373bfb5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1788 zcmbtVZ)_7~7{4oJ>qeV(qgPti$*s`E;;n3B-5)Z>`j+9=c3at~6>#F)-rM%v^=^Cb zj#0;=D3K2)iipaesQ3Xt_(d>kNDz8aqK0S;0*U$oBLpKL$qWf5k{I7Bn+)Rz67NIr zeee1G-sgFK&+|TwhlZOOiut;VnW^NM2w9df7LUuFl(Cu*YZP-kOO^mOa6mQ9h|lMqh| z=`p63T29MPX{stqY*-fgjDSRvbVgSO zX(5XGYbwrqprjy3l&LnN@(@%wN6LY)O}4K`I8|U?qntszgGU$_IFe#HmGHmgfTEzJ zG`iZF6hxJ2qos}{D&%EN&2j8{87s(Fzk(%)C1r6t!olU>5>?My;}|KvkUa*aG-Q(Y zDgpq$^R_LXMD!uDUN6%=2XRfJp|O?SEaT1u9XE#xjK>lxU?xtvefCIQhh5>EFg}i?-oq{BbVb-IW}ve0FPgI?(qoM|t5Lhr{d66b z40TzJ_VYV8AE)c=F@$)1IH-#Z0^7v_ph;T*_fr&{k43@rtx3SgHv=QAbHi~Ei*E#LuOaYX37q?;W}VC2 zv+BD3uLO4OOz2yu7U{PSUn#b2kLtw}`@3JcbEMeuO~~(vdCh`|aIg z@R@7HU-z6_yDnL#f5`9DXa4xOXdDTSUoF1hU#CCoEZ2L6IDNslw~7-Jdy8G({kq}! z&ea>I7apDI{w!avZ##NQU-{JsYZtzF<}_~qqWJ3JRr=$HcIzkKywZJRAf$_J%jC9>y~3#E7Eg<4=?G`31z(<+{IJ<`WN8 z%_mCPdBg)%gm_<><`JEjoX!a4_PG2q&IaH(B&q~T0tJ)_F+h}>(2yFy@?;>7RLDaW zy1t{QylP<_dDnOq6>DkL%Xv#g%B0&%;;=FUG zde=-%PjmmUN$&T^8Bs26ACy~iH0$_*xTDjQtA94v#yn=p#Z?3{V4DLSffn}RlqQHg zn{ErXw6u40w6%1iU}qByu12Z$&W`rhRA(^LmR_C7G&g6O+tPk2OKKS>|9gJ}UJVyh diff --git a/rust/datafusion/tests/sql.rs b/rust/datafusion/tests/sql.rs index 64eb46c4e2bf..2e809c815378 100644 --- a/rust/datafusion/tests/sql.rs +++ b/rust/datafusion/tests/sql.rs @@ -36,7 +36,7 @@ fn csv_query_with_predicate() { let sql = "SELECT city, lat, lng, lat + lng FROM cities WHERE lat > 51.0 AND lat < 53"; let actual = execute(&mut ctx, sql); - let expected= "\"Solihull, Birmingham, UK\"\t52.412811\t-1.778197\t50.634614\n\"Cardiff, Cardiff county, UK\"\t51.481583\t-3.17909\t48.302493\n\"Oxford, Oxfordshire, UK\"\t51.752022\t-1.257677\t50.494344999999996\n\"London, UK\"\t51.509865\t-0.118092\t51.391773\n\"Swindon, Swindon, UK\"\t51.568535\t-1.772232\t49.796302999999995\n\"Gravesend, Kent, UK\"\t51.441883\t0.370759\t51.812642\n\"Northampton, Northamptonshire, UK\"\t52.240479\t-0.902656\t51.337823\n\"Rugby, Warwickshire, UK\"\t52.370876\t-1.265032\t51.105844000000005\n\"Sutton Coldfield, West Midlands, UK\"\t52.570385\t-1.824042\t50.746343\n\"Harlow, Essex, UK\"\t51.772938\t0.10231\t51.875248000000006\n\"Swansea, Swansea, UK\"\t51.621441\t-3.943646\t47.677794999999996\n\"Salisbury, Wiltshire, UK\"\t51.068787\t-1.794472\t49.274315\n\"Wolverhampton, West Midlands, UK\"\t52.59137\t-2.110748\t50.480622\n\"Bedford, UK\"\t52.136436\t-0.460739\t51.67569700000001\n\"Basildon, Essex, UK\"\t51.572376\t0.470009\t52.042384999999996\n\"Chippenham, Wiltshire, UK\"\t51.458057\t-2.116074\t49.341983\n\"Haverhill, Suffolk, UK\"\t52.080875\t0.444517\t52.525392\n\"Frankton, Warwickshire, UK\"\t52.328415\t-1.377561\t50.950854\n".to_string(); + let expected= "\"London, UK\"\t51.507222\t-0.1275\t51.379722\n".to_string(); assert_eq!(expected, actual); } @@ -77,7 +77,7 @@ fn csv_query_cast() { register_cities_csv(&mut ctx); let sql = "SELECT CAST(lat AS int) FROM cities"; let actual = execute(&mut ctx, sql); - let expected= "53\n52\n51\n50\n51\n51\n51\n51\n52\n52\n52\n51\n57\n51\n53\n55\n51\n50\n52\n53\n50\n53\n55\n50\n52\n51\n51\n54\n50\n50\n53\n54\n50\n52\n52\n57\n".to_string(); + let expected= "51\n53\n".to_string(); assert_eq!(expected, actual); } From 061d788b59d52d5cef35faeacef359ff8f10e12a Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Sat, 2 Feb 2019 08:24:31 -0700 Subject: [PATCH 04/12] remove unused test data files --- rust/datafusion/test/data/all_types.csv | 3 - rust/datafusion/test/data/all_types_flat.csv | 257 ------------------- rust/datafusion/test/data/null_test.csv | 6 - rust/datafusion/test/data/numerics.csv | 4 - 4 files changed, 270 deletions(-) delete mode 100644 rust/datafusion/test/data/all_types.csv delete mode 100644 rust/datafusion/test/data/all_types_flat.csv delete mode 100644 rust/datafusion/test/data/null_test.csv delete mode 100644 rust/datafusion/test/data/numerics.csv diff --git a/rust/datafusion/test/data/all_types.csv b/rust/datafusion/test/data/all_types.csv deleted file mode 100644 index 3b2eb00baa06..000000000000 --- a/rust/datafusion/test/data/all_types.csv +++ /dev/null @@ -1,3 +0,0 @@ -c_int,c_float,c_string -1,1.1,"1.11" -2,2.2,"2.22" \ No newline at end of file diff --git a/rust/datafusion/test/data/all_types_flat.csv b/rust/datafusion/test/data/all_types_flat.csv deleted file mode 100644 index 5a6b607263d6..000000000000 --- a/rust/datafusion/test/data/all_types_flat.csv +++ /dev/null @@ -1,257 +0,0 @@ -false,2,3,13,1531241020,-60,-1596,1234231326,-3707023917728695883,0.35193855,0.24829962755879142,⍕趧쨻鬛溮ꠃ铊숎戳뺘蛮봔큖潛叐桕୉촸駲쿦 -false,4,9,19,206695022,74,-18088,1508731446,-7958412917705956932,0.7267874,0.2375179592454354,섦藑⼿㊳㠪봰鼔Ễꈈ壮࿉만餈䴐핫⢤휙崭粌猡 -false,0,7,20,818075781,57,-23777,-1121737404,3923416169952057646,0.91558653,0.4981203861148582,햷㫼釭燇⍱냃ጆ㱔伛립⺗Ჱ抰单Ⰿ㚎의綎⾘㷤 -false,1,6,15,584334584,-61,13870,164409925,-9153360329814749238,0.51842016,0.29422932552059233,벋罴个뗒팕鑗氺✒䭑툟෾胑厹姼悪ᮞ貝췤ࣔ▋ -false,4,12,10,1088152525,-27,-26421,-879181593,8925632445420578596,0.358496,0.17348140475392826,⎷鵷芝ⱆ鎍ꂻ〽ꆲ꒧㌴먣⣨淼燊땗耶誂鰹珐窚 -false,0,1,28,1675416048,-78,19157,1570913558,-1539534406690282878,0.6369339,0.501613048032352,衸貕ῠఃꠌ讟ꏉ坟豁ຕ虮拍誕冊龆崷般垿郊ᑥ -false,2,5,12,868812003,-37,-17933,-1373926101,8842876120447285340,0.16038722,0.9848153564240777,┙睴ㆿᑳ羇⪱猿죝랭᮪⨧ꊢ葻ᖬげ뫯㗲擞ݽ㚇 -false,3,3,12,1089699136,42,27606,984961643,6569147229399117619,0.5143737,0.263043606194834,觊ʑŶğ⅊頨븑⥘ࡾ貀퐅톧풺꠷䌱ᯙꆠ쥡佂䭘 -true,4,11,20,1361773026,-89,1081,-1629763360,-8012109879546454244,0.81791216,0.5429001544619461,첆凭造ꘫ穿䑛닯㕈偃㯣㫚㧢汵樊╛⻛䬁޿鞿뽺 -false,1,1,18,1517414054,-51,25205,702694219,-391842732204935620,0.62861645,0.5096163904352368,뷀妘Ꮤ鶑식啥ᢺち㊹藀䗀널懵褏䥯᪪筽䠵齗蓏 -true,2,7,26,986672784,-93,-207,497049627,-796714470026579345,0.9637603,0.14779665189566116,◴䒨픏敼깡袸鱪鲤駖奵㭰䘭阯夏௿☥獹웖鄞؏ -true,1,1,28,2130843314,-34,-32096,-869481407,143228945056456631,0.6729386,0.1880123385211735,䮾鹀纑䑓넕뛛آ㛚ạ虗眱䰏컛Ꝋ炴姖閛韫ᇯ嘎 -true,1,3,9,270745351,51,18860,-9255144,-4164310042088722601,0.5022637,0.2592869241443291,痫捄얷菚뮳닏扩䣧부ꊸ삾ި尀ቈ罀믊倶䜪泚 -true,4,6,18,1515848610,-109,19355,-212839128,20701021643807815,0.7171558,0.5121134304724516,㷗澈᾵뾥뤄㊲ฑ綍퍭䑸ְꞮ䋨੔텲匲擣競鿥疽 -true,3,8,26,1932631261,70,-23786,-1804138479,-6252303781092136744,0.56148523,0.8102583970068632,魗毈旐쑮섷鄑篴Ꮄ靟놜붆칗鄓碒媐ꏌ宯䠎䭨븘 -false,1,3,28,1089538590,7,2090,-1539182058,1056716721061520581,0.7738669,0.33625578665565203,譻㺠慖꜡঺툓䤼⫯ᾟ长ᴕ籡蔫癝縯噳峼뛬䃼냛 -true,1,8,2,519817179,-54,4207,85696742,-6585487401183055348,0.13161778,0.3765691217587185,봹瓡┓◎妤扭৮牚댰ᒃ䟆␨㴲鑜y៲읳礇궘⟳ -true,1,6,7,1284297466,71,7947,-926560209,2355616434385030368,0.029641032,0.08748462506515176,൤筹뫓䍃ⶬ譓滄⇼窄흀쇲扴캄蕾ㄒ宦㵬클瓱郋 -true,1,8,0,2118139912,-5,-7250,211059659,6535067329646013840,0.29698944,0.9060969102791906,⑎㘞긁ㅯ囅䊿ఞ늬쯘ᡃ婺㽔⏏ቄ楹繅径ꌱ㩐刓 -true,1,9,5,1734869757,61,6900,1555964510,1419282613021825007,0.4986608,0.10782045437731824,䶲ڤ칛㷐쳨섙峣鑌꿁꒠Ȋ竾耒ᜡ쿚㜄᫁Ͷ߳≢ -false,3,8,19,1786835579,-83,17805,-517239196,-4146065602579576811,0.4512084,0.8663958325385142,䣼寊ᓗ㌶Ľ隶춀ꩇ휪盟쇽㠟똝隽앴؝┕ຐ졜ᴠ -false,0,2,21,1853660290,-111,-28298,1141579081,4443132472147709052,0.6613548,0.5910969431428907,曱贲렘危鏍䠾텊딤江፺圄잿歙ꜝ蒚휸␴챲꤃鿹 -true,2,11,7,1617498451,3,-17142,346465510,624487320592771035,0.44425493,0.9987703202471936,恺ퟩ唷ᵫ辇뛟䟮虸㵲貵毆驿햽嗸䴥駇邶ெ坟刍 -false,2,11,3,1344241364,-70,2684,131563263,6621485749046145630,0.48962414,0.6548679910576786,浵ꘗ帤ᒏ킞꼯䋒ᷙ볃饌ꅈ春ꨕ촫ҩ䔘춈桽徴៘ -false,2,6,2,311526785,60,-8919,-1822497989,-8094366414051042988,0.7012702,0.3485618824317698,"靊呣ួ漬쫶卟懡罾࠙뾳ᔭ뺣싩削 -й⇤Ꮇᆰㄡ" -true,2,1,15,1045609427,-52,28213,-1147990479,4018628870944688215,0.58028233,0.9719428637234058,䮳殾ᗒ揿岇㌺硧䷼滞ᜤኬ딎ᬺ睯✲ㅩ쳪੫싲蔺 -false,2,2,18,1255733166,107,4274,-1962535867,-4906431753521378993,0.67805874,0.7457059463748047,싺暈曷ꐣ잦솶폸嵱⽯໿죍ꠍ闛뻄波匝醊譬둷 -true,4,12,5,483321637,-49,23978,-176052757,-1152680452773224056,0.45312655,0.5279233199598208,죩촗䣙綡羓斶렶鐚爅賗漂ᒳ茇媛穴䫬妚࡬짍馦 -true,4,1,18,174520530,97,15628,-1711315035,2994687010251554643,0.95071757,0.1779888254873827,゙춊벉터᯼蜟䀦䋍䓀泉鰯㼙겡ᆍ✤ୈᦱᥕ뺥㶯 -false,4,6,23,28029682,-100,-15788,1606534704,-5154175125068656566,0.59714806,0.6984254061219464,㬋Ǣ澒遌愚双箭ゐᝩ疆ؓ劮緽卙捅岓ᠹ짳뱜엍 -false,2,10,14,1049003644,16,-1960,1428177081,164642702238865172,0.25761652,0.6396288470398015,Ĵ㭮慰ꌧ靵碉鴕₻镊䯊鄸넼覆⎈榓揦郠竤損ჸ -false,2,4,21,265370207,-104,-7315,-227928338,5355321136858340128,0.76446146,0.9569563272783185,់骧곑⡦ɖ඿ຨ읷쓭찮渞쐹㖕䶊㪉ꅘାగ䶽좿 -false,0,8,23,998526696,46,9342,-944863825,-2209107919116321238,0.016121447,0.057659034649668706,瘕許速괋䚙ģ˿쏙肨꺏᡽䴂৵宒ꭂ熋ⶳ洪䆹䭀 -true,0,12,24,1476204031,-61,-1070,466035216,-7679277413407079967,0.76205754,0.02795727978930862,騫榵垮䢏ণሬ团㢱灸뾻䱣傇藗䘅Ⲣ럀ታ勖⇋魵 -false,0,0,26,883035612,-29,14287,-1623843875,5394994146196081516,0.83667356,0.4732095210027568,ᷠ㭭੽䒩䮅閁Ҳ兯Ꮄ羇鎽쟇⚥뀎뇊㍽띁뷌䱳㮗 -true,4,0,26,1329614038,-14,-20058,-1902144824,-3906417007632767922,0.04562819,0.2921431977782333,롨늃㛠饌ৢȮ㏢䈫⋃宥㶏‘䬫逻헟跆쀎뜷괥⚄ -false,3,7,25,1261465891,-60,9562,-730280258,363962205986566052,0.6499184,0.22428236737824025,梋᣿랶⢱쿕化慳ؑ唽ꖾs贬휡僿䔵캝꒳ᓹ齮싓 -false,3,5,20,657415491,52,-32474,-624438455,6729598730405181612,0.18841183,0.7013442366533913,쿛吘ᭉ卪ⅾ㑯縡鎮렅腶謐⎽娠瓲ṏ蘩䫟硠㌎⹄ -false,0,6,16,694557375,109,570,1178519874,5910019470167397237,0.30245435,0.3282605064249652,뾜첉ꄇન鄧ᅇ犤⇕ꍞ责테␨㣍★⛐ん苶蛇湀鬏 -false,0,5,4,1503653029,-84,13893,-215433347,5780921237045002271,0.94893974,0.3805155918372052,⑻錝鉷䛡ॣ㜹킮갳딹⿻腒ჵ࠮ᡩ祾븿퇍儅돺ᨴ -false,1,6,18,152873783,118,604,-1930125995,-7954139520243645276,0.33012044,0.857483012880279,橗霖吞騆ᰕ棛⭫簹挥打യ欟῜툫墑䎰䓀斾ꦘּ -true,1,9,6,1321790172,104,-31483,490185344,-2142068600586430508,0.9912891,0.6990022692847451,❉껄಼뤩췫徶觇䝞Σ꯲锶蓅Πག捧ဋ뜷䉭뺦콤 -true,4,5,19,1287225845,-107,-31097,1762894796,3323691255778749741,0.15909088,0.9628895636174963,ϧさ䭥✕೚䥀쾋쑐鑫⋕䂺〥틜붥惻鄲앙๋䧇곊 -false,1,1,22,1088009139,-3,-16719,-2069387796,-9136614041513084610,0.49108446,0.4171152142888477,촼㡂恇ᛐ৺賽袤앉ꧬ㢝갸တ帢Ǎ靭虌ℿ曓蓫⌦ -false,3,11,10,1754701450,46,-31044,-783427820,-5846744023232872251,0.11973965,0.5855272636174155,蓤摺同䰿Ǝ㺓ോꢏ띱㼹຃編陬凫垓撒籮ᖨਸ਼鈀 -true,2,7,15,1092923336,-16,6754,1931644210,8423434239078433009,0.7775541,0.2714871256536533,䗞毨돪ࠋꝺ륭㙱努Ʉ㏣৵氢졚ⷓꥸ祈뫟眜籵듒 -true,4,8,10,498455696,-96,-2274,-1190838950,6913488027442637238,0.64277047,0.6277049685488401,淯谹휵텓鴷뭭㹱蕊ꔏ㝸廏롫䋐큷⏳ⰺ㱞鯚踒∆ -true,3,3,25,1213693592,54,6509,-1294672738,1541550608598153956,0.23732436,0.337610267576799,ৌ憗㻸띥ᄏᗖ誴Ⱊ䩮瘱敢甾ꦋꝛ⛐꫻䦀❬ꮔ杍 -false,4,5,23,229745057,15,-21760,1267012355,4861802455287862336,0.5675772,0.20829674198517034,蜅껭쩻0ⅴ䦄⇌⺢羞燷炓䜁㠟ᐴ঻ᦓ巵闥뢑ꢙ -true,2,10,10,2139595848,75,-13131,1173467820,-4346154021836583909,0.47078454,0.5642848201640165,릠✣ǩ⇹繀绞횐툎뭸䌒僢쯭㶠훖쓚⑫Ꞻ푮২掎 -true,1,4,1,998721306,121,213,-623428436,-5954897226712164389,0.12356734,0.09415645257989425,갗풜숓툨⁵셳ꕼ蠟ǂ긆໭滓螔ꠕ琪拸㇡ꪐ๞쀙 -true,1,2,13,588710295,-72,13815,-1570868257,8144498362863709452,0.06767273,0.696608188191791,펵쩻邗䊌ၡ䭥暝㮄鴤쨳ⰳ䊉戢밖템ۄ漢쿪넃湹 -false,1,12,12,1283109638,91,6925,-938432496,4488234234349287441,0.7009651,0.20419981170860768,졂苫緭殺귕ف䭂ꏇ豨⁙캚ঔᦋ뺑Ợ鞰ꄴ䣤髾淕 -true,0,3,10,1780573279,-7,16511,1648116798,-4010522296881539778,0.49354666,0.76214839914083,竵ᜊ䛓ᰔ֕硘㯙彠ꑇ땂淕뀬侍้곙駚䁅矻フ๦ -true,3,12,14,1941178506,50,-6873,35863937,-500409598773634350,0.0035754442,0.923795394851777,ⱄ쌀រ푑粠ᾡ䥒텢쬊᤯๦ꖊ⬏宰쥯樻懰㷡ዎ簦 -true,2,10,15,1145886737,39,-6413,-305400046,-5792585860452956181,0.19058514,0.3632467230669233,釈ỹ斒ች纰п殿ꃯ뚥쪌蟅拤锡乲恍崵潈봧旎ᨼ -true,2,0,5,768907620,-106,29055,448423894,7147952938476908636,0.6016194,0.420481376975951,Ῑ㟱₄絹㝭⼏ⴥ怫ᄫㄡ䞅깍ꖐ吁ꐹ᨟즺麧㲁뺲 -false,3,11,12,1078985869,-49,-24562,1605102767,3459639484266869426,0.7760923,0.4504094938089088,퇑볟좵궨⑺嵚ো睴橻ꉏ堆筙쀫᲌ᔔ▤劾✇졌 -true,3,0,4,2136785513,-54,-21595,1351161599,-4215474026183872190,0.55648285,0.2866919957795735,┡ል㩃꥚蚡獬픛䊯䪕坏ᥩ扥⏶罧젓洆쁞瘚䈒쮋 -false,2,8,22,1518342226,-34,10888,867309376,3719016504427893406,0.16995096,0.25232259590626993,根蝗㧌냠꠫⣢珡䐫婣獛ↄЁ㝸껶㔴ꏚ糚丩쾉묃 -true,1,8,19,734416642,-21,-17349,591727007,245833550551406861,0.4722255,0.020039612901084802,ᦟစ혟添龾Ⱋ⠲셗貁ꂷ䜢덽ⴣ饅싺틴❚筗踠໭ -false,1,3,18,449851569,-116,-10115,-2061016334,1666693256291559690,0.29327798,0.4517175352013263,讟軛矿둠攼붅솋₱䒿뵯緈坲ꇘ綢떇䷐⁙⥜灂뾖 -false,2,5,11,401313053,47,7852,1914514519,8902320515066654855,0.21719217,0.3811163177553121,慘檠骃㽤ⷳ䏍睅籼왃핹࢓숲㬾ख驖䝝⾈䓋ᄵ㷲 -false,4,1,3,700348801,-91,-25335,167629554,5957393991977287973,0.55365586,0.7626051219937391,㍿솰ꉜ弙ゆ子랄鷞謕඲爸䙶㫟船ឨ糽꠰ᐭ퉇⽱ -true,0,9,8,1789974023,-50,7745,-833058389,-8475892967406247745,0.18611157,0.24211579179324005,ᰜ쬾ᷦ霪ꚲⰠ餄퉠䓱폖瑤専嗊洐領睺ࣕ坒一䥂 -true,0,7,3,831373904,-84,-5378,966073370,-7123230281893220309,0.9451594,0.5717575205156706,뷩厚Ⱛ壋홳⇄䎦쫳붎ㅭ毂䬋㽑ㅮ苊㰩윃냓ᬁ㢃 -false,1,5,4,1575527324,-121,-30889,1601416104,-3032310109863430091,0.17169523,0.28616553688834667,ᄌ貊파⚀ꁦ훊犃乬줗鵋輫泯倞䏐ᯁ좃䄾虠弫㫝 -true,4,9,18,1770440563,-94,-1577,-927977663,5064208619045430671,0.9329869,0.009589347996759257,뾨㏑ꊍ㚸㚥䶩≑밒ꆫ期誅㾧䜹얍ᴭ캬희ằ뉬㠥 -false,3,5,20,1708128607,-29,-23866,1336737969,-1922381870112074274,0.085885346,0.5644386692056418,㥷᳛힀ߩ閠掐ㆇ꣜ᵆ౸倗撥ᐝꟻ懠െ鬦挸鯋⊎ -true,3,3,3,325594285,124,-10662,-925151094,-5898663357950632544,0.4516369,0.7549911117119996,ᚪ蚍픘峘셌蝸䰋丣䶭ᜟ耓䯿꠪闈쪷鮗䧴㏳빛癧 -true,3,12,2,135734197,-86,23735,767156003,4617478254209884634,0.62046945,0.8562151131699631,炶㧤鍎뀯苯柌殧끚뵊㤻䪬빀ꡞ켩섈泗똗搇䶎ꇾ -false,3,6,10,130466921,-115,-12666,1464391210,4165891724677523574,0.008584857,0.2914030832205625,졃៾迢᪵憥鷆膁묿㘯Ǚ宿ਈ뛮๋㾎䬾耯솂鋷髏 -false,1,5,0,1406653387,30,-27263,-2035828826,-6152654796407870961,0.85783935,0.1815576433955779,ᙬ֏ꅂ텢宩밍制㓅嘑삽圄屷ǰ䛓詫뷎䍁礔樛欿 -false,4,10,13,351441140,110,-9032,143247473,-4629701276086450132,0.4037001,0.09279902688553465,࿝㠘酇ជ碆霠ነ窧靴㑶߄翨뒢ຑ㡭礉䜀쿙⏇佄 -true,1,9,27,1896057511,-14,23105,-591072145,7050648459405897992,0.39962548,0.6434247139812375,嬡⁌蔬젦跔룰Ꚃ漵荆绾뤕껔钎횔갳糟૚㡂ְ뀳 -true,3,1,2,1037868643,39,-15298,949431846,4771852763069643949,0.2180531,0.3156515718067934,⳰髢厧邟㵛䦍띗燰ꐦ瓬聖⯊곥쉒놞䡰蕥ꛄ▹筙 -false,3,10,3,1660899380,42,-3004,-958497859,7120620435592122318,0.08403635,0.35478892533333795,̴곣꡼᯴ᝮꂱ垯䛛魞絡铇圈楇ꕷ猕쀐젰訩涺뗝 -false,0,11,4,147870142,-83,10654,-1290460299,2144998523095333024,0.8448413,0.8761476467052858,蕎អ㬋ḥ铿ᶭ礞叚셸౴✼䔛雊ᖁᄋ䟷㇎큌킃訵 -true,0,0,25,1303037366,55,-20089,1008197199,2796359392582420369,0.30247223,0.3052065612133401,漄呇꾚ධᥗ蟰蝽ࠐ욊癤ꨃ⣏䧜㮭腼갩᧬欀쓡䇪 -false,3,2,4,1214458706,-20,9059,-973684999,-6574922049684700616,0.31087244,0.4215452606660476,傶뀴⍈玾⼹谵轃ႜ௝Ⴝꑄ夀蚬翩뉧꿵棐໣ꨲ≁ -false,2,1,11,1471946189,14,-12850,-1636206929,4565177683312531032,0.06814504,0.675652242741229,⟕如ꒁ싱젬⼇⾵텪唃⊑䳵ჿᚾ㥜ꋰԨ켥턘䬹磱 -true,1,0,19,1765602393,-13,7221,-1829072979,-6942403670248424465,0.40330583,0.5807528551152212,υ쾻뇜餅⽫ᙜ錇쁳餤㿙演獖瑝Í䄞틉倱๠凵䒓 -false,4,9,16,387372753,21,19242,1222653058,1320671179524366868,0.2127701,0.15135181769502282,꽫繪夔됿ͦ烄๖臦騼ഐꚪ존쨠㣴ࠥ࿢콭䎠據ไ -true,4,8,20,1581928087,7,30071,1180497866,-416676517875626885,0.69673395,0.5637189738424164,B⇞扯䩐糍䒷刪蝣錢쾴ਵ䒵⠮䀈磚줔⟱莈薾촆 -false,4,11,20,2048754964,13,-24097,-1250685124,-1979751288669640757,0.5773193,0.9147462460144969,믶䙒㰰䱨涍滳ľ⭍╿綟飂樞⭹맺ᠼ뺣턊ꊴ땢ꐃ -false,0,12,16,778075956,-102,-17968,1942365141,4411863822111419006,0.48187488,0.905490779234353,躮⭇ᱺ㑁雤襨ుሤ藇ᯊ㊼새抳刪ዜ쮉겿떈᠓׽ -true,0,5,14,1904569058,111,19214,-234080791,-5473568741056175944,0.2555343,0.434825030523886,鱃得꺁換댐쑻絳㙾蔸돩곝ૻ㲆뿤邋휛걯촣ᵅ黒 -true,4,0,2,554917662,-123,26943,72591987,2224586585060278198,0.59320647,0.9678466125587091,㦟ꝷꂲ侇熑톰ᡤ㌈ȫ┍飳㷜飰⁝짨닝ꈧ束奾㝫 -false,4,10,17,1605770338,-50,5773,1317639664,3328498683828456843,0.65183306,0.21517202088141052,Ⱐ星꺦秗෺緝攷续썐釃衋⇽츷ꔫय़噩༦됸⤦曥 -true,2,1,27,916115615,-15,3246,1561153724,6640586874325022912,0.7753064,0.048453399897169014,粢릘⥅䎖䤱늱섞䌡顨෥⮶⦝莊㴑ല涵쓿驈嘤粽 -true,0,0,16,698633209,56,19407,-2094903057,4491125346907381815,0.51078033,0.3561153179185831,՜힖턿방ᶩ搰㊯婭ۥ亿浉吥䬴믓ᵌ㍛㇞⭍኉ꤔ -false,1,10,9,331717930,-51,23844,21286937,3224160792289524144,0.74783224,0.7377421998597028,欞䅘襶肃跿઴伄⡴㰀좉潞픘朒㻢諜⸞넋ぞඕ搏 -false,2,6,7,450726051,-68,-26923,493535785,3066437650902048487,0.8460534,0.5129705241041475,홠䟜詼၂菘䙭ꘞ㉒㭄뉺椈鮋壡嶠쮤❘荤ᬦ林萬 -false,4,2,22,186639041,-48,29438,-1506140672,-2018840238644402942,0.13049966,0.5466370818473373,举뭧뒛䤦̟葷鉝幠⯘蒮݊鶛硋떍ഝ⒃苚䩴㎍劢 -false,1,1,9,683974670,112,1395,1017959972,1576350744315291421,0.29213196,0.08914172928832309,㈕舶ƚ骩絽慈澅栄미䬎銠꫅宆腂稨牌꿐Ʋ힡ഗ -true,3,8,1,1926050631,79,13276,-2120652033,-1505944159283906126,0.4889694,0.9814992515656239,╧㟨즊旪׈溓뼣ㆴ䗶뎡ⴖ豅닞유韵㟵镧ꀯ䯍塖 -true,0,2,23,159409222,-81,-20876,569197401,908482088768601596,0.49604642,0.3213157883357525,岩ꑜ賣忙ࣀꌷ趇뉐ij〣鶦쳯檑覜鄙䜹㚽࿒ꑃ篔 -true,3,0,2,668198746,110,8739,-1195170308,1819445355373663874,0.7106179,0.6749794359634981,ཱྀ蕣쀳⺫渙ꄇ㯲촨致彸⁎쎉滭↟⹲̷㗹造⌓팞 -true,1,10,24,1629969491,108,21345,-400901845,4601093771773799249,0.6409457,0.143335247625615,、ѯ驴쁟굡渺唱꽕ⱷ翺᭦㽋瘴劌헃妟ꆗ骼꫃籈 -false,1,2,2,964921733,122,22344,-1654744681,-6750618225918461002,0.890248,0.2508628317430849,䦷ỽꂅṞ㔒㹒閿캗Ḍ塹㪠⛃柞渿꺯㯲쎣훘썝洫 -true,4,10,5,753159665,-53,14071,-1652626809,-2078510067519764775,0.5061584,0.26075374684018604,响쪯䴓軆ꭙ恽ꥼ㼟䑆亜톐ઇ嵾焎䶶氵ḡ붂嫦亡 -true,3,2,22,102069306,113,25145,-866155263,321794347904500166,0.55716026,0.5016446783724774,ᥕ⪞嚂텀辨⿯눰掀὿ⱝ筪㳊㦞誦胏혱忨傪扒飨 -false,2,9,23,653707285,90,-12911,-1356299307,-4523475253013105708,0.05585593,0.13857950330272173,䡷潤엨旦Ἱ붌ὂ툚䬍橿云薢맾닝鎣掑钓ꐁ뎝嗳 -false,2,3,3,2059881038,-13,3488,-911659303,6598453538542729952,0.12730539,0.8520859737571457,⫆飪┸翘䬼䱎㷒䷤꜋饨瑐騔㄄潱녡蓂ꎑ쏙쬭 -false,4,6,20,409734065,-89,-22000,1669476380,4112848153032561892,0.93294895,0.8305740538524686,㇄⬈۵෥뮰ퟦ⏻箔髚갟챢ࢗ느秹退嬗迁گ䭽琰 -true,2,3,19,1259996683,69,17880,-181588028,3821731361044833835,0.9642894,0.8355453825918163,䥙█巎욙缂쓈飉ꞯ숮닿Ѿ្䃜塱겂儽뗰吮ëᐖ -false,0,12,0,1839720673,4,26885,-1032134770,-4166283961398142264,0.7988619,0.31472051144986646,뚀Ẑ킸쀓夌葆ᐖṦ陙汌ꌮޡ䏯鵝儃邦琝꙼魁瘽 -false,2,1,6,1301693720,4,-31540,151610328,-9216439232345632980,0.5150462,0.3147516785904575,밇ሇ㣋뷁⺚唬䇸斌۴쭅␣㣎ɟ哷솦탯ꕮ뺏⺬幇 -true,0,7,27,240962410,-78,11563,379197915,-2090515699168836997,0.37161523,0.03804835023179365,㽿익櫀촅ꤏ琬睦ꁏ뽾承ང埛拇䤳៉噽齎࿈帆㤽 -true,4,1,6,491938874,-78,-7657,-1713674985,2120880350861883579,0.8542008,0.03864944648071922,轝功⃟釮辯쳄柺Жᵭ꺂彷現҉튼䠓왥熵칦ែᨷ -false,2,1,12,292523091,-45,-11401,-1571923721,1292379374708880307,0.57682896,0.44352114747118687,叉尹À᡾칯⵸柘鿇걭㘶ӆ㰵흰䖚ꧺ㧼뺟彮ᤜ甜 -true,0,1,9,573870887,82,14356,172848785,1164858801793800808,0.9821998,0.5023261268239142,ㆎ⇐㼣濁軂೭ꊍⓈ틁罟滦쬔⍸塨ဠፍ㥰㱘忕뇧 -false,4,5,24,2101996079,-47,10816,9422129,-7718886336742930723,0.9474292,0.2899923531077021,诫鳘觟㐩⻣ቄ쪶墁㜎밷쫎粕ᵈ쎃빋鼒⼧㾦檂䓹 -true,2,10,8,1985551670,-88,19155,-419811620,1356873541588406340,0.35318744,0.7723502098850213,Ⱎ캫䓈꠲퇺覲દȑ鈫龮醦췥透굱閄꙱൤䙖ꑞ簌 -false,1,7,20,701041872,23,32339,1161707988,2776691022936185348,0.37926137,0.01702500540212859,㏸㍍剝홖덺ꢴ謐縬鱮╹뚗窂䠚祣ᢏࡀⲝ馴∷ۣ -false,0,2,26,701083461,-46,-27652,-170702331,5700970230235297892,0.75121415,0.34755680027822267,ᨠ㳮꒺衱織躯咜갗ꈬ일ބ뽌앶㎚䌗䧥Ⱬ㉇ߟ봂 -false,4,8,19,308099843,77,-30230,1084496302,790867450853168714,0.040717006,0.8277609838234431,穗겂࣏ꙟ撥Ꙇ罰爿揢䢏铂㫳電㒽퉞쳔蚙甐ꢱ䇍 -true,4,1,27,770426034,92,-10448,1473455669,5305041486930110117,0.5631632,0.4198956617315416,駆悌ㄲ餪豦鿉骄⸥䥓暾漎ࡅ姙墚䁺ᥙ憁㽓瞔 -true,3,7,7,1527844932,-124,-29466,644273448,9155374553061731286,0.6002374,0.8017213523855212,鞷滔뗆桳쥶娂ᤩ섘㰽ꌮ芆悇ᦨ梳G⤐∛匴蘴猰 -false,0,4,12,1360802956,-3,-919,1476287370,-7823988326463117720,0.019938052,0.40837258850021263,⫵柅㚧䐻塖ꭔ䵑᰸䊦株족㚁醶ឪ봌甔쌱眒盺坎 -false,2,8,25,424937890,-21,-7496,-116627502,-5539144888875980695,0.7646779,0.3908420873239533,哥៤㊁뎃覅⡙댻⟑텃憂ו㺈ឯ銵걥瀁䲲눴倧諍 -false,1,7,28,2048821577,-103,29279,-1410928897,9201665022718575466,0.6662327,0.0945252022944818,濋잲鏷ᱨ僁臭텱魸딿で㮡레嚹㥭答켍葮蹎몫貜 -true,0,12,20,714237037,-1,6615,466420125,7337279928358679796,0.82842743,0.8627083185855362,歋軉ၼ霍㳖襲岽콊摛掍湌㝻㩓⬹㙳萎⠜쏳៉Ǣ -false,3,7,1,1475093755,66,-26361,1683005790,-5139170029485337114,0.4021532,0.6049396837870864,끆朽ޫ唴叵쫑꼣क़⾂劗䁪蚈ፘ苝ꛇ閵쥶珵輽Ҳ -false,1,6,25,1975095528,92,12739,-532088819,-6712302346253743895,0.53511935,0.42977725574305814,ᚖ閍⻉嬝튶ர쳩꾴君쒲䑭뭏༦쌰厉ⓒ࿇炇밠峢 -false,3,9,2,1990728669,79,-863,93724289,-8101309980276055142,0.8195417,0.677618337887574,პꮑ퍶⪓ᆼᑃ賙辇ௌኑკ쩬푹閰봝뺩꺺꼹鑕슿 -false,3,6,16,996835606,-102,-30762,37781033,-9122277453893808611,0.35121644,0.6568968892971336,᛺눢⸱뛵槛䕾悥ض䱴뤕幁㥜䎛ん㐛섫妱㘨崻鍅 -false,2,12,25,910769856,-68,-29714,1969366652,-7962518126606180752,0.5824734,0.9333612416875543,㠉䒸娩㮕呌九襰舁դ䀉㾁櫕㱴䎦楎讄Ꚕ絠ᆒ쐅 -false,2,4,14,1229079897,-41,-3969,1513672192,60226721086805611,0.76236916,0.27593425461119236,㽄読調䛙泯薣煚⟧椼ⴝ뚐⡮쭆阭ꏓ㹟⹖Ƛ砣咑 -true,1,7,0,702437653,111,139,-639925920,-974771215430995249,0.13883227,0.3080164797755379,씶꺙頫璂赫⦑㯇姹㨝恋鷉ᜀ鱕芿萺⽗㥋۹뿠 -false,4,4,9,774692787,-36,-11885,-82113298,6291341386209588360,0.18730986,0.5904764978405083,穧⹾⌅혗՝졳툽胀聴꿲樰鵭㚗ꨛꐹ㗄뤬ꠠ彗섵 -false,0,1,21,166810683,36,30338,63207346,4665618113923515115,0.023733556,0.30168615595975146,呹ꈔ럲欝㌗朹㨝嫗ܥ鲞埜픂ᬑ莸ԫ箢ↁ鑾踰੨ -false,1,2,7,2125241159,3,-25642,-1215945719,-3254320722874379362,0.028709888,0.1990353927336258,ꦯ⳩빬䚉䘧菴㞼뻺྅⦢钛␞ᅏ맀뚳粷攔寛힮偈 -false,1,12,24,127665671,-5,16524,1569780950,8484517148267817351,0.54221433,0.6910549838842718,᳛犁둘峽Ӎ⥴웑䭘첵堗骰ᄆ鲌矕렀䔕خ㳌ⅇ⍢ -true,4,4,18,219535881,70,3314,2089947233,4607500669321780649,0.49014562,0.7452829547728306,¿ᓋ۔吻ꣲ狺䰱⧥ࡥ⅓乷इ筕뛕雩싉吕凋⏵畈 -true,1,11,18,1727138559,8,28827,1979987443,-1070128557870580220,0.96864915,0.12304694505257907,嶼ۍ꓎瑭㰁쵡囸싀烍텘곎⟖蹤ᑩ쮰曌뽵㋇펞ェ -false,2,7,14,1288123073,27,114,-326933763,-4538677862736040277,0.9383131,0.2442881913524514,ᴅꔐ槛涪琜젓뱾板鹱㫞㳖౤녨笭㧢ꄦ㇑꪿Ҽ疀 -true,2,9,22,521409816,87,-8021,1103054626,-5803603774572649287,0.4566242,0.7451840097388837,냠奱졕밗麽側鎋㍆ề⍃㘼㱺Ⲅ枨պ搪曕袣酴 -true,0,2,28,1729380619,18,-27268,-2063214930,-5386022942906873035,0.30840534,0.15391640344898394,࿐⣁⏫揭暝ᲀ᣼秲쯼饉옓䮌瓭겚픣踷켫郢Ɩ㏭ -true,2,4,1,1580335224,60,-10778,-541826583,6298546146407188963,0.3797847,0.9806368435475767,௶븫럇쎪箱䯔촰㹕ꮓ葿᎚륊ㅟ梸䷾婘뻮㳌귒纬 -true,1,5,8,1825815563,76,-8103,2064685622,-997433072488275245,0.8175702,0.4060677982338461,卂ಮ㳉錯턭娞ᪧ沞엚꯴霴Ꮽ흥꯱ହ䌗캋婥䜮준 -false,4,11,6,219229032,-27,12437,-1858809022,5285234520967596715,0.7698803,0.639934628631153,윑㍛℉욕騿盍ګ뜬樦쟛鐽ꪉ∴姤؎璵⪜냮摉㲤 -true,2,1,24,500434828,61,-28137,924073819,8265337405046498147,0.7594864,0.7876082540140072,粡菙鲿経녂퉈姜◗迋ᡃ䨈皃᳭ᆬԺ據뤌闦䷊랜 -true,2,2,26,1191561227,-112,-29302,-1845742387,7701109651724719902,0.73088354,0.6797434264577749,ᲂꆴ䋯⼌迚혳ꗫⷀ靁赱王命똥亰謒圚믃ᬌ䟺쌛 -true,2,8,15,1186735829,96,-14913,837139408,-5250188028060280745,0.35682666,0.8465942672091502,O鶴ꢸᐋ㤭숏궭諎甛滳⠓낺Ἢؽࣝ垓䈿䬱뀂᝽ -false,4,1,19,1409639194,-47,22998,223202271,2765650454778188034,0.8483804,0.5890937225273637,补륷㏴쫎ᓖ/菬駆㗶颯❰딗ꂣ醚㧾纯䥒춵志ۥ -false,4,1,17,505461611,-58,-13832,1030922026,-8505461947064856204,0.6796592,0.19772741284905904,⊚⚭ᘆ᫣쇷翨玣ᡴ燛㭒랔푌❒䆲벹ਜꢯ甲ᮤ␯ -false,1,6,23,755389207,-61,-20467,-423519622,-956832623771146513,0.7071798,0.7811886581582305,줙ࢊ냫劸쎳횸悄턪䊰ᚵ뤛ᤨ覓䷀ลⁿ镚㲍冭䥈 -false,0,5,1,1516086503,-96,5911,249962800,-7839649174118521193,0.20281577,0.05378145868940831,໑何䠐ꦘꞍ牉؏悲Ⓐ쏝쳦掠빵듉䝨靳쭯콉趈㱦 -false,2,6,22,1720613484,40,30310,1639737736,-544610854867257318,0.60717714,0.6881121482310578,㻼렆聸㺡욽ᶂᓪ냵렿꺝ᕖ껰ῼ⡒䨻嗃ᐙ⹒ퟻ桏 -false,3,12,5,167732375,56,-807,-185268669,-5605352300474289547,0.22660851,0.7958555216678562,䭨㢚䥆⁆虍ģ鼐蓡岩赌㔞妜끼㪓쥁✜슣壠ᘈ싂 -false,0,5,16,1793225363,-73,-20616,-444620608,-2974078663424361303,0.2918396,0.30441670021080536,橍ꍌࣃ⭿쯮ꏫ▚졻㳥뜸뭯䞄疗⍼縘鴦酚ѵঁ蝥 -false,3,1,26,6036300,-10,-16278,237902789,108153940198218877,0.09570438,0.6158853671300282,횬熴钐뺺趷⫎䫱싱菖◲鹧⨟럦ꆄ픞驹㫂Ễꔚ屘 -false,4,7,7,1726331706,47,-11417,1182167074,-5239040597459791977,0.20388937,0.16892493843508882,힛攲촘ⅅ쿜△桠晴烧舷陨൚̜怺恊႗Ɽ歧཮ꏹ -false,3,7,2,1100084362,102,12903,1190087826,-7437790280021405118,0.8950938,0.9835923929247793,꯯绽ꫩ᳏鹜᡻ꭠ왏紳т煾ᨕ艑꡽㣷鴠뮞੏쾪瘓 -true,0,7,19,1896145160,-26,26041,-815697931,-9042118254009968025,0.45021224,0.5613780027608319,뛚篗흰胁䂑ㅋ骯閗⪉ἤ鲩哘邱杇Ⓣ썾₴헅禌ഒ -true,0,12,8,549691465,82,1516,211523089,-7954246658343292133,0.88485366,0.5008493503109895,ళ⃚骨Ὅ흈揚ꅯ๢繴鍪ᒍ躓痼礽ᇇ䈰⍳幦챗汌 -true,2,9,23,1239733478,-15,25644,922271646,-2717017794490574789,0.88475823,0.1855868367858331,怈㸓สꋒꊹℴ鸵狾።희榹돭㭴ᴥꬽ㤇㧛៧윜䱮 -true,1,6,25,2095680238,117,-19203,-1064925075,-7593157191549944626,0.08662772,0.5573373437370076,Ѣג熠鈙෿㙱뭇ᰐ㣧蘜贙뽘ሽ쭠꒬⠥䰭蝰Ň걣 -true,2,9,23,247029838,20,-21176,-1533566767,5580648357785566471,0.6037678,0.9766644947415974,엇늡货œ䢭䏮쪸㖿澿᫨豹ⵆᣓ蚌쯗᐀厣簼횖巎 -false,3,8,22,764261877,79,21451,1994852586,-849066385018286446,0.22055316,0.7100596889249792,籋윥憇뎮옂ꚡ뷡샾系㟺꧘㞎⢃팖럨戾鏫얎疒ッ -false,4,9,8,1062782840,25,-22147,-971971603,7601043534721898233,0.30986643,0.34061056731209205,嫍狱丛뫀网⽢꘼捹ᬹ틁綕朄붼䜷癟㗃⫸뚫㿸㢢 -true,3,4,9,1890302684,30,-21609,450351994,-5195432491042805854,0.07456052,0.9615190890855236,환ꈋ๢৹渼샩楝햵ԙ䕿푞榳⇼㹺쭭駴矯롭凒䘉 -true,1,7,6,846560533,70,26637,-1068563589,8645682135229516630,0.3827533,0.5355630566407764,ȜМ휤ᒫ䒭⨃괵맔爸읅躼쀈醜䆸冾꥗삵胑[拊 -true,0,10,24,1762253986,21,8010,507136253,-1611897952838717131,0.8006082,0.03993674675026826,⻡⬕멊촛쬫帲澳寠狊鉹뵃瘹ꚍꭆ딛ꯞ೟␚쮊꣮ -false,3,12,5,110574873,2,-28391,-124790736,4829839445128605002,0.56046015,0.7679634224261329,ꋗ鈗쳭쵾㮰䡢Ⳁ焐곍ِ᝭庳郦㇇䥲๱Й裺뗖귧 -true,4,2,12,864761995,52,-30976,-2041871921,-6980373723786070110,0.7050925,0.3830327364641034,䜳ᗍꝷ焦䪩瞥䣩Ꜭ餂Ӱᔿ燫堕ꁸ悐媤៯㓿㙄廒 -true,0,9,1,1677399018,-14,6272,-2139804706,7341782609509084299,0.22262114,0.02844783454047195,Ꭿ俲ऩ샇麕氒쌉挟᢬욦棌繾鹈瞀絲췖쮨쑴ꤌ瓦 -true,3,6,28,1942653741,127,11534,-724635501,-4830074867727432466,0.22438735,0.556372608878059,拣辗틭툚冖㾭姭꽄࣑䔳洃탱랶쎚⦞刋奾躨᭙㫚 -true,1,4,4,1753166636,12,4475,519074099,405538164706495167,0.235416,0.5607727803885736,ꀂ뿰릲榡⹄揢峏ᝑ幡⡭꘏峗໖䐌䌞瘿⮓穏⿲찖 -false,1,0,23,693877312,99,-18867,2000826202,3826199197102548759,0.9539606,0.3475227749887002,㦏簄葝漟氘랯袅籓䔶菿ꐱ趣뒈碔㗀ɓ꒩嗒죣壳 -true,3,0,12,1932467860,118,28946,-338667711,-3811638934217246215,0.3267156,0.20398103766939302,⩆䇧┭蠞锊鎕\䥍蛳藙쩱ꨋペ븄颣㑋읆ެ棭 -true,0,7,2,457130070,-128,-12105,146696599,-3789283977526124832,0.07452023,0.6580880563970105,踴舄翛竀쑢덓䟢ᓋ멝ୠ틗扰淤钙筩Ğ提℁ⅺ㐬 -true,4,0,12,1621197357,48,-31264,-1185471716,5333041377946667991,0.09279096,0.479485457280151,ま㠠躄⣲粵뢂㽿潰鏐⁤뗓갚豾倶䪟ۖ碵㮅봾櫦 -true,2,4,6,393046421,59,22159,-440187006,-2937718484805791768,0.9524316,0.26279223578429056,跎랑ⷲ噱ꊖ뾂⸼獀Ẅሀ沄ꠠ⑥ヿ暈悠材雲ໆ궽 -false,4,9,27,1694238063,-50,32203,-1726120170,5469539346156519424,0.34970838,0.0598221750681448,鲏쬺⋜ⳅ➤菡᎔쒛毴쭔핦ᖔ园⾨鏛㔶돨殓뤛븇 -true,3,1,10,86040064,-61,-1614,1427233750,3944657029466120525,0.18776399,0.18274288889404178,恟鑚繦䖬댋挺虅案辫첚¯魊绨ジ偃蒲欅随輝ꌡ -false,4,6,14,1412164238,-42,3720,1503663711,8263063637702236690,0.6182978,0.2122121824162333,㏤춵☺헭뭯Ӛ䊪헤ꄟ碎䞉蚆ᕬЈ띳큕萲외⚀䣘 -false,4,6,7,624873238,108,-11837,1261628174,8124458865858010666,0.9424731,0.2648091438304201,戧ഘ펱쯤갳햰霸樭轆䲘ý玌㩢讳꽷ꚾ㽊⸙푞ڵ -false,1,3,14,734893259,-127,19507,-30888687,-2288471342949481916,0.9966397,0.8709637544292466,㜊㐸瀙؁裙脓꺆遗蒊蓜憳廻㸩꘍쎟₉媎沋ݫ뾓 -true,0,8,9,905397311,-111,8524,1502118792,3473644655523422137,0.89963603,0.566950855656357,㠹 栃癋ᮇ䈳䡾웩骹⩆ⵞ냸ڿ紐റ矌ဖ譊釓ꤟ -false,2,3,28,2091415377,-27,31036,-1212956684,-4857670553866706619,0.5033241,0.4490898393630405,ᢈꉖ瘬굠ⷆ葘踵롱㶴뽟둀왕躎⥊퍈唻╦䀴த䫚 -false,2,6,10,361195459,83,-24307,-1432922043,-7710681500716716325,0.91039294,0.15693491492054112,蝸ᗘ䂉쾨鷕獒輗ⵞ䠂㮩쉙዁黠菀揻舝…䁨㩕䜨 -true,2,6,3,929181548,-37,13685,1533600891,3039390349100660513,0.10556418,0.8435500043206446,흢곧᜾꿤㽼䀀ㇾ孑쥓襯笨蒌㬂隇੮訓ϸ돻컭栞 -false,1,0,24,2140323720,-9,28170,1152857104,-7198140148660377265,0.6383702,0.296694844829575,炝ꬰ냯ꑳꑲ龺䌈ꅙ홠츋㗷䂠荻ਹ혥鱀쿸ᄄ弳趾 -false,1,5,0,1449145810,27,30224,1011970251,3117522684378328623,0.10422468,0.845653885856783,䝁덄뵁ꡜ迗뎄ᄣꑙ颂꘶塹秧樟᛼响鱡읏뭡뚃ꑏ -true,3,5,9,1787062807,-76,-23003,2145139030,-3193250702534549782,0.17477554,0.23315610007297094,縗䎶챟ꂜ魒䙾റ迱犾큠걠桰鯋鐺뺘୬膩㿅阑峿 -false,3,10,24,190356155,97,11969,-657312568,-1117803367748784547,0.8527578,0.9753528491547591,趝嫞줜ᾓ㏾䂡ᰗ퇔ꀦꑵᐰ鉳峣ᮍ楸舽Ɛᇝ뀙캂 -false,0,4,3,219242968,39,-24520,-1974203649,3642627760280722819,0.71685743,0.7321159644886541,佧岪訋擌靊㊗뿤ꘋ劃繕혜䯈㉋Ӹꥄ虓饏兤譨쐬 -false,2,11,18,1994859279,-97,7273,-785739649,-3384152560995186100,0.6111811,0.7085026394528402,ᢰ硾⒗췂㱍覉₏韲떶炮玤糘䇙釡ῖDz钟洕坷쩲 -false,2,0,26,884721435,-56,-12272,453803257,8675061408112971386,0.71527416,0.2719236684679943,磷ꢴ뉆芜萙ᓽܓᣡ‹㹾궻⮳킸톯⎺⺶풾볍塺ᾝ -false,4,9,17,96588005,-127,-15374,411945319,7252811393769297694,0.5438788,0.3703581922997703,ꭟ诰贎৉纋鯕뱗Ⲡ嫊㊗ᶞ휀䣫莻姃敌⁽昆袋㴈 -true,0,12,14,2022855930,30,-25665,-1258973346,-5345375259489784071,0.71885854,0.32998426533103375,葁ᇩ龉棁뤃揟浂⾪鈇舃훃Ԑ저犢ඝ帲怲ᩆ켯햹 -false,1,5,19,1477853573,-45,1089,1774745418,2281603937128163561,0.4736452,0.2651492629459913,旛⊩쿋ꢭ쨶狒╒࢚솛㾿骪휽᫫雰⽸嚵楒ঃ葭쀈 -false,3,1,23,163907572,122,-237,468294998,2724238383658753127,0.47393662,0.04998213882456293,爾㿥僅玎⓻ǟꧡ⪤珯弎作ⸯ㷽젖㲌䯉⶟샕ʿ쬁 -true,2,9,10,1385062481,-119,-24464,-1789326631,-6949848426361579234,0.22867829,0.789663420394937,ㄼ适☧稡ᶒ㓨셐㶛ਾ㒑㇤ꭥ틅笆쨺䢸䬛ᓬ飞ᔳ -true,1,9,7,1968915629,-122,-23749,394590508,-8219198316803458907,0.01843369,0.5537035869173044,莩薨ਛ튣ᝏ漉춮갬䊗㏑馕余衛샙⊳Ꙃ⡜ꓐꏙ㺓 -true,1,11,11,276724257,111,30633,1250564920,-3465333809121248905,0.97064084,0.45721629419942944,⏉ᒾ䇌畃ĕ牖⪀焖繫⅚ဈ쭎ǐ鴴⯄嚗ᚂ雦膪ಘ -false,4,8,6,1478402725,-19,23524,182024486,670456397367139848,0.64356726,0.8172198386294783,ው䗦㏏끨逅㑑臨廹곀⺸釋腬箝Ὡ刿䳻ຟ餞昵瓐 -false,4,6,26,1947499328,-39,-13737,-105765628,7891961009888818461,0.687745,0.09773734165086989,ᬫθ覇Ꜳ⋯륟짧랕合ȣߛꤶ诃齼䃒䱛妙믣ㄣ늡 -true,4,4,2,751351361,-34,-26548,324975908,-4985229514747786958,0.80785763,0.6054332047911015,仂뭫꼠ឧ쪺횗챐鱐뭰ꉙ佣㱈읩䛞绽臏ᧈ㻢ⴝᗅ -true,0,0,15,2117512386,-54,-32625,-649198433,6806138664214278948,0.053943872,0.8034771236941767,蘶ᕥ笖틒謘꯸睇曛㯅叕⁋嵅侲裮턓꺠䁤쯜䔢⊐ -true,3,10,24,1545692391,65,-27102,1679434520,1477808950836860726,0.18460625,0.3966274533417897,燠ퟷ鬑뼌渉췣䗣䎸궇廞謈혯䘒ꥀ콃䉱붹겊 ž -true,3,1,8,1690286716,92,-3112,871466697,-5023265279643967337,0.41487402,0.7838036604719485,ꪹ࢐鷱譍戃펥쭂㈐޿䁡旎㱪婗炢濶鵃㳩툜䢯⟥ -true,4,5,8,783628,-41,-10964,1960736964,-752871478250714969,0.46603346,0.05442721715046017,孼㥨䍧葇菁售稉底ᐈ甌ᯘ铻≙驱䂒狴鳏鋄杦㾆 -false,2,8,23,614922851,122,-10560,-1185399346,-7774726185513849433,0.3720122,0.4512584059320437,骔쬸䳱ச镬淄ⰴ鴒颾⇼슍믾怄惑䄮狦蚈ワ纗桄 -false,3,6,0,1522475364,-106,-16889,1808092021,-1236033946341067124,0.5427082,0.9210818477939374,ힼઠ靶ゾ瀹蠓藋쫰䌩鸤휛䣧翹굗㪁迾뉪ꖈƋ屍 -false,4,6,9,2125344243,51,-31009,792538835,-7853989582454992713,0.17614293,0.28256220081287675,ᦱ돃ସ宼Ǖ辱珚ၛֈ릁맮ᚓↈ䱿ꚏ〪ᨥ綑㟊ঃ -false,1,2,24,1552813180,1,29569,353725066,6186298840390736967,0.18146902,0.5022242480091891,殮毎鍰틀㨠溧菺鷂ᓡ⑝씀閆᫾鄖ꠄ汧✇ഇⲄ捻 -false,2,0,22,1857139486,31,-3536,150155779,7820193225032620891,0.8597146,0.70908397935545,녛蜚㓯邶䳎潃猳⿱峝ꡛᵼ伇勏ꛨ㴸赒봭恑蚬揗 -false,4,2,22,1071339242,80,-21157,1252730885,7586340282937154032,0.036323726,0.8246641436719843,豆ⷰ钣㤕ዤ궃鉾颤ᾚᇏႈ儳㬒왦鞞⹠ิ㶭ᓙษ -false,1,9,9,742819789,-77,20213,-1423713872,3543203616318744714,0.82544696,0.0946642619465724,꓅攤ꄙ࿩藺篡躁㕵륦캝槎㇧쑜簆Њヵ숯됤䵬鵰 -true,0,5,27,468916404,-90,5235,83141248,7283651347220016313,0.78424275,0.4167184761641931,㐓⮝꿍텗긬⃀㍼梤䒬෾ዏ筩❠춢ଐ䤒푕롺녃Ց -false,3,4,2,2026564449,123,-14983,-294801502,8382086564535564431,0.3762604,0.22098288969051738,읡遜К놨剖℄᣺혩穊ꗢ䔍ᶠđⷈꪱ鳤ბ䰤刾ᆘ -true,0,8,13,326586959,-99,13227,-407962060,-4610716468070162606,0.3629434,0.09498698285175156,忠꒢蓅䏈뭀鍶⑍┙瑵쬩࡫兴峼팺ᐓ縪驌餋ⵤ㜜 -false,3,10,14,1208384845,-111,-6809,-521968346,20553134549368439,0.9454982,0.0014460175058255142,참띇Ḻএ᠆ࠚň쪴쁂䆎엲㥶ᓃᏑ᭏意஗敿㕐᧍ -true,2,8,21,964499581,-11,32257,1350530810,3194629316961088104,0.6511946,0.9968826450233449,㸒ቧꩋ畚썌뽀ဩꠈ叶서와᭵튀⿫鱺羽듐셌䃰뢥 -false,0,9,20,95742180,-58,-7007,-760249949,5412155990366864411,0.5297432,0.29754757702705936,㿤籯쬧扩⋔콐㮿貣ꤵ滑ώ켺襼唐鄹튾Ⳛ쀱㝀☦ -true,1,0,16,1071509982,51,31162,-1252674704,727226771807372723,0.5532096,0.12958961975675531,䪜ᆷ긵倥힕ຟ䶺᪓報䤪棎늄팆쩖ᡳꬷ⛟ꌡ僟뤣 -true,3,10,18,1188807674,91,17320,1193737407,4776742583075073262,0.8531791,0.09465088299568925,⩜㖌쭑世塳ጄ짯㆑Á儤閌닑ᆪ೪ಊ廞䏍一듉努 -false,3,5,16,698906415,98,-24177,938166686,3002013368078838828,0.0670923,0.4770979497091494,탞띯蜂毌饭螲酂嫗쨧허໦䯱ꦦ웗㛡䗠۠揀鶕ㄔ -true,3,12,27,17570265,64,7199,-51817396,-2103749563615537867,0.24547786,0.5076847755859427,屦픻ᾮڃ쐍聃顬颗扲ᦚ糅力苬莨戆Ὢ퐕Ꜯ䙞镱 -true,0,12,7,735489609,93,20535,-371128363,-2674416610700795288,0.8558959,0.879519270992787,瘋₻䍽也駨ボ囖䤬絯쭮㐅쓈⪏⵸䖉삝⚄孳憫䎯 -true,4,1,20,915091167,41,8179,1889985445,5792681898786644575,0.7393128,0.09262331822987424,㹼섬널䮈஬㜥ꅛ紦哈쐤頶쏷榌䶙磕蕅䤇枯哼닏 -false,4,0,8,552057524,76,-8253,623239332,-3375634575315459031,0.36911923,0.23940023791448506,靵㩰鸺矾喒‎芕펞멃ळ䂀듅繆⢅⢎컻䗛ⲑ픰溗 -false,1,4,21,510613993,6,-17377,-64759520,-3974808341229739387,0.5365573,0.40824405676263453,淛㉡ቿ뿔᎚䱕챡᧫炇⇺앤签ᰚҠ톪Ὧ⽨ᒃἑ稣 -true,1,6,18,692406315,56,23984,-538943732,6802013956830195359,0.039002776,0.5030474475649561,ӯ灥ᕳ녌㊋䡱䲓咀Ԉఱᕈެ夾䰺뀷蠎⠖塇Ꭱ횃 -true,3,3,12,924528952,-108,-1996,1757736884,7975414790775317613,0.52667034,0.01023964046913095,샯꟨熟쒐쏥ᘊ擬낢훆⼨ꮥ臚绂꧴⺟佞為팊ᐉ朁 -true,1,11,5,274430582,-32,-25198,-1101801378,2627066092072658678,0.7182265,0.8338279864158362,祕蛎秥媧꟦㐟㇂鰫攱텪ꗈ椾ὤ褋ѕ䍯嵷ы峐끻 -false,1,5,14,1751536026,41,7172,-605725162,-3283950910421578121,0.8041417,0.6496595368142363,熤ᗉ窠朢檦⳽톷㿚 뒒憱럢࡫㷄ௐꀇ둪屶粊ি -false,1,6,1,1507465631,58,24518,1607613295,-8873966780457438942,0.4712336,0.07898064162389484,墻䥵ঢ៽릕枼鮴䛨ᎀ႐讫閹ऐ霫䍕蓿岫䡴鋥䪉 -false,3,4,23,958006470,-25,-4313,407243213,9070365160125430370,0.1382814,0.789289871346883,ㆦ⹯휧㘍釫摧⤈㒖떹㛙띳窽잲썊謆粂㌘颣汪턡 -true,3,12,26,1045919070,61,32405,498397434,5010692401093873922,0.15231031,0.8874324151846106,猃ḹ㮁芍逺ꡨ酳躩ᓆ㯰샋鵣唵軉哰㑤帆섳틾찫 -true,2,6,24,1972845497,-5,6703,1879854093,-2222896549059064624,0.3328836,0.7508437586551192,鍿뭯淠⼶㹬ඖꎵ批䌢覀℅妹↉좍蕸ぽ会౛죿퀤 -true,1,10,16,926210712,-13,-3167,1736953712,2081307451813152858,0.83534896,0.2697580960717878,펩逵ᮾ㛹췬ᗹ଱䢮珲品瓱抚ꡞ哠펥꽞쿓隨ᜬ騺 -true,0,0,16,98375280,-108,-8255,-1126021273,5121349134294840037,0.62340224,0.9058936980566197,䝐溲鿌瞖蔮릞苿㢗嶫쮧炠藮畺띯럣쟞٬ආ⿁㠫 -true,2,5,7,579584653,-39,-10080,1295793286,-5512594733186640333,0.2345826,0.5529858916888012,䒁櫃몶圉઱ꭂ輰鐏纸팝艵᝽⧍뿆䕧埇仩庈峊긁 -true,3,5,28,192413889,-84,-25602,-1399308161,-4999321731499002492,0.2202034,0.6453989782043966,笘츷琸私멮รᲨ䉘⫋틂㢆硵⌎ᵇ䱴ꄋ⾪ᗂ淹墚 -true,4,12,0,2034800013,23,-26202,1672890683,-3201068453518124906,0.10491228,0.29764615198420163,칻죫끧嚗ृ⠉鰨㾓砥爼Ɂ뒔稧႑ട戧둾傛䭠뎥 -true,3,0,23,1824726680,-23,19151,-976064148,-5866625933452838677,0.23397148,0.2567099989300493,⇔犪徢绕毜볛ፑ݋仞㸺ӹ煜樻䅌겗苮籴ᚽ䶜↶ -true,0,11,8,201318545,34,13460,-867274444,664269413064484815,0.745774,0.7662250808178842,恊ᤒ칗०艨靺狵큮džꆔ裳䣑茑ꠍⲕ彞㖍춴㧣ᑐ -true,2,7,26,665464125,21,21014,-1884637579,-7243505533089654587,0.0690732,0.9264561736443667,员蓨땀ʘ摓緅㍾鹻䶀ɳ꧟耪鸱밎尗㪓䭥螜猓䯨 -false,4,3,18,1477391018,-69,-6041,1505737882,-2932679718644882803,0.37644255,0.4616319718363274,᧿ỌÉ䊽▕㬠淬踥굡딦懔潨폝뱈᜔켙᮱⿐瑷万 -false,0,0,12,27536489,2,732,-150795199,6079111845833599979,0.46385628,0.11918711984988928,睏ꎸ조硼ಉ걁㾍湺滘꽴≳㰹겙⡁呌钴꺀㓳㺋있 -true,1,12,23,1457100270,103,-3980,-926882849,-4562545035019281250,0.4389583,0.06844656232765345,ᐱ랿팢ꀔ⥘ѹ먧ᦌ싃鳭뮊バ匟븲譬憸⡳뫂ṥ竃 -false,0,5,22,1783942973,-45,17637,1640723130,-1896563881960380322,0.43040425,0.2749355068497815,㞥칟抉⏨쾾蘠☝₴죖䔠┻筴揫꽿鼟踇噺⹒ꟸ麳 -false,2,4,12,1532666296,-35,8922,-176173288,-8955014781461314016,0.6307863,0.3274990362903428,㞚䛷攓眎愹퉝梋촖᦮鼻ꪩ麨ԗ늷ᡉꧦҾ邹俽ዣ -true,2,4,5,73962897,0,-17832,1634350374,6258605060818382676,0.031057596,0.5940351613053869,䮓訊傸쒪漬햫컠බ摖딯뀼헼醌샇ቀ맖睄佒閕㺼 -false,3,1,2,1207239595,-8,22197,1033891533,4788989286431932240,0.41694415,0.04790633102108133,잎犣캘⮝㖄ấꌮᴟ友Ǟ੼옯(䀒稐胧ᠭⰧ圭ꈁ -true,3,4,26,828547331,-105,-4767,833890130,1297637434204179010,0.26653832,0.26469010287736106,Ⳅჹ톋뎵䧆휒⥍歔㺈ꓨ✿꿍桶款쭭힧驵皐Ꮦ㷸 -false,1,6,14,744993075,42,-23091,-150042007,-3245065061820959388,0.54456913,0.9590753194830887,狢嗔콪᮫Λ쁈揭ʩ♏炙坕ⱃൺዖ쵇彔⨰鎑⸓曻 -false,2,4,16,792636561,123,-10251,-228136768,6946322014254064963,0.21435279,0.40973968548511475,텚價䭑昘࣓㬦쁄ꖋ쏿ḵ䈫軁㦽쌻摞ч㟄宠椎䏕 -true,4,6,5,1486287868,-116,-16678,-894187338,-5609981245581940964,0.5686012,0.7628660139787938,烾亼稒엾뙴襎㸒藗흶뺃ᡖ녳蟄禩휍曅䰣蚜ɛ犾 -true,0,6,4,1733761461,-68,-8682,1624375853,-8116302398722627489,0.95081633,0.9699169373953178,↹鶥䉩슧㵋㋟퇭戤✪ƺ瓁컨洄Ⰰ쓍맬槿ꭿ佔͎ -true,4,12,9,1779584435,-5,-8039,-516556536,-1182163242051036192,0.081951976,0.3054443670484893,趋፰xӗꀱ⫦㐞쮗ᒝ捂캍ؼݽ뒷씀⭅⽐⯳㕮⮃ -false,4,1,0,1725357266,54,13652,1397589747,8354763653702371440,0.15626663,0.11666006317601962,ꀺ碸싔ㆿ㫕젭톮ᵵ㳁脉똓ɩ⽆ㅕꕰᣖꏠ坨詓阂 diff --git a/rust/datafusion/test/data/null_test.csv b/rust/datafusion/test/data/null_test.csv deleted file mode 100644 index 80830606563b..000000000000 --- a/rust/datafusion/test/data/null_test.csv +++ /dev/null @@ -1,6 +0,0 @@ -c_int,c_float,c_string,c_bool -1,1.1,"1.11",true -2,2.2,"2.22",true -3,,"3.33",true -4,4.4,,false -5,6.6,"",false \ No newline at end of file diff --git a/rust/datafusion/test/data/numerics.csv b/rust/datafusion/test/data/numerics.csv deleted file mode 100644 index 910083c7e9b8..000000000000 --- a/rust/datafusion/test/data/numerics.csv +++ /dev/null @@ -1,4 +0,0 @@ -a,b,a_f,b_f -2,3,3.14,-2.13 -5,5,3.0,3 -0,2,2.1,4.00 \ No newline at end of file From d7bea8e19b1f54f24c5c959f79490931cd32f48f Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Sat, 2 Feb 2019 08:29:00 -0700 Subject: [PATCH 05/12] update test to use uk_cities.csv and remove people.csv --- rust/datafusion/src/execution/projection.rs | 11 ++++++----- rust/datafusion/test/data/people.csv | 11 ----------- 2 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 rust/datafusion/test/data/people.csv diff --git a/rust/datafusion/src/execution/projection.rs b/rust/datafusion/src/execution/projection.rs index ff6c17b65227..c49298e2782f 100644 --- a/rust/datafusion/src/execution/projection.rs +++ b/rust/datafusion/src/execution/projection.rs @@ -88,12 +88,13 @@ mod tests { use arrow::datatypes::{DataType, Field, Schema}; #[test] - fn project_all_columns() { + fn project_first_column() { let schema = Arc::new(Schema::new(vec![ - Field::new("id", DataType::Int32, false), - Field::new("first_name", DataType::Utf8, false), + Field::new("city", DataType::Utf8, false), + Field::new("lat", DataType::Float64, false), + Field::new("lon", DataType::Float64, false), ])); - let ds = CsvDataSource::new("test/data/people.csv", schema.clone(), 1024); + let ds = CsvDataSource::new("test/data/uk_cities.csv", schema.clone(), 1024); let relation = Rc::new(RefCell::new(DataSourceRelation::new(Rc::new( RefCell::new(ds), )))); @@ -109,7 +110,7 @@ mod tests { let batch = projection.next().unwrap().unwrap(); assert_eq!(1, batch.num_columns()); - assert_eq!("id", batch.schema().field(0).name()); + assert_eq!("city", batch.schema().field(0).name()); } } diff --git a/rust/datafusion/test/data/people.csv b/rust/datafusion/test/data/people.csv deleted file mode 100644 index 0594bbace7d1..000000000000 --- a/rust/datafusion/test/data/people.csv +++ /dev/null @@ -1,11 +0,0 @@ -id,first_name -1,Andy -2,Brian -3,Chris -4,Donna -5,Edward -6,Fiona -7,Gary -8,Helen -9,Irene -10,Juliet \ No newline at end of file From ae88a90ba033be3c056c821f38e99130cdf97e97 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Sat, 2 Feb 2019 09:26:49 -0700 Subject: [PATCH 06/12] convert tests to use new test data file that was randomly generated --- rust/datafusion/src/execution/aggregate.rs | 85 ++++++++------- rust/datafusion/src/execution/expression.rs | 8 ++ rust/datafusion/src/execution/filter.rs | 93 +++++++++++++++- rust/datafusion/src/execution/projection.rs | 25 +++-- .../datafusion/test/data/aggregate_test_1.csv | 8 -- .../test/data/aggregate_test_100.csv | 101 ++++++++++++++++++ .../datafusion/test/data/aggregate_test_2.csv | 8 -- rust/datafusion/test/data/uk_cities.csv | 3 - rust/datafusion/tests/sql.rs | 90 +++++++++++----- 9 files changed, 326 insertions(+), 95 deletions(-) delete mode 100644 rust/datafusion/test/data/aggregate_test_1.csv create mode 100644 rust/datafusion/test/data/aggregate_test_100.csv delete mode 100644 rust/datafusion/test/data/aggregate_test_2.csv delete mode 100644 rust/datafusion/test/data/uk_cities.csv diff --git a/rust/datafusion/src/execution/aggregate.rs b/rust/datafusion/src/execution/aggregate.rs index 5a77c8a055c7..59fc7367a9df 100644 --- a/rust/datafusion/src/execution/aggregate.rs +++ b/rust/datafusion/src/execution/aggregate.rs @@ -1020,16 +1020,16 @@ mod tests { use arrow::datatypes::{DataType, Field, Schema}; #[test] - fn min_lat() { - let schema = uk_cities_schema(); - let relation = load_csv("test/data/uk_cities.csv", &schema); + fn min_f64_group_by_string() { + let schema = aggr_test_schema(); + let relation = load_csv("test/data/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); let aggr_expr = vec![expression::compile_expr( &context, &Expr::AggregateFunction { name: String::from("min"), - args: vec![Expr::Column(1)], + args: vec![Expr::Column(11)], return_type: DataType::Float64, }, &schema, @@ -1051,20 +1051,20 @@ mod tests { .as_any() .downcast_ref::() .unwrap(); - assert_eq!(51.507222, min_lat.value(0)); + assert_eq!(0.01479305307777301, min_lat.value(0)); } #[test] - fn max_lat() { - let schema = uk_cities_schema(); - let relation = load_csv("test/data/uk_cities.csv", &schema); + fn max_f64_group_by_string() { + let schema = aggr_test_schema(); + let relation = load_csv("test/data/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); let aggr_expr = vec![expression::compile_expr( &context, &Expr::AggregateFunction { name: String::from("max"), - args: vec![Expr::Column(1)], + args: vec![Expr::Column(11)], return_type: DataType::Float64, }, &schema, @@ -1086,24 +1086,24 @@ mod tests { .as_any() .downcast_ref::() .unwrap(); - assert_eq!(53.479444, max_lat.value(0)); + assert_eq!(0.9965400387585364, max_lat.value(0)); } #[test] - fn test_min_max_sum_group_by() { + fn test_min_max_sum_f64_group_by_uint32() { let schema = aggr_test_schema(); - let relation = load_csv("test/data/aggregate_test_1.csv", &schema); + let relation = load_csv("test/data/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); let group_by_expr = - expression::compile_expr(&context, &Expr::Column(0), &schema).unwrap(); + expression::compile_expr(&context, &Expr::Column(1), &schema).unwrap(); let min_expr = expression::compile_expr( &context, &Expr::AggregateFunction { name: String::from("min"), - args: vec![Expr::Column(1)], + args: vec![Expr::Column(11)], return_type: DataType::Float64, }, &schema, @@ -1114,7 +1114,7 @@ mod tests { &context, &Expr::AggregateFunction { name: String::from("max"), - args: vec![Expr::Column(1)], + args: vec![Expr::Column(11)], return_type: DataType::Float64, }, &schema, @@ -1125,7 +1125,7 @@ mod tests { &context, &Expr::AggregateFunction { name: String::from("sum"), - args: vec![Expr::Column(1)], + args: vec![Expr::Column(11)], return_type: DataType::Float64, }, &schema, @@ -1133,7 +1133,7 @@ mod tests { .unwrap(); let aggr_schema = Arc::new(Schema::new(vec![ - Field::new("a", DataType::Int32, false), + Field::new("c2", DataType::Int32, false), Field::new("min", DataType::Float64, false), Field::new("max", DataType::Float64, false), Field::new("sum", DataType::Float64, false), @@ -1147,12 +1147,12 @@ mod tests { ); let batch = projection.next().unwrap().unwrap(); assert_eq!(4, batch.num_columns()); - assert_eq!(3, batch.num_rows()); + assert_eq!(5, batch.num_rows()); let a = batch .column(0) .as_any() - .downcast_ref::() + .downcast_ref::() .unwrap(); let min = batch .column(1) @@ -1170,34 +1170,37 @@ mod tests { .downcast_ref::() .unwrap(); - assert_eq!(2, a.value(0)); - assert_eq!(3.3, min.value(0)); - assert_eq!(5.5, max.value(0)); - assert_eq!(13.2, sum.value(0)); - - assert_eq!(3, a.value(1)); - assert_eq!(1.0, min.value(1)); - assert_eq!(2.0, max.value(1)); - assert_eq!(3.0, sum.value(1)); + assert_eq!(4, a.value(0)); + assert_eq!(0.02182578039211991, min.value(0)); + assert_eq!(0.9237877978193884, max.value(0)); + assert_eq!(9.253864188402662, sum.value(0)); - assert_eq!(1, a.value(2)); - assert_eq!(1.1, min.value(2)); - assert_eq!(2.2, max.value(2)); - assert_eq!(3.3000000000000003, sum.value(2)); - } + assert_eq!(2, a.value(1)); + assert_eq!(0.16301110515739792, min.value(1)); + assert_eq!(0.991517828651004, max.value(1)); + assert_eq!(14.400412325480858, sum.value(1)); - fn uk_cities_schema() -> Arc { - Arc::new(Schema::new(vec![ - Field::new("name", DataType::Utf8, false), - Field::new("lat", DataType::Float64, false), - Field::new("lng", DataType::Float64, false), - ])) + assert_eq!(5, a.value(2)); + assert_eq!(0.01479305307777301, min.value(2)); + assert_eq!(0.9723580396501548, max.value(2)); + assert_eq!(6.037181692266781, sum.value(2)); } fn aggr_test_schema() -> Arc { Arc::new(Schema::new(vec![ - Field::new("a", DataType::Int32, false), - Field::new("b", DataType::Float64, false), + Field::new("c1", DataType::Utf8, false), + Field::new("c2", DataType::UInt32, false), + Field::new("c3", DataType::Int8, false), + Field::new("c3", DataType::Int16, false), + Field::new("c4", DataType::Int32, false), + Field::new("c5", DataType::Int64, false), + Field::new("c6", DataType::UInt8, false), + Field::new("c7", DataType::UInt16, false), + Field::new("c8", DataType::UInt32, false), + Field::new("c9", DataType::UInt64, false), + Field::new("c10", DataType::Float32, false), + Field::new("c11", DataType::Float64, false), + Field::new("c12", DataType::Utf8, false), ])) } diff --git a/rust/datafusion/src/execution/expression.rs b/rust/datafusion/src/execution/expression.rs index 9f390ea4c3da..108a8558b9ad 100644 --- a/rust/datafusion/src/execution/expression.rs +++ b/rust/datafusion/src/execution/expression.rs @@ -275,8 +275,16 @@ macro_rules! cast_column { macro_rules! cast_column_outer { ($INDEX:expr, $FROM_TYPE:ty, $TO_TYPE:expr) => {{ match $TO_TYPE { + DataType::UInt8 => cast_column!($INDEX, $FROM_TYPE, UInt8Array, u8), + DataType::UInt16 => cast_column!($INDEX, $FROM_TYPE, UInt16Array, u16), + DataType::UInt32 => cast_column!($INDEX, $FROM_TYPE, UInt32Array, u32), + DataType::UInt64 => cast_column!($INDEX, $FROM_TYPE, UInt64Array, u64), + DataType::Int8 => cast_column!($INDEX, $FROM_TYPE, Int8Array, i8), DataType::Int16 => cast_column!($INDEX, $FROM_TYPE, Int16Array, i16), DataType::Int32 => cast_column!($INDEX, $FROM_TYPE, Int32Array, i32), + DataType::Int64 => cast_column!($INDEX, $FROM_TYPE, Int64Array, i64), + DataType::Float32 => cast_column!($INDEX, $FROM_TYPE, Float32Array, f32), + DataType::Float64 => cast_column!($INDEX, $FROM_TYPE, Float64Array, f64), _ => unimplemented!(), } }}; diff --git a/rust/datafusion/src/execution/filter.rs b/rust/datafusion/src/execution/filter.rs index 9fe23edd6a5f..ba20dca036e5 100644 --- a/rust/datafusion/src/execution/filter.rs +++ b/rust/datafusion/src/execution/filter.rs @@ -21,7 +21,7 @@ use std::cell::RefCell; use std::rc::Rc; use std::sync::Arc; -use arrow::array::{Array, ArrayRef, BinaryArray, BooleanArray, Float64Array}; +use arrow::array::*; use arrow::datatypes::{DataType, Schema}; use arrow::record_batch::RecordBatch; @@ -89,7 +89,98 @@ impl Relation for FilterRelation { fn filter(array: &Arc, filter: &BooleanArray) -> Result { let a = array.as_ref(); + //TODO use macros match a.data_type() { + DataType::UInt8 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = UInt8Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::UInt16 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = UInt16Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::UInt32 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = UInt32Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::UInt64 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = UInt64Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::Int8 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = Int8Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::Int16 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = Int16Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::Int32 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = Int32Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::Int64 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = Int64Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } + DataType::Float32 => { + let b = a.as_any().downcast_ref::().unwrap(); + let mut builder = Float32Array::builder(b.len()); + for i in 0..b.len() { + if filter.value(i) { + builder.append_value(b.value(i))?; + } + } + Ok(Arc::new(builder.finish())) + } DataType::Float64 => { let b = a.as_any().downcast_ref::().unwrap(); let mut builder = Float64Array::builder(b.len()); diff --git a/rust/datafusion/src/execution/projection.rs b/rust/datafusion/src/execution/projection.rs index c49298e2782f..c4b757af8880 100644 --- a/rust/datafusion/src/execution/projection.rs +++ b/rust/datafusion/src/execution/projection.rs @@ -89,12 +89,23 @@ mod tests { #[test] fn project_first_column() { - let schema = Arc::new(Schema::new(vec![ - Field::new("city", DataType::Utf8, false), - Field::new("lat", DataType::Float64, false), - Field::new("lon", DataType::Float64, false), - ])); - let ds = CsvDataSource::new("test/data/uk_cities.csv", schema.clone(), 1024); + let schema = + Arc::new(Schema::new(vec![ + Field::new("c1", DataType::Utf8, false), + Field::new("c2", DataType::UInt32, false), + Field::new("c3", DataType::Int8, false), + Field::new("c3", DataType::Int16, false), + Field::new("c4", DataType::Int32, false), + Field::new("c5", DataType::Int64, false), + Field::new("c6", DataType::UInt8, false), + Field::new("c7", DataType::UInt16, false), + Field::new("c8", DataType::UInt32, false), + Field::new("c9", DataType::UInt64, false), + Field::new("c10", DataType::Float32, false), + Field::new("c11", DataType::Float64, false), + Field::new("c12", DataType::Utf8, false), + ])); + let ds = CsvDataSource::new("test/data/aggregate_test_100.csv", schema.clone(), 1024); let relation = Rc::new(RefCell::new(DataSourceRelation::new(Rc::new( RefCell::new(ds), )))); @@ -110,7 +121,7 @@ mod tests { let batch = projection.next().unwrap().unwrap(); assert_eq!(1, batch.num_columns()); - assert_eq!("city", batch.schema().field(0).name()); + assert_eq!("c1", batch.schema().field(0).name()); } } diff --git a/rust/datafusion/test/data/aggregate_test_1.csv b/rust/datafusion/test/data/aggregate_test_1.csv deleted file mode 100644 index 4712c773041b..000000000000 --- a/rust/datafusion/test/data/aggregate_test_1.csv +++ /dev/null @@ -1,8 +0,0 @@ -a,b -1,2.2 -1,1.1 -2,4.4 -2,5.5 -2,3.3 -3,1.0 -3,2.0 diff --git a/rust/datafusion/test/data/aggregate_test_100.csv b/rust/datafusion/test/data/aggregate_test_100.csv new file mode 100644 index 000000000000..e548b758bf54 --- /dev/null +++ b/rust/datafusion/test/data/aggregate_test_100.csv @@ -0,0 +1,101 @@ +c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 +c,2,1,18109,2033001162,-6513304855495910254,25,43062,1491205016,5863949479783605708,0.110830784,0.9294097332465232,6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW +d,5,-40,22614,706441268,-7542719935673075327,155,14337,3373581039,11720144131976083864,0.69632107,0.3114712539863804,C2GT5KVyOPZpgKVl110TyZO0NcJ434 +b,1,29,-18218,994303988,5983957848665088916,204,9489,3275293996,14857091259186476033,0.53840446,0.17909035118828576,AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz +a,1,-85,-15154,1171968280,1919439543497968449,77,52286,774637006,12101411955859039553,0.12285209,0.6864391962767343,0keZ5G8BffGwgF2RwQD59TFzMStxCB +b,5,-82,22080,1824882165,7373730676428214987,208,34331,3342719438,3330177516592499461,0.82634634,0.40975383525297016,Ig1QcuKsjHXkproePdERo2w0mYzIqd +b,4,-111,-1967,-4229382,1892872227362838079,67,9832,1243785310,8382489916947120498,0.06563997,0.152498292971736,Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH +e,3,104,-25136,1738331255,300633854973581194,139,20807,3577318119,13079037564113702254,0.40154034,0.7764360990307122,DuJNG8tufSqW0ZstHqWj3aGvFLMg4A +a,3,13,12613,1299719633,2020498574254265315,191,17835,3998790955,14881411008939145569,0.041445434,0.8813167497816289,Amn2K87Db5Es3dFQO9cw9cvpAM6h35 +d,1,38,18384,-335410409,-1632237090406591229,26,57510,2712615025,1842662804748246269,0.6064476,0.6404495093354053,4HX6feIvmNXBN7XGqgO4YVBkhu8GDI +a,4,-38,20744,762932956,308913475857409919,7,45465,1787652631,878137512938218976,0.7459874,0.02182578039211991,ydkwycaISlYSlEq3TlkS2m15I2pcp8 +d,1,57,28781,-1143802338,2662536767954229885,202,62167,879082834,4338034436871150616,0.7618384,0.42950521730777025,VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4 +a,4,-54,-2376,434021400,5502271306323260832,113,15777,2502326480,7966148640299601101,0.5720931,0.30585375151301186,KJFcmTVjdkCMv94wYCtfHMFhzyRsmH +e,3,112,-6823,-421042466,8535335158538929274,129,32712,3759340273,9916295859593918600,0.6424343,0.6316565296547284,BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE +d,2,113,3917,-108973366,-7220140168410319165,197,24380,63044568,4225581724448081782,0.11867094,0.2944158618048994,90gAtmGEeIqUTbo1ZrxCvWtsseukXC +b,1,54,-18410,1413111008,-7145106120930085900,249,5382,1842680163,17818611040257178339,0.8881188,0.24899794314659673,6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ +c,1,103,-22186,431378678,1346564663822463162,146,12393,3766999078,10901819591635583995,0.064453244,0.7784918983501654,2T3wSlHdEmASmO0xcXHnndkKEt6bz8 +e,2,49,24495,-587831330,9178511478067509438,129,12757,1289293657,10948666249269100825,0.5610077,0.5991138115095911,bgK1r6v3BCTh0aejJUhkA1Hn6idXGp +d,1,-98,13630,-1991133944,1184110014998006843,220,2986,225513085,9634106610243643486,0.89651865,0.1640882545084913,y7C453hRWd4E7ImjNDWlpexB8nUqjh +d,3,77,15091,-1302295658,8795481303066536947,154,35477,2093538928,17419098323248948387,0.11952883,0.7035635283169166,O66j6PaYuZhEUtqV6fuU7TyjM2WxC5 +e,2,97,18167,1593800404,-9112448817105133638,163,45185,3188005828,2792105417953811674,0.38175434,0.4094218353587008,ukOiFGGFnQJDHFgZxHMpvhD3zybF0M +e,4,-56,-31500,1544188174,3096047390018154410,220,417,557517119,2774306934041974261,0.15459597,0.19113293583306745,IZTkHMLvIKuiLjhDjYMmIHxh166we4 +d,1,-99,5613,1213926989,-8863698443222021480,19,18736,4216440507,14933742247195536130,0.6067944,0.33639590659276175,aDxBtor7Icd9C5hnTvvw5NrIre740e +a,5,36,-16974,623103518,6834444206535996609,71,29458,141047417,17448660630302620693,0.17100024,0.04429073092078406,OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh +e,4,-53,13788,2064155045,-691093532952651300,243,35106,2778168728,9463973906560740422,0.34515214,0.27159190516490006,0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm +c,2,-29,25305,-537142430,-7683452043175617798,150,31648,598822671,11759014161799384683,0.8315913,0.946325164889271,9UbObCsVkmYpJGcGrgfK90qOnwb2Lj +a,1,-25,15295,383352709,4980135132406487265,231,102,3276123488,12763583666216333412,0.53796273,0.17592486905979987,XemNcT1xp61xcM1Qz3wZ1VECCnq06O +c,4,123,16620,852509237,-3087630526856906991,196,33715,3566741189,4546434653720168472,0.07606989,0.819715865079681,8LIh0b6jmDGm87BmIyjdxNIpX4ugjD +a,5,-31,-12907,586844478,-4862189775214031241,170,28086,1013876852,11005002152861474932,0.35319167,0.05573662213439634,MeSTAXq8gVxVjbEjgkvU9YLte0X9uE +a,2,45,15673,-1899175111,398282800995316041,99,2555,145294611,8554426087132697832,0.17333257,0.6405262429561641,b3b9esRhTzFEawbs6XhpKnD9ojutHB +b,3,17,14457,670497898,-2390782464845307388,255,24770,1538863055,12662506238151717757,0.34077626,0.7614304100703713,6x93sxYioWuq5c9Kkk8oTAAORM7cH0 +e,4,97,-13181,2047637360,6176835796788944083,158,53000,2042457019,9726016502640071617,0.7085086,0.12357539988406441,oHJMNvWuunsIMIWFnYG31RCfkOo2V7 +c,2,-60,-16312,-1808210365,-3368300253197863813,71,39635,2844041986,7045482583778080653,0.805363,0.6425694115212065,BJqx5WokrmrrezZA0dUbleMYkG5U2O +e,1,36,-21481,-928766616,-3471238138418013024,150,52569,2610290479,7788847578701297242,0.2578469,0.7670021786149205,gpo8K5qtYePve6jyPt6xgJx4YOVjms +b,5,-5,24896,1955646088,2430204191283109071,118,43655,2424630722,11429640193932435507,0.87989986,0.7328050041291218,JafwVLSVk5AVoXFuzclesQ000EE2k1 +a,3,13,32064,912707948,3826618523497875379,42,21463,2214035726,10771380284714693539,0.6133468,0.7325106678655877,i6RQVXKUh7MzuGMDaNclUYnFUAireU +c,1,41,-4667,-644225469,7049620391314639084,196,48099,2125812933,15419512479294091215,0.5780736,0.9255031346434324,mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS +d,2,93,-12642,2053379412,6468763445799074329,147,50842,1000948272,5536487915963301239,0.4279275,0.28534428578703896,lqhzgLsXZ8JhtpeeUWWNbMz8PHI705 +c,3,73,-9565,-382483011,1765659477910680019,186,1535,1088543984,2906943497598597237,0.680652,0.6009475544728957,Ow5PGpfTm4dXCfTDsXAOTatXRoAydR +c,3,-2,-18655,-2141999138,-3154042970870838072,251,34970,3862393166,13062025193350212516,0.034291923,0.7697753383420857,IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr +c,3,22,13741,-2098805236,8604102724776612452,45,2516,1362369177,196777795886465166,0.94669616,0.0494924465469434,6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE +b,2,63,21456,-2138770630,-2380041687053733364,181,57594,2705709344,13144161537396946288,0.09683716,0.3051364088814128,nYVJnVicpGRqKZibHyBAmtmzBXAFfT +d,4,102,-24558,1991172974,-7823479531661596016,14,36599,1534194097,2240998421986827216,0.028003037,0.8824879447595726,0og6hSkhbX8AC1ktFS4kounvTzy8Vo +d,1,-8,27138,-1383162419,7682021027078563072,36,64517,2861376515,9904216782086286050,0.80954456,0.9463098243875633,AFGCj7OWlEB5QfniEFgonMq90Tq5uH +a,3,17,-22796,1337043149,-1282905594104562444,167,2809,754775609,732272194388185106,0.3884129,0.658671129040488,VDhtJkYjAYPykCgOU9x3v7v3t4SO1a +e,2,52,23388,715235348,605432070100399212,165,56980,3314983189,7386391799827871203,0.46076488,0.980809631269599,jQimhdepw3GKmioWUlVSWeBVRKFkY3 +b,5,68,21576,1188285940,5717755781990389024,224,27600,974297360,9865419128970328044,0.80895734,0.7973920072996036,ioEncce3mPOXD2hWhpZpCPWGATG6GU +b,2,31,23127,-800561771,-8706387435232961848,153,27034,1098639440,3343692635488765507,0.35692692,0.5590205548347534,okOkcWflkNXIy4R8LzmySyY1EC3sYd +c,1,-24,-24085,-1882293856,7385529783747709716,41,48048,520189543,2402288956117186783,0.39761502,0.3600766362333053,Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u +a,4,65,-28462,-1813935549,7602389238442209730,18,363,1865307672,11378396836996498283,0.09130204,0.5593249815276734,WHmjWk2AY4c6m7DA4GitUx6nmb1yYS +d,1,125,31106,-1176490478,-4306856842351827308,90,17910,3625286410,17869394731126786457,0.8882508,0.7631239070049998,dVdvo6nUD5FgCgsbOZLds28RyGTpnx +b,4,17,-28070,-673237643,1904316899655860234,188,27744,933879086,3732692885824435932,0.41860116,0.40342283197779727,JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ +c,2,-106,-1114,-1927628110,1080308211931669384,177,20421,141680161,7464432081248293405,0.56749094,0.565352842229935,Vp3gmWunM5A7wOC9YW2JroFqTWjvTi +d,5,-59,2045,-2117946883,1170799768349713170,189,63353,1365198901,2501626630745849169,0.75173044,0.18628859265874176,F7NSTjWvQJyBburN7CXRUlbgp2dIrA +d,4,55,-1471,1902023838,1252101628560265705,157,3691,811650497,1524771507450695976,0.2968701,0.5437595540422571,f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX +b,2,-60,-21739,-1908480893,-8897292622858103761,59,50009,2525744318,1719090662556698549,0.52930677,0.560333188635217,l7uwDoTepWwnAP0ufqtHJS3CRi7RfP +d,3,-76,8809,141218956,-9110406195556445909,58,5494,1824517658,12046662515387914426,0.8557294,0.6668423897406515,Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK +e,4,73,-22501,1282464673,2541794052864382235,67,21119,538589788,9575476605699527641,0.48515016,0.296036538664718,4JznSdBajNWhu4hRQwjV1FjTTxY68i +b,4,-117,19316,2051224722,-5534418579506232438,133,52046,3023531799,13684453606722360110,0.62608826,0.8506721053047003,mhjME0zBHbrK6NMkytMTQzOssOa1gF +a,4,-101,11640,1993193190,2992662416070659899,230,40566,466439833,16778113360088370541,0.3991115,0.574210838214554,NEhyk8uIx4kEULJGa8qIyFjjBcP2G6 +b,5,62,16337,41423756,-2274773899098124524,121,34206,2307004493,10575647935385523483,0.23794776,0.1754261586710173,qnPOOmslCJaT45buUisMRnM0rc77EK +c,4,-79,5281,-237425046,373011991904079451,121,55620,2818832252,2464584078983135763,0.49774808,0.9237877978193884,t6fQUjJejPcjc04wHvHTPe55S65B4V +b,2,68,15874,49866617,1179733259727844435,121,23948,3455216719,3898128009708892708,0.6306253,0.9185813970744787,802bgTGl6Bk5TlkPYYTxp5JkKyaYUA +c,1,70,27752,1325868318,1241882478563331892,63,61637,473294098,4976799313755010034,0.13801557,0.5081765563442366,Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn +e,2,-61,-2888,-1660426473,2553892468492435401,126,35429,4144173353,939909697866979632,0.4405142,0.9231889896940375,BPtQMxnuSPpxMExYV9YkDa6cAN7GP3 +e,4,74,-12612,-1885422396,1702850374057819332,130,3583,3198969145,10767179755613315144,0.5518061,0.5614503754617461,QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv +d,2,122,10130,-168758331,-3179091803916845592,30,794,4061635107,15695681119022625322,0.69592506,0.9748360509016578,OPwBqCEK5PWTjWaiOyL45u2NLTaDWv +e,3,71,194,1436496767,-5639533800082367925,158,44507,3105312559,3998472996619161534,0.930117,0.6108938307533,pTeu0WMjBRTaNRT15rLCuEh3tBJVc5 +c,5,-94,-15880,2025611582,-3348824099853919681,5,40622,4268716378,12849419495718510869,0.34163946,0.4830878559436823,RilTlL1tKkPOUFuzmLydHAVZwv1OGl +d,1,-72,25590,1188089983,3090286296481837049,241,832,3542840110,5885937420286765261,0.41980565,0.21535402343780985,wwXqSGKLyBQyPkonlzBNYUJTCo4LRS +e,1,71,-5479,-1339586153,-3920238763788954243,123,53012,4229654142,10297218950720052365,0.73473036,0.5773498217058918,cBGc0kSm32ylBDnxogG727C0uhZEYZ +e,4,96,-30336,427197269,7506304308750926996,95,48483,3521368277,5437030162957481122,0.58104324,0.42073125331890115,3BEOHQsMEFZ58VcNTOJYShTBpAPzbt +a,2,-48,-18025,439738328,-313657814587041987,222,13763,3717551163,9135746610908713318,0.055064857,0.9800193410444061,ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8 +a,1,-56,8692,2106705285,-7811675384226570375,231,15573,1454057357,677091006469429514,0.42794758,0.2739938529235548,JN0VclewmjwYlSl8386MlWv5rEhWCz +e,2,52,-12056,-1090239422,9011500141803970147,238,4168,2013662838,12565360638488684051,0.6694766,0.39144436569161134,xipQ93429ksjNcXPX5326VSg1xJZcW +a,1,-5,12636,794623392,2909750622865366631,15,24022,2669374863,4776679784701509574,0.29877836,0.2537253407987472,waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs +b,1,12,7652,-1448995523,-5332734971209541785,136,49283,4076864659,15449267433866484283,0.6214579,0.05636955101974106,akiiY5N0I44CMwEnBL6RTBk7BRkxEj +e,5,64,-26526,1689098844,8950618259486183091,224,45253,662099130,16127995415060805595,0.2897315,0.5759450483859969,56MZa5O1hVtX4c5sbnCfxuX5kDChqI +c,4,-90,-2935,1579876740,6733733506744649678,254,12876,3593959807,4094315663314091142,0.5708688,0.5603062368164834,Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV +e,5,-86,32514,-467659022,-8012578250188146150,254,2684,2861911482,2126626171973341689,0.12559289,0.01479305307777301,gxfHWUF8XgY2KdFxigxvNEXe2V2XMl +c,2,-117,-30187,-1222533990,-191957437217035800,136,47061,2293105904,12659011877190539078,0.2047385,0.9706712283358269,pLk3i59bZwd5KBZrI1FiweYTd5hteG +a,3,14,28162,397430452,-452851601758273256,57,14722,431948861,8164671015278284913,0.40199697,0.07260475960924484,TtDKUZxzVxsq758G6AWPSYuZgVgbcl +c,2,29,-3855,1354539333,4742062657200940467,81,53815,3398507249,562977550464243101,0.7124534,0.991517828651004,Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0 +b,4,-59,25286,1423957796,2646602445954944051,0,61069,3570297463,15100310750150419896,0.49619365,0.04893135681998029,fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG +a,1,83,-14704,2143473091,-4387559599038777245,37,829,4015442341,4602675983996931623,0.89542526,0.9567595541247681,ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU +a,3,-12,-9168,1489733240,-1569376002217735076,206,33821,3959216334,16060348691054629425,0.9488028,0.9293883502480845,oLZ21P2JEDooxV1pU31cIxQHEeeoLu +c,4,3,-30508,659422734,-6455460736227846736,133,59663,2306130875,8622584762448622224,0.16999894,0.4273123318932347,EcCuckwsF3gV1Ecgmh5v4KM8g1ozif +a,3,-72,-11122,-2141451704,-2578916903971263854,83,30296,1995343206,17452974532402389080,0.94209343,0.3231750610081745,e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG +c,2,-107,-2904,-1011669561,782342092880993439,18,29527,1157161427,4403623840168496677,0.31988364,0.36936304600612724,QYlaIAnJA6r8rlAb6f59wcxvcPcWFf +c,5,118,19208,-134213907,-2120241105523909127,86,57751,1229567292,16493024289408725403,0.5536642,0.9723580396501548,TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX +c,3,97,29106,-903316089,2874859437662206732,207,42171,3473924576,8188072741116415408,0.32792538,0.2667177795079635,HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g +b,3,-101,-13217,-346989627,5456800329302529236,26,54276,243203849,17929716297117857676,0.05422181,0.09465635123783445,MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ +a,2,-43,13080,370975815,5881039805148485053,2,20120,2939920218,906367167997372130,0.42733806,0.16301110515739792,m6jD0LBIQWaMfenwRCTANI9eOdyyto +a,5,-101,-12484,-842693467,-6140627905445351305,57,57885,2496054700,2243924747182709810,0.59520596,0.9491397432856566,QJYm7YRA3YetcBHI5wkMZeLXVmfuNy +b,5,-44,15788,-629486480,5822642169425315613,13,11872,3457053821,2413406423648025909,0.44318348,0.32869374687050157,ALuRhobVWbnQTTWZdSOk0iVe8oYFhW +d,4,5,-7688,702611616,6239356364381313700,4,39363,3126475872,35363005357834672,0.3766935,0.061029375346466685,H5j5ZHy1FGesOAHjkQEDYCucbpKWRu +e,1,120,10837,-1331533190,6342019705133850847,245,3975,2830981072,16439861276703750332,0.6623719,0.9965400387585364,LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW +e,3,-95,13611,2030965207,927403809957470678,119,59134,559847112,10966649192992996919,0.5301289,0.047343434291126085,gTpyQnEODMcpsPnJMZC66gh33i3m0b +d,3,123,29533,240273900,1176001466590906949,117,30972,2592330556,12883447461717956514,0.39075065,0.38870280983958583,1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO +b,4,47,20690,-1009656194,-2027442591571700798,200,7781,326151275,2881913079548128905,0.57360977,0.2145232647388039,52mKlRE3aHCBZtjECq6sY9OqVf8Dze +e,4,30,-16110,61035129,-3356533792537910152,159,299,28774375,13526465947516666293,0.6999775,0.03968347085780355,cq4WSAIFwx3wwTUS5bp1wCe71R6U5I \ No newline at end of file diff --git a/rust/datafusion/test/data/aggregate_test_2.csv b/rust/datafusion/test/data/aggregate_test_2.csv deleted file mode 100644 index c9215495ca94..000000000000 --- a/rust/datafusion/test/data/aggregate_test_2.csv +++ /dev/null @@ -1,8 +0,0 @@ -a,b -"one",2.2 -"one",1.1 -"two",4.4 -"two",5.5 -"two",3.3 -"three",1.0 -"three",2.0 diff --git a/rust/datafusion/test/data/uk_cities.csv b/rust/datafusion/test/data/uk_cities.csv deleted file mode 100644 index 1dceb220cde0..000000000000 --- a/rust/datafusion/test/data/uk_cities.csv +++ /dev/null @@ -1,3 +0,0 @@ -City,Lat,Lon -"London, UK",51.507222,-0.1275 -"Manchester, UK",53.479444,-2.245278 diff --git a/rust/datafusion/tests/sql.rs b/rust/datafusion/tests/sql.rs index 2e809c815378..fbbad3b01bb1 100644 --- a/rust/datafusion/tests/sql.rs +++ b/rust/datafusion/tests/sql.rs @@ -32,63 +32,71 @@ use datafusion::execution::relation::Relation; #[test] fn csv_query_with_predicate() { let mut ctx = ExecutionContext::new(); - register_cities_csv(&mut ctx); + register_aggregate_csv(&mut ctx); let sql = - "SELECT city, lat, lng, lat + lng FROM cities WHERE lat > 51.0 AND lat < 53"; + "SELECT c1, c12 FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4"; let actual = execute(&mut ctx, sql); - let expected= "\"London, UK\"\t51.507222\t-0.1275\t51.379722\n".to_string(); + let expected= "\"e\"\t0.39144436569161134\n\"d\"\t0.38870280983958583\n".to_string(); assert_eq!(expected, actual); } #[test] fn csv_query_group_by_int_min_max() { let mut ctx = ExecutionContext::new(); - let schema = Arc::new(Schema::new(vec![ - Field::new("a", DataType::Int32, false), - Field::new("b", DataType::Float64, false), - ])); - register_csv(&mut ctx, "t1", "test/data/aggregate_test_1.csv", &schema); + let schema = aggr_test_schema(); + register_aggregate_csv(&mut ctx); //TODO add ORDER BY once supported, to make this test determistic - let sql = "SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a"; + let sql = "SELECT c2, MIN(c12), MAX(c12) FROM aggregate_test_100 GROUP BY c2"; let actual = execute(&mut ctx, sql); - let expected = "2\t3.3\t5.5\n3\t1.0\t2.0\n1\t1.1\t2.2\n".to_string(); + let expected = "4\t0.02182578039211991\t0.9237877978193884\n2\t0.16301110515739792\t0.991517828651004\n5\t0.01479305307777301\t0.9723580396501548\n3\t0.047343434291126085\t0.9293883502480845\n1\t0.05636955101974106\t0.9965400387585364\n".to_string(); assert_eq!(expected, actual); } #[test] fn csv_query_group_by_string_min_max() { let mut ctx = ExecutionContext::new(); - let schema = Arc::new(Schema::new(vec![ - Field::new("a", DataType::Utf8, false), - Field::new("b", DataType::Float64, false), - ])); - register_csv(&mut ctx, "t1", "test/data/aggregate_test_2.csv", &schema); + let schema = aggr_test_schema(); + register_aggregate_csv(&mut ctx); //TODO add ORDER BY once supported, to make this test determistic - let sql = "SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a"; + let sql = "SELECT c2, MIN(c12), MAX(c12) FROM aggregate_test_100 GROUP BY c1"; let actual = execute(&mut ctx, sql); let expected = - "\"three\"\t1.0\t2.0\n\"two\"\t3.3\t5.5\n\"one\"\t1.1\t2.2\n".to_string(); + "\"d\"\t0.061029375346466685\t0.9748360509016578\n\"c\"\t0.0494924465469434\t0.991517828651004\n\"b\"\t0.04893135681998029\t0.9185813970744787\n\"a\"\t0.02182578039211991\t0.9800193410444061\n\"e\"\t0.01479305307777301\t0.9965400387585364\n".to_string(); assert_eq!(expected, actual); } #[test] fn csv_query_cast() { let mut ctx = ExecutionContext::new(); - register_cities_csv(&mut ctx); - let sql = "SELECT CAST(lat AS int) FROM cities"; + register_aggregate_csv(&mut ctx); + let sql = "SELECT CAST(c12 AS float) FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4"; let actual = execute(&mut ctx, sql); - let expected= "51\n53\n".to_string(); + let expected= "0.39144436569161134\n0.38870280983958583\n".to_string(); assert_eq!(expected, actual); } -fn register_cities_csv(ctx: &mut ExecutionContext) { - let schema = Arc::new(Schema::new(vec![ - Field::new("city", DataType::Utf8, false), - Field::new("lat", DataType::Float64, false), - Field::new("lng", DataType::Float64, false), - ])); +fn aggr_test_schema() -> Arc { + Arc::new(Schema::new(vec![ + Field::new("c1", DataType::Utf8, false), + Field::new("c2", DataType::UInt32, false), + Field::new("c3", DataType::Int8, false), + Field::new("c4", DataType::Int16, false), + Field::new("c5", DataType::Int32, false), + Field::new("c6", DataType::Int64, false), + Field::new("c7", DataType::UInt8, false), + Field::new("c8", DataType::UInt16, false), + Field::new("c9", DataType::UInt32, false), + Field::new("c10", DataType::UInt64, false), + Field::new("c11", DataType::Float32, false), + Field::new("c12", DataType::Float64, false), + Field::new("c13", DataType::Utf8, false), + ])) +} + - register_csv(ctx, "cities", "test/data/uk_cities.csv", &schema); +fn register_aggregate_csv(ctx: &mut ExecutionContext) { + let schema = aggr_test_schema(); + register_csv(ctx, "aggregate_test_100", "test/data/aggregate_test_100.csv", &schema); } fn register_csv( @@ -119,10 +127,38 @@ fn result_str(results: &Rc>) -> String { let column = batch.column(column_index); match column.data_type() { + DataType::Int8 => { + let array = column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } + DataType::Int16 => { + let array = column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } DataType::Int32 => { let array = column.as_any().downcast_ref::().unwrap(); str.push_str(&format!("{:?}", array.value(row_index))); } + DataType::Int64 => { + let array = column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } + DataType::UInt8 => { + let array = column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } + DataType::UInt16 => { + let array = column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } + DataType::UInt32 => { + let array = column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } + DataType::UInt64 => { + let array = column.as_any().downcast_ref::().unwrap(); + str.push_str(&format!("{:?}", array.value(row_index))); + } DataType::Float32 => { let array = column.as_any().downcast_ref::().unwrap(); From 4ebeee59fc29131606f23b72b1aea7be3d16a720 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Sat, 2 Feb 2019 09:27:08 -0700 Subject: [PATCH 07/12] formatting --- rust/datafusion/src/execution/projection.rs | 34 ++++++++++----------- rust/datafusion/tests/sql.rs | 24 +++++++++------ 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/rust/datafusion/src/execution/projection.rs b/rust/datafusion/src/execution/projection.rs index c4b757af8880..de480f0237b7 100644 --- a/rust/datafusion/src/execution/projection.rs +++ b/rust/datafusion/src/execution/projection.rs @@ -89,23 +89,23 @@ mod tests { #[test] fn project_first_column() { - let schema = - Arc::new(Schema::new(vec![ - Field::new("c1", DataType::Utf8, false), - Field::new("c2", DataType::UInt32, false), - Field::new("c3", DataType::Int8, false), - Field::new("c3", DataType::Int16, false), - Field::new("c4", DataType::Int32, false), - Field::new("c5", DataType::Int64, false), - Field::new("c6", DataType::UInt8, false), - Field::new("c7", DataType::UInt16, false), - Field::new("c8", DataType::UInt32, false), - Field::new("c9", DataType::UInt64, false), - Field::new("c10", DataType::Float32, false), - Field::new("c11", DataType::Float64, false), - Field::new("c12", DataType::Utf8, false), - ])); - let ds = CsvDataSource::new("test/data/aggregate_test_100.csv", schema.clone(), 1024); + let schema = Arc::new(Schema::new(vec![ + Field::new("c1", DataType::Utf8, false), + Field::new("c2", DataType::UInt32, false), + Field::new("c3", DataType::Int8, false), + Field::new("c3", DataType::Int16, false), + Field::new("c4", DataType::Int32, false), + Field::new("c5", DataType::Int64, false), + Field::new("c6", DataType::UInt8, false), + Field::new("c7", DataType::UInt16, false), + Field::new("c8", DataType::UInt32, false), + Field::new("c9", DataType::UInt64, false), + Field::new("c10", DataType::Float32, false), + Field::new("c11", DataType::Float64, false), + Field::new("c12", DataType::Utf8, false), + ])); + let ds = + CsvDataSource::new("test/data/aggregate_test_100.csv", schema.clone(), 1024); let relation = Rc::new(RefCell::new(DataSourceRelation::new(Rc::new( RefCell::new(ds), )))); diff --git a/rust/datafusion/tests/sql.rs b/rust/datafusion/tests/sql.rs index fbbad3b01bb1..6ce77d45d0eb 100644 --- a/rust/datafusion/tests/sql.rs +++ b/rust/datafusion/tests/sql.rs @@ -33,10 +33,9 @@ use datafusion::execution::relation::Relation; fn csv_query_with_predicate() { let mut ctx = ExecutionContext::new(); register_aggregate_csv(&mut ctx); - let sql = - "SELECT c1, c12 FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4"; + let sql = "SELECT c1, c12 FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4"; let actual = execute(&mut ctx, sql); - let expected= "\"e\"\t0.39144436569161134\n\"d\"\t0.38870280983958583\n".to_string(); + let expected = "\"e\"\t0.39144436569161134\n\"d\"\t0.38870280983958583\n".to_string(); assert_eq!(expected, actual); } @@ -71,7 +70,7 @@ fn csv_query_cast() { register_aggregate_csv(&mut ctx); let sql = "SELECT CAST(c12 AS float) FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4"; let actual = execute(&mut ctx, sql); - let expected= "0.39144436569161134\n0.38870280983958583\n".to_string(); + let expected = "0.39144436569161134\n0.38870280983958583\n".to_string(); assert_eq!(expected, actual); } @@ -93,10 +92,14 @@ fn aggr_test_schema() -> Arc { ])) } - fn register_aggregate_csv(ctx: &mut ExecutionContext) { let schema = aggr_test_schema(); - register_csv(ctx, "aggregate_test_100", "test/data/aggregate_test_100.csv", &schema); + register_csv( + ctx, + "aggregate_test_100", + "test/data/aggregate_test_100.csv", + &schema, + ); } fn register_csv( @@ -148,15 +151,18 @@ fn result_str(results: &Rc>) -> String { str.push_str(&format!("{:?}", array.value(row_index))); } DataType::UInt16 => { - let array = column.as_any().downcast_ref::().unwrap(); + let array = + column.as_any().downcast_ref::().unwrap(); str.push_str(&format!("{:?}", array.value(row_index))); } DataType::UInt32 => { - let array = column.as_any().downcast_ref::().unwrap(); + let array = + column.as_any().downcast_ref::().unwrap(); str.push_str(&format!("{:?}", array.value(row_index))); } DataType::UInt64 => { - let array = column.as_any().downcast_ref::().unwrap(); + let array = + column.as_any().downcast_ref::().unwrap(); str.push_str(&format!("{:?}", array.value(row_index))); } DataType::Float32 => { From 91f6e90d41376b7eb83efa8373154848fda7f9d2 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Sat, 2 Feb 2019 09:32:07 -0700 Subject: [PATCH 08/12] update example to use new data file --- rust/datafusion/examples/csv_sql.rs | 39 ++++++++++++++++------------- rust/datafusion/tests/sql.rs | 2 -- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/rust/datafusion/examples/csv_sql.rs b/rust/datafusion/examples/csv_sql.rs index 2ea70dc81102..3face05f568f 100644 --- a/rust/datafusion/examples/csv_sql.rs +++ b/rust/datafusion/examples/csv_sql.rs @@ -35,18 +35,28 @@ fn main() { // define schema for data source (csv file) let schema = Arc::new(Schema::new(vec![ - Field::new("city", DataType::Utf8, false), - Field::new("lat", DataType::Float64, false), - Field::new("lng", DataType::Float64, false), + Field::new("c1", DataType::Utf8, false), + Field::new("c2", DataType::UInt32, false), + Field::new("c3", DataType::Int8, false), + Field::new("c4", DataType::Int16, false), + Field::new("c5", DataType::Int32, false), + Field::new("c6", DataType::Int64, false), + Field::new("c7", DataType::UInt8, false), + Field::new("c8", DataType::UInt16, false), + Field::new("c9", DataType::UInt32, false), + Field::new("c10", DataType::UInt64, false), + Field::new("c11", DataType::Float32, false), + Field::new("c12", DataType::Float64, false), + Field::new("c13", DataType::Utf8, false), ])); // register csv file with the execution context let csv_datasource = - CsvDataSource::new("test/data/uk_cities.csv", schema.clone(), 1024); - ctx.register_datasource("cities", Rc::new(RefCell::new(csv_datasource))); + CsvDataSource::new("test/data/aggregate_test_100.csv", schema.clone(), 1024); + ctx.register_datasource("aggregate_test_100", Rc::new(RefCell::new(csv_datasource))); // simple projection and selection - let sql = "SELECT city, lat, lng FROM cities WHERE lat > 51.0 AND lat < 53"; + let sql = "SELECT c1, MIN(c12), MAX(c12) FROM aggregate_test_100 WHERE c11 > 0.1 AND c11 < 0.9 GROUP BY c1"; // execute the query let relation = ctx.sql(&sql).unwrap(); @@ -61,33 +71,28 @@ fn main() { batch.num_columns() ); - let city = batch + let c1 = batch .column(0) .as_any() .downcast_ref::() .unwrap(); - let lat = batch + let min = batch .column(1) .as_any() .downcast_ref::() .unwrap(); - let lng = batch + let max = batch .column(2) .as_any() .downcast_ref::() .unwrap(); for i in 0..batch.num_rows() { - let city_name: String = String::from_utf8(city.value(i).to_vec()).unwrap(); - - println!( - "City: {}, Latitude: {}, Longitude: {}", - city_name, - lat.value(i), - lng.value(i), - ); + let c1_value: String = String::from_utf8(c1.value(i).to_vec()).unwrap(); + + println!("{}, Min: {}, Max: {}", c1_value, min.value(i), max.value(i),); } } } diff --git a/rust/datafusion/tests/sql.rs b/rust/datafusion/tests/sql.rs index 6ce77d45d0eb..e86d2ac88614 100644 --- a/rust/datafusion/tests/sql.rs +++ b/rust/datafusion/tests/sql.rs @@ -42,7 +42,6 @@ fn csv_query_with_predicate() { #[test] fn csv_query_group_by_int_min_max() { let mut ctx = ExecutionContext::new(); - let schema = aggr_test_schema(); register_aggregate_csv(&mut ctx); //TODO add ORDER BY once supported, to make this test determistic let sql = "SELECT c2, MIN(c12), MAX(c12) FROM aggregate_test_100 GROUP BY c2"; @@ -54,7 +53,6 @@ fn csv_query_group_by_int_min_max() { #[test] fn csv_query_group_by_string_min_max() { let mut ctx = ExecutionContext::new(); - let schema = aggr_test_schema(); register_aggregate_csv(&mut ctx); //TODO add ORDER BY once supported, to make this test determistic let sql = "SELECT c2, MIN(c12), MAX(c12) FROM aggregate_test_100 GROUP BY c1"; From 16e4cffeae9aca1de7b59890aa018a47a065bdb4 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Mon, 4 Feb 2019 09:13:47 -0700 Subject: [PATCH 09/12] remove test csv file, update tests to use test data from new testing submodule --- .../test/data/aggregate_test_100.csv | 101 ------------------ 1 file changed, 101 deletions(-) delete mode 100644 rust/datafusion/test/data/aggregate_test_100.csv diff --git a/rust/datafusion/test/data/aggregate_test_100.csv b/rust/datafusion/test/data/aggregate_test_100.csv deleted file mode 100644 index e548b758bf54..000000000000 --- a/rust/datafusion/test/data/aggregate_test_100.csv +++ /dev/null @@ -1,101 +0,0 @@ -c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 -c,2,1,18109,2033001162,-6513304855495910254,25,43062,1491205016,5863949479783605708,0.110830784,0.9294097332465232,6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW -d,5,-40,22614,706441268,-7542719935673075327,155,14337,3373581039,11720144131976083864,0.69632107,0.3114712539863804,C2GT5KVyOPZpgKVl110TyZO0NcJ434 -b,1,29,-18218,994303988,5983957848665088916,204,9489,3275293996,14857091259186476033,0.53840446,0.17909035118828576,AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz -a,1,-85,-15154,1171968280,1919439543497968449,77,52286,774637006,12101411955859039553,0.12285209,0.6864391962767343,0keZ5G8BffGwgF2RwQD59TFzMStxCB -b,5,-82,22080,1824882165,7373730676428214987,208,34331,3342719438,3330177516592499461,0.82634634,0.40975383525297016,Ig1QcuKsjHXkproePdERo2w0mYzIqd -b,4,-111,-1967,-4229382,1892872227362838079,67,9832,1243785310,8382489916947120498,0.06563997,0.152498292971736,Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH -e,3,104,-25136,1738331255,300633854973581194,139,20807,3577318119,13079037564113702254,0.40154034,0.7764360990307122,DuJNG8tufSqW0ZstHqWj3aGvFLMg4A -a,3,13,12613,1299719633,2020498574254265315,191,17835,3998790955,14881411008939145569,0.041445434,0.8813167497816289,Amn2K87Db5Es3dFQO9cw9cvpAM6h35 -d,1,38,18384,-335410409,-1632237090406591229,26,57510,2712615025,1842662804748246269,0.6064476,0.6404495093354053,4HX6feIvmNXBN7XGqgO4YVBkhu8GDI -a,4,-38,20744,762932956,308913475857409919,7,45465,1787652631,878137512938218976,0.7459874,0.02182578039211991,ydkwycaISlYSlEq3TlkS2m15I2pcp8 -d,1,57,28781,-1143802338,2662536767954229885,202,62167,879082834,4338034436871150616,0.7618384,0.42950521730777025,VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4 -a,4,-54,-2376,434021400,5502271306323260832,113,15777,2502326480,7966148640299601101,0.5720931,0.30585375151301186,KJFcmTVjdkCMv94wYCtfHMFhzyRsmH -e,3,112,-6823,-421042466,8535335158538929274,129,32712,3759340273,9916295859593918600,0.6424343,0.6316565296547284,BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE -d,2,113,3917,-108973366,-7220140168410319165,197,24380,63044568,4225581724448081782,0.11867094,0.2944158618048994,90gAtmGEeIqUTbo1ZrxCvWtsseukXC -b,1,54,-18410,1413111008,-7145106120930085900,249,5382,1842680163,17818611040257178339,0.8881188,0.24899794314659673,6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ -c,1,103,-22186,431378678,1346564663822463162,146,12393,3766999078,10901819591635583995,0.064453244,0.7784918983501654,2T3wSlHdEmASmO0xcXHnndkKEt6bz8 -e,2,49,24495,-587831330,9178511478067509438,129,12757,1289293657,10948666249269100825,0.5610077,0.5991138115095911,bgK1r6v3BCTh0aejJUhkA1Hn6idXGp -d,1,-98,13630,-1991133944,1184110014998006843,220,2986,225513085,9634106610243643486,0.89651865,0.1640882545084913,y7C453hRWd4E7ImjNDWlpexB8nUqjh -d,3,77,15091,-1302295658,8795481303066536947,154,35477,2093538928,17419098323248948387,0.11952883,0.7035635283169166,O66j6PaYuZhEUtqV6fuU7TyjM2WxC5 -e,2,97,18167,1593800404,-9112448817105133638,163,45185,3188005828,2792105417953811674,0.38175434,0.4094218353587008,ukOiFGGFnQJDHFgZxHMpvhD3zybF0M -e,4,-56,-31500,1544188174,3096047390018154410,220,417,557517119,2774306934041974261,0.15459597,0.19113293583306745,IZTkHMLvIKuiLjhDjYMmIHxh166we4 -d,1,-99,5613,1213926989,-8863698443222021480,19,18736,4216440507,14933742247195536130,0.6067944,0.33639590659276175,aDxBtor7Icd9C5hnTvvw5NrIre740e -a,5,36,-16974,623103518,6834444206535996609,71,29458,141047417,17448660630302620693,0.17100024,0.04429073092078406,OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh -e,4,-53,13788,2064155045,-691093532952651300,243,35106,2778168728,9463973906560740422,0.34515214,0.27159190516490006,0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm -c,2,-29,25305,-537142430,-7683452043175617798,150,31648,598822671,11759014161799384683,0.8315913,0.946325164889271,9UbObCsVkmYpJGcGrgfK90qOnwb2Lj -a,1,-25,15295,383352709,4980135132406487265,231,102,3276123488,12763583666216333412,0.53796273,0.17592486905979987,XemNcT1xp61xcM1Qz3wZ1VECCnq06O -c,4,123,16620,852509237,-3087630526856906991,196,33715,3566741189,4546434653720168472,0.07606989,0.819715865079681,8LIh0b6jmDGm87BmIyjdxNIpX4ugjD -a,5,-31,-12907,586844478,-4862189775214031241,170,28086,1013876852,11005002152861474932,0.35319167,0.05573662213439634,MeSTAXq8gVxVjbEjgkvU9YLte0X9uE -a,2,45,15673,-1899175111,398282800995316041,99,2555,145294611,8554426087132697832,0.17333257,0.6405262429561641,b3b9esRhTzFEawbs6XhpKnD9ojutHB -b,3,17,14457,670497898,-2390782464845307388,255,24770,1538863055,12662506238151717757,0.34077626,0.7614304100703713,6x93sxYioWuq5c9Kkk8oTAAORM7cH0 -e,4,97,-13181,2047637360,6176835796788944083,158,53000,2042457019,9726016502640071617,0.7085086,0.12357539988406441,oHJMNvWuunsIMIWFnYG31RCfkOo2V7 -c,2,-60,-16312,-1808210365,-3368300253197863813,71,39635,2844041986,7045482583778080653,0.805363,0.6425694115212065,BJqx5WokrmrrezZA0dUbleMYkG5U2O -e,1,36,-21481,-928766616,-3471238138418013024,150,52569,2610290479,7788847578701297242,0.2578469,0.7670021786149205,gpo8K5qtYePve6jyPt6xgJx4YOVjms -b,5,-5,24896,1955646088,2430204191283109071,118,43655,2424630722,11429640193932435507,0.87989986,0.7328050041291218,JafwVLSVk5AVoXFuzclesQ000EE2k1 -a,3,13,32064,912707948,3826618523497875379,42,21463,2214035726,10771380284714693539,0.6133468,0.7325106678655877,i6RQVXKUh7MzuGMDaNclUYnFUAireU -c,1,41,-4667,-644225469,7049620391314639084,196,48099,2125812933,15419512479294091215,0.5780736,0.9255031346434324,mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS -d,2,93,-12642,2053379412,6468763445799074329,147,50842,1000948272,5536487915963301239,0.4279275,0.28534428578703896,lqhzgLsXZ8JhtpeeUWWNbMz8PHI705 -c,3,73,-9565,-382483011,1765659477910680019,186,1535,1088543984,2906943497598597237,0.680652,0.6009475544728957,Ow5PGpfTm4dXCfTDsXAOTatXRoAydR -c,3,-2,-18655,-2141999138,-3154042970870838072,251,34970,3862393166,13062025193350212516,0.034291923,0.7697753383420857,IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr -c,3,22,13741,-2098805236,8604102724776612452,45,2516,1362369177,196777795886465166,0.94669616,0.0494924465469434,6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE -b,2,63,21456,-2138770630,-2380041687053733364,181,57594,2705709344,13144161537396946288,0.09683716,0.3051364088814128,nYVJnVicpGRqKZibHyBAmtmzBXAFfT -d,4,102,-24558,1991172974,-7823479531661596016,14,36599,1534194097,2240998421986827216,0.028003037,0.8824879447595726,0og6hSkhbX8AC1ktFS4kounvTzy8Vo -d,1,-8,27138,-1383162419,7682021027078563072,36,64517,2861376515,9904216782086286050,0.80954456,0.9463098243875633,AFGCj7OWlEB5QfniEFgonMq90Tq5uH -a,3,17,-22796,1337043149,-1282905594104562444,167,2809,754775609,732272194388185106,0.3884129,0.658671129040488,VDhtJkYjAYPykCgOU9x3v7v3t4SO1a -e,2,52,23388,715235348,605432070100399212,165,56980,3314983189,7386391799827871203,0.46076488,0.980809631269599,jQimhdepw3GKmioWUlVSWeBVRKFkY3 -b,5,68,21576,1188285940,5717755781990389024,224,27600,974297360,9865419128970328044,0.80895734,0.7973920072996036,ioEncce3mPOXD2hWhpZpCPWGATG6GU -b,2,31,23127,-800561771,-8706387435232961848,153,27034,1098639440,3343692635488765507,0.35692692,0.5590205548347534,okOkcWflkNXIy4R8LzmySyY1EC3sYd -c,1,-24,-24085,-1882293856,7385529783747709716,41,48048,520189543,2402288956117186783,0.39761502,0.3600766362333053,Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u -a,4,65,-28462,-1813935549,7602389238442209730,18,363,1865307672,11378396836996498283,0.09130204,0.5593249815276734,WHmjWk2AY4c6m7DA4GitUx6nmb1yYS -d,1,125,31106,-1176490478,-4306856842351827308,90,17910,3625286410,17869394731126786457,0.8882508,0.7631239070049998,dVdvo6nUD5FgCgsbOZLds28RyGTpnx -b,4,17,-28070,-673237643,1904316899655860234,188,27744,933879086,3732692885824435932,0.41860116,0.40342283197779727,JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ -c,2,-106,-1114,-1927628110,1080308211931669384,177,20421,141680161,7464432081248293405,0.56749094,0.565352842229935,Vp3gmWunM5A7wOC9YW2JroFqTWjvTi -d,5,-59,2045,-2117946883,1170799768349713170,189,63353,1365198901,2501626630745849169,0.75173044,0.18628859265874176,F7NSTjWvQJyBburN7CXRUlbgp2dIrA -d,4,55,-1471,1902023838,1252101628560265705,157,3691,811650497,1524771507450695976,0.2968701,0.5437595540422571,f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX -b,2,-60,-21739,-1908480893,-8897292622858103761,59,50009,2525744318,1719090662556698549,0.52930677,0.560333188635217,l7uwDoTepWwnAP0ufqtHJS3CRi7RfP -d,3,-76,8809,141218956,-9110406195556445909,58,5494,1824517658,12046662515387914426,0.8557294,0.6668423897406515,Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK -e,4,73,-22501,1282464673,2541794052864382235,67,21119,538589788,9575476605699527641,0.48515016,0.296036538664718,4JznSdBajNWhu4hRQwjV1FjTTxY68i -b,4,-117,19316,2051224722,-5534418579506232438,133,52046,3023531799,13684453606722360110,0.62608826,0.8506721053047003,mhjME0zBHbrK6NMkytMTQzOssOa1gF -a,4,-101,11640,1993193190,2992662416070659899,230,40566,466439833,16778113360088370541,0.3991115,0.574210838214554,NEhyk8uIx4kEULJGa8qIyFjjBcP2G6 -b,5,62,16337,41423756,-2274773899098124524,121,34206,2307004493,10575647935385523483,0.23794776,0.1754261586710173,qnPOOmslCJaT45buUisMRnM0rc77EK -c,4,-79,5281,-237425046,373011991904079451,121,55620,2818832252,2464584078983135763,0.49774808,0.9237877978193884,t6fQUjJejPcjc04wHvHTPe55S65B4V -b,2,68,15874,49866617,1179733259727844435,121,23948,3455216719,3898128009708892708,0.6306253,0.9185813970744787,802bgTGl6Bk5TlkPYYTxp5JkKyaYUA -c,1,70,27752,1325868318,1241882478563331892,63,61637,473294098,4976799313755010034,0.13801557,0.5081765563442366,Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn -e,2,-61,-2888,-1660426473,2553892468492435401,126,35429,4144173353,939909697866979632,0.4405142,0.9231889896940375,BPtQMxnuSPpxMExYV9YkDa6cAN7GP3 -e,4,74,-12612,-1885422396,1702850374057819332,130,3583,3198969145,10767179755613315144,0.5518061,0.5614503754617461,QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv -d,2,122,10130,-168758331,-3179091803916845592,30,794,4061635107,15695681119022625322,0.69592506,0.9748360509016578,OPwBqCEK5PWTjWaiOyL45u2NLTaDWv -e,3,71,194,1436496767,-5639533800082367925,158,44507,3105312559,3998472996619161534,0.930117,0.6108938307533,pTeu0WMjBRTaNRT15rLCuEh3tBJVc5 -c,5,-94,-15880,2025611582,-3348824099853919681,5,40622,4268716378,12849419495718510869,0.34163946,0.4830878559436823,RilTlL1tKkPOUFuzmLydHAVZwv1OGl -d,1,-72,25590,1188089983,3090286296481837049,241,832,3542840110,5885937420286765261,0.41980565,0.21535402343780985,wwXqSGKLyBQyPkonlzBNYUJTCo4LRS -e,1,71,-5479,-1339586153,-3920238763788954243,123,53012,4229654142,10297218950720052365,0.73473036,0.5773498217058918,cBGc0kSm32ylBDnxogG727C0uhZEYZ -e,4,96,-30336,427197269,7506304308750926996,95,48483,3521368277,5437030162957481122,0.58104324,0.42073125331890115,3BEOHQsMEFZ58VcNTOJYShTBpAPzbt -a,2,-48,-18025,439738328,-313657814587041987,222,13763,3717551163,9135746610908713318,0.055064857,0.9800193410444061,ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8 -a,1,-56,8692,2106705285,-7811675384226570375,231,15573,1454057357,677091006469429514,0.42794758,0.2739938529235548,JN0VclewmjwYlSl8386MlWv5rEhWCz -e,2,52,-12056,-1090239422,9011500141803970147,238,4168,2013662838,12565360638488684051,0.6694766,0.39144436569161134,xipQ93429ksjNcXPX5326VSg1xJZcW -a,1,-5,12636,794623392,2909750622865366631,15,24022,2669374863,4776679784701509574,0.29877836,0.2537253407987472,waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs -b,1,12,7652,-1448995523,-5332734971209541785,136,49283,4076864659,15449267433866484283,0.6214579,0.05636955101974106,akiiY5N0I44CMwEnBL6RTBk7BRkxEj -e,5,64,-26526,1689098844,8950618259486183091,224,45253,662099130,16127995415060805595,0.2897315,0.5759450483859969,56MZa5O1hVtX4c5sbnCfxuX5kDChqI -c,4,-90,-2935,1579876740,6733733506744649678,254,12876,3593959807,4094315663314091142,0.5708688,0.5603062368164834,Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV -e,5,-86,32514,-467659022,-8012578250188146150,254,2684,2861911482,2126626171973341689,0.12559289,0.01479305307777301,gxfHWUF8XgY2KdFxigxvNEXe2V2XMl -c,2,-117,-30187,-1222533990,-191957437217035800,136,47061,2293105904,12659011877190539078,0.2047385,0.9706712283358269,pLk3i59bZwd5KBZrI1FiweYTd5hteG -a,3,14,28162,397430452,-452851601758273256,57,14722,431948861,8164671015278284913,0.40199697,0.07260475960924484,TtDKUZxzVxsq758G6AWPSYuZgVgbcl -c,2,29,-3855,1354539333,4742062657200940467,81,53815,3398507249,562977550464243101,0.7124534,0.991517828651004,Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0 -b,4,-59,25286,1423957796,2646602445954944051,0,61069,3570297463,15100310750150419896,0.49619365,0.04893135681998029,fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG -a,1,83,-14704,2143473091,-4387559599038777245,37,829,4015442341,4602675983996931623,0.89542526,0.9567595541247681,ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU -a,3,-12,-9168,1489733240,-1569376002217735076,206,33821,3959216334,16060348691054629425,0.9488028,0.9293883502480845,oLZ21P2JEDooxV1pU31cIxQHEeeoLu -c,4,3,-30508,659422734,-6455460736227846736,133,59663,2306130875,8622584762448622224,0.16999894,0.4273123318932347,EcCuckwsF3gV1Ecgmh5v4KM8g1ozif -a,3,-72,-11122,-2141451704,-2578916903971263854,83,30296,1995343206,17452974532402389080,0.94209343,0.3231750610081745,e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG -c,2,-107,-2904,-1011669561,782342092880993439,18,29527,1157161427,4403623840168496677,0.31988364,0.36936304600612724,QYlaIAnJA6r8rlAb6f59wcxvcPcWFf -c,5,118,19208,-134213907,-2120241105523909127,86,57751,1229567292,16493024289408725403,0.5536642,0.9723580396501548,TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX -c,3,97,29106,-903316089,2874859437662206732,207,42171,3473924576,8188072741116415408,0.32792538,0.2667177795079635,HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g -b,3,-101,-13217,-346989627,5456800329302529236,26,54276,243203849,17929716297117857676,0.05422181,0.09465635123783445,MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ -a,2,-43,13080,370975815,5881039805148485053,2,20120,2939920218,906367167997372130,0.42733806,0.16301110515739792,m6jD0LBIQWaMfenwRCTANI9eOdyyto -a,5,-101,-12484,-842693467,-6140627905445351305,57,57885,2496054700,2243924747182709810,0.59520596,0.9491397432856566,QJYm7YRA3YetcBHI5wkMZeLXVmfuNy -b,5,-44,15788,-629486480,5822642169425315613,13,11872,3457053821,2413406423648025909,0.44318348,0.32869374687050157,ALuRhobVWbnQTTWZdSOk0iVe8oYFhW -d,4,5,-7688,702611616,6239356364381313700,4,39363,3126475872,35363005357834672,0.3766935,0.061029375346466685,H5j5ZHy1FGesOAHjkQEDYCucbpKWRu -e,1,120,10837,-1331533190,6342019705133850847,245,3975,2830981072,16439861276703750332,0.6623719,0.9965400387585364,LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW -e,3,-95,13611,2030965207,927403809957470678,119,59134,559847112,10966649192992996919,0.5301289,0.047343434291126085,gTpyQnEODMcpsPnJMZC66gh33i3m0b -d,3,123,29533,240273900,1176001466590906949,117,30972,2592330556,12883447461717956514,0.39075065,0.38870280983958583,1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO -b,4,47,20690,-1009656194,-2027442591571700798,200,7781,326151275,2881913079548128905,0.57360977,0.2145232647388039,52mKlRE3aHCBZtjECq6sY9OqVf8Dze -e,4,30,-16110,61035129,-3356533792537910152,159,299,28774375,13526465947516666293,0.6999775,0.03968347085780355,cq4WSAIFwx3wwTUS5bp1wCe71R6U5I \ No newline at end of file From 38fa63b22af18a6aa7e5bef31d00cf454c7e7eb5 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Mon, 4 Feb 2019 09:14:13 -0700 Subject: [PATCH 10/12] remove test csv file, update tests to use test data from new testing submodule --- rust/datafusion/README.md | 2 +- rust/datafusion/examples/csv_sql.rs | 2 +- rust/datafusion/src/execution/aggregate.rs | 6 +++--- rust/datafusion/src/execution/projection.rs | 2 +- rust/datafusion/tests/sql.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rust/datafusion/README.md b/rust/datafusion/README.md index 3c9d4540c42a..392ff7f666fe 100644 --- a/rust/datafusion/README.md +++ b/rust/datafusion/README.md @@ -40,7 +40,7 @@ fn main() { ])); // register csv file with the execution context - let csv_datasource = CsvDataSource::new("test/data/uk_cities.csv", schema.clone(), 1024); + let csv_datasource = CsvDataSource::new("../../testing/csv/uk_cities.csv", schema.clone(), 1024); ctx.register_datasource("cities", Rc::new(RefCell::new(csv_datasource))); // simple projection and selection diff --git a/rust/datafusion/examples/csv_sql.rs b/rust/datafusion/examples/csv_sql.rs index 3face05f568f..39acccc1d9b3 100644 --- a/rust/datafusion/examples/csv_sql.rs +++ b/rust/datafusion/examples/csv_sql.rs @@ -52,7 +52,7 @@ fn main() { // register csv file with the execution context let csv_datasource = - CsvDataSource::new("test/data/aggregate_test_100.csv", schema.clone(), 1024); + CsvDataSource::new("../../testing/csv/aggregate_test_100.csv", schema.clone(), 1024); ctx.register_datasource("aggregate_test_100", Rc::new(RefCell::new(csv_datasource))); // simple projection and selection diff --git a/rust/datafusion/src/execution/aggregate.rs b/rust/datafusion/src/execution/aggregate.rs index 59fc7367a9df..a593d9fb584d 100644 --- a/rust/datafusion/src/execution/aggregate.rs +++ b/rust/datafusion/src/execution/aggregate.rs @@ -1022,7 +1022,7 @@ mod tests { #[test] fn min_f64_group_by_string() { let schema = aggr_test_schema(); - let relation = load_csv("test/data/aggregate_test_100.csv", &schema); + let relation = load_csv("../../testing/csv/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); let aggr_expr = vec![expression::compile_expr( @@ -1057,7 +1057,7 @@ mod tests { #[test] fn max_f64_group_by_string() { let schema = aggr_test_schema(); - let relation = load_csv("test/data/aggregate_test_100.csv", &schema); + let relation = load_csv("../../testing/csv/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); let aggr_expr = vec![expression::compile_expr( @@ -1092,7 +1092,7 @@ mod tests { #[test] fn test_min_max_sum_f64_group_by_uint32() { let schema = aggr_test_schema(); - let relation = load_csv("test/data/aggregate_test_100.csv", &schema); + let relation = load_csv("../../testing/csv/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); diff --git a/rust/datafusion/src/execution/projection.rs b/rust/datafusion/src/execution/projection.rs index de480f0237b7..98a80843cade 100644 --- a/rust/datafusion/src/execution/projection.rs +++ b/rust/datafusion/src/execution/projection.rs @@ -105,7 +105,7 @@ mod tests { Field::new("c12", DataType::Utf8, false), ])); let ds = - CsvDataSource::new("test/data/aggregate_test_100.csv", schema.clone(), 1024); + CsvDataSource::new("../../testing/csv/aggregate_test_100.csv", schema.clone(), 1024); let relation = Rc::new(RefCell::new(DataSourceRelation::new(Rc::new( RefCell::new(ds), )))); diff --git a/rust/datafusion/tests/sql.rs b/rust/datafusion/tests/sql.rs index e86d2ac88614..fe5fff2231b9 100644 --- a/rust/datafusion/tests/sql.rs +++ b/rust/datafusion/tests/sql.rs @@ -95,7 +95,7 @@ fn register_aggregate_csv(ctx: &mut ExecutionContext) { register_csv( ctx, "aggregate_test_100", - "test/data/aggregate_test_100.csv", + "../../testing/csv/aggregate_test_100.csv", &schema, ); } From 6603091a3fe9f02c832eaba53586f01a6b6e9fa6 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Mon, 4 Feb 2019 09:21:14 -0700 Subject: [PATCH 11/12] update path again, update testing submodule --- rust/datafusion/README.md | 2 +- rust/datafusion/examples/csv_sql.rs | 2 +- rust/datafusion/src/execution/aggregate.rs | 6 +++--- rust/datafusion/src/execution/projection.rs | 2 +- rust/datafusion/tests/sql.rs | 2 +- testing | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rust/datafusion/README.md b/rust/datafusion/README.md index 392ff7f666fe..eade95e06353 100644 --- a/rust/datafusion/README.md +++ b/rust/datafusion/README.md @@ -40,7 +40,7 @@ fn main() { ])); // register csv file with the execution context - let csv_datasource = CsvDataSource::new("../../testing/csv/uk_cities.csv", schema.clone(), 1024); + let csv_datasource = CsvDataSource::new("../../testing/data/csv/uk_cities.csv", schema.clone(), 1024); ctx.register_datasource("cities", Rc::new(RefCell::new(csv_datasource))); // simple projection and selection diff --git a/rust/datafusion/examples/csv_sql.rs b/rust/datafusion/examples/csv_sql.rs index 39acccc1d9b3..a0bd99f0b6b2 100644 --- a/rust/datafusion/examples/csv_sql.rs +++ b/rust/datafusion/examples/csv_sql.rs @@ -52,7 +52,7 @@ fn main() { // register csv file with the execution context let csv_datasource = - CsvDataSource::new("../../testing/csv/aggregate_test_100.csv", schema.clone(), 1024); + CsvDataSource::new("../../testing/data/csv/aggregate_test_100.csv", schema.clone(), 1024); ctx.register_datasource("aggregate_test_100", Rc::new(RefCell::new(csv_datasource))); // simple projection and selection diff --git a/rust/datafusion/src/execution/aggregate.rs b/rust/datafusion/src/execution/aggregate.rs index a593d9fb584d..5acf5fb63a18 100644 --- a/rust/datafusion/src/execution/aggregate.rs +++ b/rust/datafusion/src/execution/aggregate.rs @@ -1022,7 +1022,7 @@ mod tests { #[test] fn min_f64_group_by_string() { let schema = aggr_test_schema(); - let relation = load_csv("../../testing/csv/aggregate_test_100.csv", &schema); + let relation = load_csv("../../testing/data/csv/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); let aggr_expr = vec![expression::compile_expr( @@ -1057,7 +1057,7 @@ mod tests { #[test] fn max_f64_group_by_string() { let schema = aggr_test_schema(); - let relation = load_csv("../../testing/csv/aggregate_test_100.csv", &schema); + let relation = load_csv("../../testing/data/csv/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); let aggr_expr = vec![expression::compile_expr( @@ -1092,7 +1092,7 @@ mod tests { #[test] fn test_min_max_sum_f64_group_by_uint32() { let schema = aggr_test_schema(); - let relation = load_csv("../../testing/csv/aggregate_test_100.csv", &schema); + let relation = load_csv("../../testing/data/csv/aggregate_test_100.csv", &schema); let context = ExecutionContext::new(); diff --git a/rust/datafusion/src/execution/projection.rs b/rust/datafusion/src/execution/projection.rs index 98a80843cade..a4c39690d6e0 100644 --- a/rust/datafusion/src/execution/projection.rs +++ b/rust/datafusion/src/execution/projection.rs @@ -105,7 +105,7 @@ mod tests { Field::new("c12", DataType::Utf8, false), ])); let ds = - CsvDataSource::new("../../testing/csv/aggregate_test_100.csv", schema.clone(), 1024); + CsvDataSource::new("../../testing/data/csv/aggregate_test_100.csv", schema.clone(), 1024); let relation = Rc::new(RefCell::new(DataSourceRelation::new(Rc::new( RefCell::new(ds), )))); diff --git a/rust/datafusion/tests/sql.rs b/rust/datafusion/tests/sql.rs index fe5fff2231b9..bd228087dcc6 100644 --- a/rust/datafusion/tests/sql.rs +++ b/rust/datafusion/tests/sql.rs @@ -95,7 +95,7 @@ fn register_aggregate_csv(ctx: &mut ExecutionContext) { register_csv( ctx, "aggregate_test_100", - "../../testing/csv/aggregate_test_100.csv", + "../../testing/data/csv/aggregate_test_100.csv", &schema, ); } diff --git a/testing b/testing index 6ee39a9d17b0..bf0abe442bf7 160000 --- a/testing +++ b/testing @@ -1 +1 @@ -Subproject commit 6ee39a9d17b0902b7372c22b9ff823304c69d709 +Subproject commit bf0abe442bf7e313380452c8972692940f4e56b6 From 990d06f091948731e86764105503c5b33b1d0a69 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Mon, 4 Feb 2019 09:30:46 -0700 Subject: [PATCH 12/12] formatting --- rust/datafusion/examples/csv_sql.rs | 7 +++++-- rust/datafusion/src/execution/projection.rs | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/rust/datafusion/examples/csv_sql.rs b/rust/datafusion/examples/csv_sql.rs index a0bd99f0b6b2..40959cbb624f 100644 --- a/rust/datafusion/examples/csv_sql.rs +++ b/rust/datafusion/examples/csv_sql.rs @@ -51,8 +51,11 @@ fn main() { ])); // register csv file with the execution context - let csv_datasource = - CsvDataSource::new("../../testing/data/csv/aggregate_test_100.csv", schema.clone(), 1024); + let csv_datasource = CsvDataSource::new( + "../../testing/data/csv/aggregate_test_100.csv", + schema.clone(), + 1024, + ); ctx.register_datasource("aggregate_test_100", Rc::new(RefCell::new(csv_datasource))); // simple projection and selection diff --git a/rust/datafusion/src/execution/projection.rs b/rust/datafusion/src/execution/projection.rs index a4c39690d6e0..6de5818ab198 100644 --- a/rust/datafusion/src/execution/projection.rs +++ b/rust/datafusion/src/execution/projection.rs @@ -104,8 +104,11 @@ mod tests { Field::new("c11", DataType::Float64, false), Field::new("c12", DataType::Utf8, false), ])); - let ds = - CsvDataSource::new("../../testing/data/csv/aggregate_test_100.csv", schema.clone(), 1024); + let ds = CsvDataSource::new( + "../../testing/data/csv/aggregate_test_100.csv", + schema.clone(), + 1024, + ); let relation = Rc::new(RefCell::new(DataSourceRelation::new(Rc::new( RefCell::new(ds), ))));