From 236bdc8fd456fefaa06c873253b2833932092963 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Tue, 3 Jan 2023 20:37:40 +0100 Subject: [PATCH 01/19] Move Datafusion engine to a package --- .../src/{ => engines/datafusion}/error.rs | 0 .../{ => engines/datafusion}/insert/mod.rs | 4 +- .../{ => engines/datafusion}/insert/util.rs | 0 .../src/engines/datafusion/mod.rs | 70 +++++++++++++++++++ .../src/{ => engines/datafusion}/normalize.rs | 2 +- .../tests/sqllogictests/src/engines/mod.rs | 2 + .../core/tests/sqllogictests/src/main.rs | 69 ++---------------- 7 files changed, 81 insertions(+), 66 deletions(-) rename datafusion/core/tests/sqllogictests/src/{ => engines/datafusion}/error.rs (100%) rename datafusion/core/tests/sqllogictests/src/{ => engines/datafusion}/insert/mod.rs (97%) rename datafusion/core/tests/sqllogictests/src/{ => engines/datafusion}/insert/util.rs (100%) create mode 100644 datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs rename datafusion/core/tests/sqllogictests/src/{ => engines/datafusion}/normalize.rs (98%) create mode 100644 datafusion/core/tests/sqllogictests/src/engines/mod.rs diff --git a/datafusion/core/tests/sqllogictests/src/error.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/error.rs similarity index 100% rename from datafusion/core/tests/sqllogictests/src/error.rs rename to datafusion/core/tests/sqllogictests/src/engines/datafusion/error.rs diff --git a/datafusion/core/tests/sqllogictests/src/insert/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/mod.rs similarity index 97% rename from datafusion/core/tests/sqllogictests/src/insert/mod.rs rename to datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/mod.rs index 3412e4ad8db4..0503785c5623 100644 --- a/datafusion/core/tests/sqllogictests/src/insert/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/mod.rs @@ -17,8 +17,8 @@ mod util; -use crate::error::Result; -use crate::insert::util::LogicTestContextProvider; +use super::error::Result; +use self::util::LogicTestContextProvider; use arrow::record_batch::RecordBatch; use datafusion::datasource::MemTable; use datafusion::prelude::SessionContext; diff --git a/datafusion/core/tests/sqllogictests/src/insert/util.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/util.rs similarity index 100% rename from datafusion/core/tests/sqllogictests/src/insert/util.rs rename to datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/util.rs diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs new file mode 100644 index 000000000000..fb08d36ee0aa --- /dev/null +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs @@ -0,0 +1,70 @@ +use std::time::Duration; + +use sqllogictest::DBOutput; + +use datafusion::arrow::record_batch::RecordBatch; +use datafusion::prelude::SessionContext; +use self::error::{DFSqlLogicTestError, Result}; +use sqlparser::ast::Statement as SQLStatement; +use datafusion_sql::parser::{DFParser, Statement}; +use insert::insert; +use async_trait::async_trait; + +mod error; +mod normalize; +mod insert; + +pub struct DataFusion { + ctx: SessionContext, + file_name: String, +} + +impl DataFusion { + pub fn new(ctx: SessionContext, file_name: String) -> Self { + Self { ctx, file_name } + } +} + +#[async_trait] +impl sqllogictest::AsyncDB for DataFusion { + type Error = DFSqlLogicTestError; + + async fn run(&mut self, sql: &str) -> Result { + println!("[{}] Running query: \"{}\"", self.file_name, sql); + let result = run_query(&self.ctx, sql).await?; + Ok(result) + } + + /// Engine name of current database. + fn engine_name(&self) -> &str { + "DataFusion" + } + + /// [`Runner`] calls this function to perform sleep. + /// + /// The default implementation is `std::thread::sleep`, which is universial to any async runtime + /// but would block the current thread. If you are running in tokio runtime, you should override + /// this by `tokio::time::sleep`. + async fn sleep(dur: Duration) { + tokio::time::sleep(dur).await; + } +} + + +async fn run_query(ctx: &SessionContext, sql: impl Into) -> Result { + let sql = sql.into(); + // Check if the sql is `insert` + if let Ok(mut statements) = DFParser::parse_sql(&sql) { + let statement0 = statements.pop_front().expect("at least one SQL statement"); + if let Statement::Statement(statement) = statement0 { + let statement = *statement; + if matches!(&statement, SQLStatement::Insert { .. }) { + return insert(ctx, statement).await; + } + } + } + let df = ctx.sql(sql.as_str()).await?; + let results: Vec = df.collect().await?; + let formatted_batches = normalize::convert_batches(results)?; + Ok(formatted_batches) +} diff --git a/datafusion/core/tests/sqllogictests/src/normalize.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs similarity index 98% rename from datafusion/core/tests/sqllogictests/src/normalize.rs rename to datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs index 474ec6e85f9c..78cfa49ccedf 100644 --- a/datafusion/core/tests/sqllogictests/src/normalize.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -use crate::error::{DFSqlLogicTestError, Result}; +use super::error::{DFSqlLogicTestError, Result}; use arrow::{array::ArrayRef, datatypes::DataType, record_batch::RecordBatch}; use datafusion::error::DataFusionError; use sqllogictest::{ColumnType, DBOutput}; diff --git a/datafusion/core/tests/sqllogictests/src/engines/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/mod.rs new file mode 100644 index 000000000000..fd3172d5b18c --- /dev/null +++ b/datafusion/core/tests/sqllogictests/src/engines/mod.rs @@ -0,0 +1,2 @@ +pub mod datafusion; + diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index 6d88f4dd4e32..c75ca87921ab 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -15,68 +15,29 @@ // specific language governing permissions and limitations // under the License. -use async_trait::async_trait; -use datafusion::arrow::record_batch::RecordBatch; +use std::error::Error; use datafusion::prelude::SessionContext; -use datafusion_sql::parser::{DFParser, Statement}; use log::info; -use normalize::convert_batches; -use sqllogictest::DBOutput; -use sqlparser::ast::Statement as SQLStatement; use std::path::Path; -use std::time::Duration; +use crate::engines::datafusion::DataFusion; -use crate::error::{DFSqlLogicTestError, Result}; -use crate::insert::insert; -mod error; -mod insert; -mod normalize; mod setup; mod utils; +mod engines; const TEST_DIRECTORY: &str = "tests/sqllogictests/test_files"; -pub struct DataFusion { - ctx: SessionContext, - file_name: String, -} - -#[async_trait] -impl sqllogictest::AsyncDB for DataFusion { - type Error = DFSqlLogicTestError; - - async fn run(&mut self, sql: &str) -> Result { - println!("[{}] Running query: \"{}\"", self.file_name, sql); - let result = run_query(&self.ctx, sql).await?; - Ok(result) - } - - /// Engine name of current database. - fn engine_name(&self) -> &str { - "DataFusion" - } - - /// [`Runner`] calls this function to perform sleep. - /// - /// The default implementation is `std::thread::sleep`, which is universial to any async runtime - /// but would block the current thread. If you are running in tokio runtime, you should override - /// this by `tokio::time::sleep`. - async fn sleep(dur: Duration) { - tokio::time::sleep(dur).await; - } -} - #[tokio::main] #[cfg(target_family = "windows")] -pub async fn main() -> Result<()> { +pub async fn main() -> Result<(), Box> { println!("Skipping test on windows"); Ok(()) } #[tokio::main] #[cfg(not(target_family = "windows"))] -pub async fn main() -> Result<()> { +pub async fn main() -> Result<(), Box> { // Enable logging (e.g. set RUST_LOG=debug to see debug logs) use sqllogictest::{default_validator, update_test_file}; @@ -100,7 +61,7 @@ pub async fn main() -> Result<()> { // Create the test runner let ctx = context_for_test_file(&file_name).await; - let mut runner = sqllogictest::Runner::new(DataFusion { ctx, file_name }); + let mut runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); // run each file using its own new DB // @@ -137,24 +98,6 @@ async fn context_for_test_file(file_name: &str) -> SessionContext { } } -async fn run_query(ctx: &SessionContext, sql: impl Into) -> Result { - let sql = sql.into(); - // Check if the sql is `insert` - if let Ok(mut statements) = DFParser::parse_sql(&sql) { - let statement0 = statements.pop_front().expect("at least one SQL statement"); - if let Statement::Statement(statement) = statement0 { - let statement = *statement; - if matches!(&statement, SQLStatement::Insert { .. }) { - return insert(ctx, statement).await; - } - } - } - let df = ctx.sql(sql.as_str()).await?; - let results: Vec = df.collect().await?; - let formatted_batches = convert_batches(results)?; - Ok(formatted_batches) -} - /// Parsed command line options struct Options { // regex like From d00a1de6e7efb8eadfc131ea1584b0334148858f Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Fri, 6 Jan 2023 20:23:59 +0100 Subject: [PATCH 02/19] Run postgres and datafusion tests and compare outputs --- datafusion/core/Cargo.toml | 3 +- datafusion/core/src/test_util.rs | 2 +- datafusion/core/tests/sqllogictests/README.md | 8 + .../postgres/postgres_create_table.sql | 21 ++ .../postgres/test_files/character_length.slt | 19 ++ .../partitioned_window_built_in_functions.slt | 31 +++ .../test_files/self_join_with_alias.slt | 24 +++ .../test_files/simple_aggregation.slt | 29 +++ .../postgres/test_files/simple_except.slt | 27 +++ .../postgres/test_files/simple_except_all.slt | 27 +++ .../postgres/test_files/simple_group_by.slt | 28 +++ .../postgres/test_files/simple_intersect.slt | 27 +++ .../test_files/simple_intersect_all.slt | 27 +++ .../test_files/simple_math_expressions.slt | 24 +++ .../test_files/simple_ordered_row.slt | 28 +++ .../test_files/simple_row_past_future.slt | 26 +++ .../postgres/test_files/simple_select.slt | 19 ++ .../postgres/test_files/simple_sort.slt | 25 +++ .../test_files/simple_sort_nulls_order.slt | 24 +++ .../postgres/test_files/simple_union_all.slt | 19 ++ .../simple_window_built_in_functions.slt | 31 +++ .../simple_window_full_aggregation.slt | 27 +++ .../test_files/simple_window_groups.slt | 73 +++++++ .../simple_window_lead_built_in_functions.slt | 28 +++ .../simple_window_ordered_aggregation.slt | 28 +++ .../simple_window_partition_aggregation.slt | 28 +++ ...ple_window_partition_order_aggregation.slt | 37 ++++ .../test_files/simple_window_range.slt | 31 +++ ...imple_window_ranked_built_in_functions.slt | 26 +++ .../postgres/test_files/test_data.slt | 20 ++ .../postgres/test_files/values_list.slt | 29 +++ .../src/engines/datafusion/mod.rs | 17 ++ .../tests/sqllogictests/src/engines/mod.rs | 2 + .../sqllogictests/src/engines/postgres/mod.rs | 179 ++++++++++++++++++ .../core/tests/sqllogictests/src/main.rs | 108 ++++++++--- .../core/tests/sqllogictests/src/setup.rs | 12 +- .../create_test_table_postgres.sql | 4 +- 37 files changed, 1080 insertions(+), 38 deletions(-) create mode 100644 datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt create mode 100644 datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 491db7bb6800..80e6539c3609 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -112,8 +112,9 @@ parquet-test-utils = { path = "../../parquet-test-utils" } rstest = "0.16.0" sqllogictest = "0.10.0" test-utils = { path = "../../test-utils" } +tokio-postgres = "0.7.7" thiserror = "1.0.37" - +testcontainers = "0.14.0" [target.'cfg(not(target_os = "windows"))'.dev-dependencies] nix = "0.26.1" diff --git a/datafusion/core/src/test_util.rs b/datafusion/core/src/test_util.rs index 2db6f3bc46ba..4ef22cf7fa07 100644 --- a/datafusion/core/src/test_util.rs +++ b/datafusion/core/src/test_util.rs @@ -156,7 +156,7 @@ pub fn parquet_test_data() -> String { /// Returns either: /// The path referred to in `udf_env` if that variable is set and refers to a directory /// The submodule_data directory relative to CARGO_MANIFEST_PATH -fn get_data_dir(udf_env: &str, submodule_data: &str) -> Result> { +pub fn get_data_dir(udf_env: &str, submodule_data: &str) -> Result> { // Try user defined env. if let Ok(dir) = env::var(udf_env) { let trimmed = dir.trim().to_string(); diff --git a/datafusion/core/tests/sqllogictests/README.md b/datafusion/core/tests/sqllogictests/README.md index d472245783fa..f853ad258731 100644 --- a/datafusion/core/tests/sqllogictests/README.md +++ b/datafusion/core/tests/sqllogictests/README.md @@ -44,6 +44,14 @@ Run only the tests in `information_schema.slt`: cargo test -p datafusion --test sqllogictests -- information ``` +#### Running tests: Postgres compatibility mode + +In this mode, `sqllogictests` runs the statements and queries in a `.slt` file, comparing outputs of postgres and datafusion. + +``` +cargo test -p datafusion --test sqllogictests -- --postgres +``` + #### Updating tests: Completion Mode In test script completion mode, `sqllogictests` reads a prototype script and runs the statements and queries against the database engine. The output is is a full script that is a copy of the prototype script with result inserted. diff --git a/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql b/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql new file mode 100644 index 000000000000..9cffa664cc0d --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql @@ -0,0 +1,21 @@ +CREATE TABLE aggregate_test_100_by_sql +( + c1 character varying NOT NULL, + c2 integer NOT NULL, + c3 smallint NOT NULL, + c4 smallint, + c5 integer, + c6 bigint NOT NULL, + c7 smallint NOT NULL, + c8 integer NOT NULL, + c9 bigint NOT NULL, + c10 character varying NOT NULL, + c11 double precision NOT NULL, + c12 double precision NOT NULL, + c13 character varying NOT NULL +); + +COPY aggregate_test_100_by_sql + FROM '/opt/data/csv/aggregate_test_100.csv' + DELIMITER ',' + CSV HEADER; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt new file mode 100644 index 000000000000..364a54f5622f --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt @@ -0,0 +1,19 @@ +# 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. + +query I +select length('ä'); diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt new file mode 100644 index 000000000000..8ae64633df6c --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt @@ -0,0 +1,31 @@ +# 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. + +query IIIIIIIIII +SELECT + c9, + row_number() OVER (PARTITION BY c2 ORDER BY c9) row_num, + lead(c9) OVER (PARTITION BY c2 ORDER BY c9) lead_c9, + lag(c9) OVER (PARTITION BY c2 ORDER BY c9) lag_c9, + first_value(c9) OVER (PARTITION BY c2 ORDER BY c9) first_c9, + first_value(c9) OVER (PARTITION BY c2 ORDER BY c9 DESC) first_c9_desc, + last_value(c9) OVER (PARTITION BY c2 ORDER BY c9) last_c9, + last_value(c9) OVER (PARTITION BY c2 ORDER BY c9 DESC) last_c9_desc, + nth_value(c9, 2) OVER (PARTITION BY c2 ORDER BY c9) second_c9, + nth_value(c9, 2) OVER (PARTITION BY c2 ORDER BY c9 DESC) second_c9_desc +FROM aggregate_test_100_by_sql +ORDER BY c9; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt new file mode 100644 index 000000000000..90f2cd5c946f --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt @@ -0,0 +1,24 @@ +# 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. + +query I +SELECT + t1.c9 result +FROM aggregate_test_100_by_sql t1 +INNER JOIN aggregate_test_100_by_sql t2 +ON t1.c9 = t2.c9 +ORDER BY result; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt new file mode 100644 index 000000000000..ee12d38b6d6f --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt @@ -0,0 +1,29 @@ +# 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. + +# 100 100 7.8100000000000000 781 125 -117 --- postgres +# 100 100 7.81 781 125 -117 --- datafusion + +query IIRIII +SELECT + count(*) AS count_all, + count(c3) AS count_c3, + round(avg(c3), 0) AS avg, + sum(c3) AS sum, + max(c3) AS max, + min(c3) AS min +FROM aggregate_test_100_by_sql; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt new file mode 100644 index 000000000000..1c98689134c6 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt @@ -0,0 +1,27 @@ +# 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. + +query I +SELECT * FROM ( + SELECT c2 + FROM aggregate_test_100_by_sql t1 + EXCEPT + SELECT c2 + FROM aggregate_test_100_by_sql t2 + WHERE c2 IN (3, 4) +) s +ORDER BY c2 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt new file mode 100644 index 000000000000..67d777afd45f --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt @@ -0,0 +1,27 @@ +# 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. + +query I +SELECT * FROM ( + SELECT c2 + FROM aggregate_test_100_by_sql t1 + EXCEPT ALL + SELECT c2 + FROM aggregate_test_100_by_sql t2 + WHERE c2 IN (3, 4) +) s +ORDER BY c2 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt new file mode 100644 index 000000000000..3b5b953e9d05 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt @@ -0,0 +1,28 @@ +# 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. + +query IIRIII +select + c2, + sum(c3) sum_c3, + round(avg(c3), 0) avg_c3, + max(c3) max_c3, + min(c3) min_c3, + count(c3) count_c3 +from aggregate_test_100_by_sql +group by c2 +order by c2; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt new file mode 100644 index 000000000000..9d28da71ca98 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt @@ -0,0 +1,27 @@ +# 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. + +query I +SELECT * FROM ( + SELECT c2 + FROM aggregate_test_100_by_sql t1 + INTERSECT + SELECT c2 + FROM aggregate_test_100_by_sql t2 + WHERE c2 IN (3, 4) +) s +ORDER BY c2 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt new file mode 100644 index 000000000000..87e630d0dcfd --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt @@ -0,0 +1,27 @@ +# 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. + +query I +SELECT * FROM ( + SELECT c2 + FROM aggregate_test_100_by_sql t1 + INTERSECT ALL + SELECT c2 + FROM aggregate_test_100_by_sql t2 + WHERE c2 IN (3, 4) +) s +ORDER BY c2 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt new file mode 100644 index 000000000000..22f5f3bd23fa --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt @@ -0,0 +1,24 @@ +# 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. + +query RRRRR +SELECT + abs(-1.1) as abs, + round(exp(2.0), 0) as exp, + sin(3.0) as sin, + cos(4.0) as cos, + round(tan(5.0)) as tan; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt new file mode 100644 index 000000000000..d81cf3be33f8 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt @@ -0,0 +1,28 @@ +# 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. + +query IIIIIII +SELECT +SUM(c5) OVER(ORDER BY c13 ROWS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation2, +SUM(c2) OVER(PARTITION BY c5 ORDER BY c13 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation10, +SUM(c2) OVER(PARTITION BY c1 ORDER BY c13 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation14, +SUM(c5) OVER(ORDER BY c5 ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING) as summation5, +SUM(c5) OVER(ORDER BY c5 ROWS BETWEEN UNBOUNDED PRECEDING AND 2 FOLLOWING) as summation6, +SUM(c2) OVER(PARTITION BY c5, c7, c9 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation20, +SUM(c2) OVER(PARTITION BY c5 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation21 +FROM aggregate_test_100_by_sql +ORDER BY c9; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt new file mode 100644 index 000000000000..7b61030e4b5f --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt @@ -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. + +query IIIII +SELECT + SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) as summation1, + SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 2 FOLLOWING AND 3 FOLLOWING) as summation2, + SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 2 FOLLOWING AND UNBOUNDED FOLLOWING) as summation3, + SUM(c2) OVER(ORDER BY c5 RANGE BETWEEN 2 FOLLOWING AND UNBOUNDED FOLLOWING) as summation4, + SUM(c2) OVER(ORDER BY c5 RANGE BETWEEN 1 PRECEDING AND 1 PRECEDING) as summation5 +FROM aggregate_test_100_by_sql +ORDER BY c9; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt new file mode 100644 index 000000000000..b9de947ab707 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt @@ -0,0 +1,19 @@ +# 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. + +query I +SELECT 1 as num; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt new file mode 100644 index 000000000000..8de1adbac4f6 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# halt +query IIT +SELECT + c2, + c3, + c10 +FROM aggregate_test_100_by_sql +ORDER BY c2 ASC, c3 DESC, c10; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt new file mode 100644 index 000000000000..a4388008596c --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt @@ -0,0 +1,24 @@ +# 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. + +query IIT +SELECT + c5, + c4, + c10 +FROM aggregate_test_100_by_sql +ORDER BY c5 ASC, c4 DESC, c10; \ No newline at end of file diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt new file mode 100644 index 000000000000..2f5630a48fd5 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt @@ -0,0 +1,19 @@ +# 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. + +query I +SELECT 1 num UNION ALL SELECT 2 num ORDER BY num; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt new file mode 100644 index 000000000000..aa5246a9b83a --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt @@ -0,0 +1,31 @@ +# 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. + +query IIIIIIIIII +SELECT + c9, + row_number() OVER (ORDER BY c9) row_num, + lead(c9) OVER (ORDER BY c9) lead_c9, + lag(c9) OVER (ORDER BY c9) lag_c9, + first_value(c9) OVER (ORDER BY c9) first_c9, + first_value(c9) OVER (ORDER BY c9 DESC) first_c9_desc, + last_value(c9) OVER (ORDER BY c9) last_c9, + last_value(c9) OVER (ORDER BY c9 DESC) last_c9_desc, + nth_value(c9, 2) OVER (ORDER BY c9) second_c9, + nth_value(c9, 2) OVER (ORDER BY c9 DESC) second_c9_desc +FROM aggregate_test_100_by_sql +ORDER BY c9; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt new file mode 100644 index 000000000000..456dd682a6fc --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt @@ -0,0 +1,27 @@ +# 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. + +query IIRIII +SELECT + row_number() OVER () AS row_number, + count(c3) OVER () AS count_c3, + round(avg(c3) OVER (), 0) AS avg, + sum(c3) OVER () AS sum, + max(c3) OVER () AS max, + min(c3) OVER () AS min +FROM aggregate_test_100_by_sql +ORDER BY row_number; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt new file mode 100644 index 000000000000..46279fbb35c3 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt @@ -0,0 +1,73 @@ +# 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. + +query IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII +SELECT + SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation1, + SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation2, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation3, + SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation4, + SUM(c3) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation5, + SUM(c5) OVER(ORDER BY c3 DESC GROUPS 2 PRECEDING) as summation6, + SUM(c5) OVER(ORDER BY c3 DESC GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation7, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation8, + SUM(c4) OVER(ORDER BY c4 DESC GROUPS UNBOUNDED PRECEDING) as summation9, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS CURRENT ROW) as summation10, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation11, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation12, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation13, + SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation21, + SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation22, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation23, + SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation24, + SUM(c3) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation25, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c3 GROUPS 2 PRECEDING) as summation26, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation27, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation28, + SUM(c4) OVER(PARTITION BY c4 ORDER BY c4 GROUPS UNBOUNDED PRECEDING) as summation29, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS CURRENT ROW) as summation30, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation31, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation32, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation33, + SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation41, + SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation42, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation43, + SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation44, + SUM(c3) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation45, + SUM(c5) OVER(ORDER BY c5, c3 GROUPS 2 PRECEDING) as summation46, + SUM(c5) OVER(ORDER BY c5, c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation47, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation48, + SUM(c4) OVER(ORDER BY c5, c4 GROUPS UNBOUNDED PRECEDING) as summation49, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS CURRENT ROW) as summation50, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation51, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation52, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation53, + SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation61, + SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation62, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation63, + SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation64, + SUM(c3) OVER(ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation65, + SUM(c5) OVER(ORDER BY c3 GROUPS 2 PRECEDING) as summation66, + SUM(c5) OVER(ORDER BY c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation67, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation68, + SUM(c4) OVER(ORDER BY c4 GROUPS UNBOUNDED PRECEDING) as summation69, + SUM(c5) OVER(ORDER BY c4 GROUPS CURRENT ROW) as summation70, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation71, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation72, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation73 +FROM aggregate_test_100_by_sql +ORDER BY c9; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt new file mode 100644 index 000000000000..df6b3f2da365 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt @@ -0,0 +1,28 @@ +# 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. + +query IIIIIII +SELECT + c8, + LEAD(c8) OVER () next_c8, + LEAD(c8, 10, 10) OVER() next_10_c8, + LEAD(c8, 100, 10) OVER() next_out_of_bounds_c8, + LAG(c8) OVER() prev_c8, + LAG(c8, -2, 0) OVER() AS prev_2_c8, + LAG(c8, -200, 10) OVER() AS prev_out_of_bounds_c8 +FROM aggregate_test_100_by_sql +ORDER BY c8; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt new file mode 100644 index 000000000000..a4ae0df8af05 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt @@ -0,0 +1,28 @@ +# 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. + +query IIIRIII +SELECT + c9, + row_number() OVER (ORDER BY c2, c9) AS row_number, + count(c3) OVER (ORDER BY c9) AS count_c3, + round(avg(c3) OVER (ORDER BY c2), 0) AS avg_c3_by_c2, + sum(c3) OVER (ORDER BY c2) AS sum_c3_by_c2, + max(c3) OVER (ORDER BY c2) AS max_c3_by_c2, + min(c3) OVER (ORDER BY c2) AS min_c3_by_c2 +FROM aggregate_test_100_by_sql +ORDER BY row_number; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt new file mode 100644 index 000000000000..baa0c32a8639 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt @@ -0,0 +1,28 @@ +# 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. + +query IIIRIII +SELECT + c9, + row_number() OVER (PARTITION BY c2, c9) AS row_number, + count(c3) OVER (PARTITION BY c2) AS count_c3, + round(avg(c3) OVER (PARTITION BY c2), 0) AS avg_c3_by_c2, + sum(c3) OVER (PARTITION BY c2) AS sum_c3_by_c2, + max(c3) OVER (PARTITION BY c2) AS max_c3_by_c2, + min(c3) OVER (PARTITION BY c2) AS min_c3_by_c2 +FROM aggregate_test_100_by_sql +ORDER BY c9; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt new file mode 100644 index 000000000000..1d0771b18d31 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt @@ -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. + +# before round +# 4268716378 14 14 -13.8571428571428571 -194 118 -101 ---- postgres +# 4268716378 14 14 -13.857142857142858 -194 118 -101 ---- datafusion + +# before abs +# 2818832252 16 16 0 -3 102 -111 ---- postgres +# 2818832252 16 16 -0 -3 102 -111 ---- datafusion + +query IIIRIII +SELECT + c9, + row_number() OVER (PARTITION BY c2 ORDER BY c9) AS row_number, + count(c3) OVER (PARTITION BY c2 ORDER BY c9) AS count_c3, + abs(round(avg(c3) OVER (PARTITION BY c2 ORDER BY c9), 0)) AS avg_c3_by_c2, + sum(c3) OVER (PARTITION BY c2 ORDER BY c9) AS sum_c3_by_c2, + max(c3) OVER (PARTITION BY c2 ORDER BY c9) AS max_c3_by_c2, + min(c3) OVER (PARTITION BY c2 ORDER BY c9) AS min_c3_by_c2 +FROM aggregate_test_100_by_sql +ORDER BY c9; + diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt new file mode 100644 index 000000000000..1b6451e0314c --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt @@ -0,0 +1,31 @@ +# 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. + +query IIIIIIIIII +SELECT + SUM(c5) OVER(ORDER BY c4 RANGE BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation2, + SUM(c4) OVER(ORDER BY c3 RANGE 3 PRECEDING) as summation3, + SUM(c4) OVER(ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation6, + SUM(c4) OVER(ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation7, + SUM(c2) OVER(PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation10, + SUM(c4) OVER(PARTITION BY c1 ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation11, + SUM(c2) OVER(PARTITION BY c1 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation14, + SUM(c4) OVER(PARTITION BY c5 ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation15, + SUM(c2) OVER(PARTITION BY c5, c7, c9 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation20, + SUM(c2) OVER(PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation21 +FROM aggregate_test_100_by_sql +ORDER BY c9; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt new file mode 100644 index 000000000000..ac722307d99a --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt @@ -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. + +query IIIII +select + c9, + cume_dist() OVER (PARTITION BY c2 ORDER BY c3) cume_dist_by_c3, + rank() OVER (PARTITION BY c2 ORDER BY c3) rank_by_c3, + dense_rank() OVER (PARTITION BY c2 ORDER BY c3) dense_rank_by_c3, + percent_rank() OVER (PARTITION BY c2 ORDER BY c3) percent_rank_by_c3 +FROM aggregate_test_100_by_sql +ORDER BY c9; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt new file mode 100644 index 000000000000..cac0e17f4a88 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt @@ -0,0 +1,20 @@ +# 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. + +query TIIIIIIIITRRT +select * from aggregate_test_100_by_sql +order by c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt new file mode 100644 index 000000000000..d1436f167443 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt @@ -0,0 +1,29 @@ +# 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. + +# values without casting +# postgres +# 1 2.0 -3 2 +# 10 20.0 -30 4 +# datafusion: +# 1 2 -3 2 +# 10 20 -30 4 + +query IRII +SELECT * FROM +(VALUES (1,2.0::real,-3,1+1),(10,20.0::real,-30,2+2)) +AS tbl(int_col, float_col, negative_col, summation); diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs index fb08d36ee0aa..6881b17ce884 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs @@ -1,3 +1,20 @@ +// 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::time::Duration; use sqllogictest::DBOutput; diff --git a/datafusion/core/tests/sqllogictests/src/engines/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/mod.rs index fd3172d5b18c..82200169640b 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/mod.rs @@ -1,2 +1,4 @@ pub mod datafusion; +pub mod postgres; + diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs new file mode 100644 index 000000000000..ada6b0e9bab9 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -0,0 +1,179 @@ +// 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::sync::Arc; +use std::time::Duration; + +use async_trait::async_trait; +use log::info; +use sqllogictest::{ColumnType, DBOutput}; +use testcontainers::core::WaitFor; +use testcontainers::images::generic::GenericImage; +use tokio::task::JoinHandle; + +pub struct Postgres { + client: Arc, + join_handle: JoinHandle<()>, +} + +pub const PG_USER: &str = "postgres"; +pub const PG_PASSWORD: &str = "postgres"; +pub const PG_DB: &str = "test"; +pub const PG_PORT: u16 = 5432; + +impl Postgres { + pub fn postgres_docker_image() -> GenericImage { + let postgres_test_data = match datafusion::test_util::get_data_dir("POSTGRES_TEST_DATA", "tests/sqllogictests/postgres") { + Ok(pb) => pb.display().to_string(), + Err(err) => panic!("failed to get arrow data dir: {err}"), + }; + GenericImage::new("postgres", "15") + .with_wait_for(WaitFor::message_on_stderr( + "database system is ready to accept connections", + )) + .with_env_var("POSTGRES_DB", PG_DB) + .with_env_var("POSTGRES_USER", PG_USER) + .with_env_var("POSTGRES_PASSWORD", PG_PASSWORD) + .with_env_var("POSTGRES_INITDB_ARGS", "--encoding=UTF-8 --lc-collate=C --lc-ctype=C") + .with_exposed_port(PG_PORT) + .with_volume(format!("{0}/csv/aggregate_test_100.csv", datafusion::test_util::arrow_test_data()), "/opt/data/csv/aggregate_test_100.csv") + .with_volume(format!("{0}/postgres_create_table.sql", postgres_test_data), "/docker-entrypoint-initdb.d/0_create_table.sql") + } + + pub async fn connect_with_retry(host: &str, + port: u16, + db: &str, + user: &str, + pass: &str) -> Result { + let mut retry = 0; + loop { + let connection_result = Postgres::connect(host, port, db, user, pass).await; + match connection_result { + Err(e) if retry <= 3 => { + info!("Retrying connection error '{:?}'", e); + retry += 1; + tokio::time::sleep(Duration::from_millis(500)).await; + } + result => break result + } + } + } + + async fn connect(host: &str, + port: u16, + db: &str, + user: &str, + pass: &str) -> Result { + let (client, connection) = tokio_postgres::Config::new() + .host(host) + .port(port) + .dbname(db) + .user(user) + .password(pass) + .connect(tokio_postgres::NoTls) + .await?; + + let join_handle = tokio::spawn(async move { + if let Err(e) = connection.await { + log::error!("Postgres connection error: {:?}", e); + } + }); + + Ok(Self { + client: Arc::new(client), + join_handle, + }) + } +} + + +impl Drop for Postgres { + fn drop(&mut self) { + self.join_handle.abort() + } +} + +#[async_trait] +impl sqllogictest::AsyncDB for Postgres { + type Error = tokio_postgres::error::Error; + + async fn run(&mut self, sql: &str) -> Result { + let mut output = vec![]; + + let is_query_sql = { + let lower_sql = sql.trim_start().to_ascii_lowercase(); + lower_sql.starts_with("select") + || lower_sql.starts_with("values") + || lower_sql.starts_with("show") + || lower_sql.starts_with("with") + || lower_sql.starts_with("describe") + }; + + // NOTE: + // We use `simple_query` API which returns the query results as strings. + // This means that we can not reformat values based on their type, + // and we have to follow the format given by the specific database (pg). + // For example, postgres will output `t` as true and `f` as false, + // thus we have to write `t`/`f` in the expected results. + let rows = self.client.simple_query(sql).await?; + for row in rows { + let mut row_vec = vec![]; + match row { + tokio_postgres::SimpleQueryMessage::Row(row) => { + for i in 0..row.len() { + match row.get(i) { + Some(v) => { + if v.is_empty() { + row_vec.push("(empty)".to_string()); + } else { + row_vec.push(v.to_string()); + } + } + None => row_vec.push("NULL".to_string()), + } + } + } + tokio_postgres::SimpleQueryMessage::CommandComplete(cnt) => { + if is_query_sql { + break; + } else { + return Ok(DBOutput::StatementComplete(cnt)); + } + } + _ => unreachable!(), + } + output.push(row_vec); + } + + if output.is_empty() { + let stmt = self.client.prepare(sql).await?; + Ok(DBOutput::Rows { + types: vec![ColumnType::Any; stmt.columns().len()], + rows: vec![], + }) + } else { + Ok(DBOutput::Rows { + types: vec![ColumnType::Any; output[0].len()], + rows: output, + }) + } + } + + fn engine_name(&self) -> &str { + "postgres" + } +} diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index c75ca87921ab..cc6b8ff20078 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -16,17 +16,24 @@ // under the License. use std::error::Error; -use datafusion::prelude::SessionContext; +use std::fs::copy; +use std::path::{Path, PathBuf}; + use log::info; -use std::path::Path; -use crate::engines::datafusion::DataFusion; +use tempfile::tempdir; +use testcontainers::clients::Cli as Docker; + +use datafusion::prelude::SessionContext; +use crate::engines::datafusion::DataFusion; +use crate::engines::postgres::{PG_DB, PG_PASSWORD, PG_PORT, PG_USER, Postgres}; mod setup; mod utils; mod engines; const TEST_DIRECTORY: &str = "tests/sqllogictests/test_files"; +const TEST_DIRECTORY_POSTGRES: &str = "tests/sqllogictests/postgres/test_files"; #[tokio::main] #[cfg(target_family = "windows")] @@ -39,49 +46,89 @@ pub async fn main() -> Result<(), Box> { #[cfg(not(target_family = "windows"))] pub async fn main() -> Result<(), Box> { // Enable logging (e.g. set RUST_LOG=debug to see debug logs) - - use sqllogictest::{default_validator, update_test_file}; env_logger::init(); let options = Options::new(); - // default to all files in test directory filtering based on name - let files: Vec<_> = std::fs::read_dir(TEST_DIRECTORY) - .unwrap() - .map(|path| path.unwrap().path()) - .filter(|path| options.check_test_file(path.as_path())) - .collect(); + let files: Vec<_> = read_test_files(&options); info!("Running test files {:?}", files); for path in files { - println!("Running: {}", path.display()); - let file_name = path.file_name().unwrap().to_str().unwrap().to_string(); - // Create the test runner - let ctx = context_for_test_file(&file_name).await; - let mut runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); - - // run each file using its own new DB - // - // We could run these tests in parallel eventually if we wanted. if options.complete_mode { - info!("Using complete mode to complete {}", path.display()); - let col_separator = " "; - let validator = default_validator; - update_test_file(path, runner, col_separator, validator) - .await - .map_err(|e| e.to_string())?; + run_complete_file(&path, file_name).await?; + } else if options.postgres_mode { + run_postgres_test_file(&path, file_name).await?; } else { - // run the test normally: - runner.run_file_async(path).await?; + run_test_file(&path, file_name).await?; } } Ok(()) } +async fn run_test_file(path: &PathBuf, file_name: String) -> Result<(), Box> { + println!("Running: {}", path.display()); + let ctx = context_for_test_file(&file_name).await; + let mut runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); + runner.run_file_async(path).await?; + Ok(()) +} + +async fn run_postgres_test_file(path: &PathBuf, file_name: String) -> Result<(), Box> { + use sqllogictest::{default_validator, update_test_file}; + info!("Running postgres test: {}", path.display()); + + let docker = Docker::default(); + let postgres_container = docker.run(Postgres::postgres_docker_image()); + + let postgres_client = Postgres::connect_with_retry( + "127.0.0.1", postgres_container.get_host_port_ipv4(PG_PORT), PG_DB, PG_USER, PG_PASSWORD, + ).await?; + let postgres_runner = sqllogictest::Runner::new(postgres_client); + + let temp_dir = tempdir()?; + let copy_path = temp_dir.path().join(&file_name); + + copy(&path, ©_path)?; + update_test_file(©_path, postgres_runner, " ", default_validator).await?; + + let ctx = SessionContext::new(); + setup::register_aggregate_csv_by_sql(&ctx).await; + let mut df_runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); + + df_runner.run_file_async(copy_path).await?; + Ok(()) +} + +async fn run_complete_file(path: &PathBuf, file_name: String) -> Result<(), Box> { + use sqllogictest::{default_validator, update_test_file}; + + info!("Using complete mode to complete: {}", path.display()); + + let ctx = context_for_test_file(&file_name).await; + let runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); + + let col_separator = " "; + let validator = default_validator; + update_test_file(path, runner, col_separator, validator) + .await + .map_err(|e| e.to_string())?; + + Ok(()) +} + +fn read_test_files(options: &Options) -> Vec { + let path = if options.postgres_mode { TEST_DIRECTORY_POSTGRES } else { TEST_DIRECTORY }; + std::fs::read_dir(path) + .unwrap() + .map(|path| path.unwrap().path()) + .filter(|path| options.check_test_file(path.as_path())) + .collect() +} + /// Create a SessionContext, configured for the specific test async fn context_for_test_file(file_name: &str) -> SessionContext { match file_name { @@ -107,6 +154,9 @@ struct Options { /// Auto complete mode to fill out expected results complete_mode: bool, + + /// Run Postgres compatibility tests + postgres_mode: bool, } impl Options { @@ -114,6 +164,7 @@ impl Options { let args: Vec<_> = std::env::args().collect(); let complete_mode = args.iter().any(|a| a == "--complete"); + let postgres_mode = args.iter().any(|a| a == "--postgres"); // treat args after the first as filters to run (substring matching) let filters = if !args.is_empty() { @@ -129,6 +180,7 @@ impl Options { Self { filters, complete_mode, + postgres_mode, } } diff --git a/datafusion/core/tests/sqllogictests/src/setup.rs b/datafusion/core/tests/sqllogictests/src/setup.rs index 24c0cf8d308a..71015bca1ce7 100644 --- a/datafusion/core/tests/sqllogictests/src/setup.rs +++ b/datafusion/core/tests/sqllogictests/src/setup.rs @@ -111,7 +111,7 @@ fn register_median_test_tables(ctx: &SessionContext) { } } -async fn register_aggregate_csv_by_sql(ctx: &SessionContext) { +pub async fn register_aggregate_csv_by_sql(ctx: &SessionContext) { let test_data = datafusion::test_util::arrow_test_data(); let df = ctx @@ -119,15 +119,15 @@ async fn register_aggregate_csv_by_sql(ctx: &SessionContext) { " CREATE EXTERNAL TABLE aggregate_test_100_by_sql ( c1 VARCHAR NOT NULL, - c2 TINYINT NOT NULL, + c2 INT NOT NULL, c3 SMALLINT NOT NULL, - c4 SMALLINT NOT NULL, - c5 INTEGER NOT NULL, + c4 SMALLINT, + c5 INT, c6 BIGINT NOT NULL, c7 SMALLINT NOT NULL, c8 INT NOT NULL, - c9 INT UNSIGNED NOT NULL, - c10 BIGINT UNSIGNED NOT NULL, + c9 BIGINT NOT NULL, + c10 VARCHAR NOT NULL, c11 FLOAT NOT NULL, c12 DOUBLE NOT NULL, c13 VARCHAR NOT NULL diff --git a/integration-tests/create_test_table_postgres.sql b/integration-tests/create_test_table_postgres.sql index 7cc154b1f8f0..0d2b2fa8c8d3 100644 --- a/integration-tests/create_test_table_postgres.sql +++ b/integration-tests/create_test_table_postgres.sql @@ -2,8 +2,8 @@ CREATE TABLE IF NOT EXISTS test ( c1 character varying NOT NULL, c2 integer NOT NULL, c3 smallint NOT NULL, -c4 smallint NOT NULL, -c5 integer NOT NULL, +c4 smallint, +c5 integer, c6 bigint NOT NULL, c7 smallint NOT NULL, c8 integer NOT NULL, From 815031490af16959bce9e64de9bf440205fad69f Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Fri, 6 Jan 2023 20:45:52 +0100 Subject: [PATCH 03/19] clippy and fmt --- datafusion/core/src/test_util.rs | 5 +- .../src/engines/datafusion/insert/mod.rs | 2 +- .../src/engines/datafusion/mod.rs | 9 ++-- .../tests/sqllogictests/src/engines/mod.rs | 2 - .../sqllogictests/src/engines/postgres/mod.rs | 50 +++++++++++++------ .../core/tests/sqllogictests/src/main.rs | 31 +++++++++--- 6 files changed, 66 insertions(+), 33 deletions(-) diff --git a/datafusion/core/src/test_util.rs b/datafusion/core/src/test_util.rs index 4ef22cf7fa07..669a1784561b 100644 --- a/datafusion/core/src/test_util.rs +++ b/datafusion/core/src/test_util.rs @@ -156,7 +156,10 @@ pub fn parquet_test_data() -> String { /// Returns either: /// The path referred to in `udf_env` if that variable is set and refers to a directory /// The submodule_data directory relative to CARGO_MANIFEST_PATH -pub fn get_data_dir(udf_env: &str, submodule_data: &str) -> Result> { +pub fn get_data_dir( + udf_env: &str, + submodule_data: &str, +) -> Result> { // Try user defined env. if let Ok(dir) = env::var(udf_env) { let trimmed = dir.trim().to_string(); diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/mod.rs index 0503785c5623..a7a916b61883 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/insert/mod.rs @@ -17,8 +17,8 @@ mod util; -use super::error::Result; use self::util::LogicTestContextProvider; +use super::error::Result; use arrow::record_batch::RecordBatch; use datafusion::datasource::MemTable; use datafusion::prelude::SessionContext; diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs index 6881b17ce884..4acdcae7639e 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs @@ -19,17 +19,17 @@ use std::time::Duration; use sqllogictest::DBOutput; +use self::error::{DFSqlLogicTestError, Result}; +use async_trait::async_trait; use datafusion::arrow::record_batch::RecordBatch; use datafusion::prelude::SessionContext; -use self::error::{DFSqlLogicTestError, Result}; -use sqlparser::ast::Statement as SQLStatement; use datafusion_sql::parser::{DFParser, Statement}; use insert::insert; -use async_trait::async_trait; +use sqlparser::ast::Statement as SQLStatement; mod error; -mod normalize; mod insert; +mod normalize; pub struct DataFusion { ctx: SessionContext, @@ -67,7 +67,6 @@ impl sqllogictest::AsyncDB for DataFusion { } } - async fn run_query(ctx: &SessionContext, sql: impl Into) -> Result { let sql = sql.into(); // Check if the sql is `insert` diff --git a/datafusion/core/tests/sqllogictests/src/engines/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/mod.rs index 82200169640b..2ca1a8366de1 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/mod.rs @@ -1,4 +1,2 @@ pub mod datafusion; pub mod postgres; - - diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs index ada6b0e9bab9..55e064163ad0 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -37,7 +37,10 @@ pub const PG_PORT: u16 = 5432; impl Postgres { pub fn postgres_docker_image() -> GenericImage { - let postgres_test_data = match datafusion::test_util::get_data_dir("POSTGRES_TEST_DATA", "tests/sqllogictests/postgres") { + let postgres_test_data = match datafusion::test_util::get_data_dir( + "POSTGRES_TEST_DATA", + "tests/sqllogictests/postgres", + ) { Ok(pb) => pb.display().to_string(), Err(err) => panic!("failed to get arrow data dir: {err}"), }; @@ -48,17 +51,31 @@ impl Postgres { .with_env_var("POSTGRES_DB", PG_DB) .with_env_var("POSTGRES_USER", PG_USER) .with_env_var("POSTGRES_PASSWORD", PG_PASSWORD) - .with_env_var("POSTGRES_INITDB_ARGS", "--encoding=UTF-8 --lc-collate=C --lc-ctype=C") + .with_env_var( + "POSTGRES_INITDB_ARGS", + "--encoding=UTF-8 --lc-collate=C --lc-ctype=C", + ) .with_exposed_port(PG_PORT) - .with_volume(format!("{0}/csv/aggregate_test_100.csv", datafusion::test_util::arrow_test_data()), "/opt/data/csv/aggregate_test_100.csv") - .with_volume(format!("{0}/postgres_create_table.sql", postgres_test_data), "/docker-entrypoint-initdb.d/0_create_table.sql") + .with_volume( + format!( + "{0}/csv/aggregate_test_100.csv", + datafusion::test_util::arrow_test_data() + ), + "/opt/data/csv/aggregate_test_100.csv", + ) + .with_volume( + format!("{0}/postgres_create_table.sql", postgres_test_data), + "/docker-entrypoint-initdb.d/0_create_table.sql", + ) } - pub async fn connect_with_retry(host: &str, - port: u16, - db: &str, - user: &str, - pass: &str) -> Result { + pub async fn connect_with_retry( + host: &str, + port: u16, + db: &str, + user: &str, + pass: &str, + ) -> Result { let mut retry = 0; loop { let connection_result = Postgres::connect(host, port, db, user, pass).await; @@ -68,16 +85,18 @@ impl Postgres { retry += 1; tokio::time::sleep(Duration::from_millis(500)).await; } - result => break result + result => break result, } } } - async fn connect(host: &str, - port: u16, - db: &str, - user: &str, - pass: &str) -> Result { + async fn connect( + host: &str, + port: u16, + db: &str, + user: &str, + pass: &str, + ) -> Result { let (client, connection) = tokio_postgres::Config::new() .host(host) .port(port) @@ -100,7 +119,6 @@ impl Postgres { } } - impl Drop for Postgres { fn drop(&mut self) { self.join_handle.abort() diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index cc6b8ff20078..00aa907bebb3 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -26,11 +26,11 @@ use testcontainers::clients::Cli as Docker; use datafusion::prelude::SessionContext; use crate::engines::datafusion::DataFusion; -use crate::engines::postgres::{PG_DB, PG_PASSWORD, PG_PORT, PG_USER, Postgres}; +use crate::engines::postgres::{Postgres, PG_DB, PG_PASSWORD, PG_PORT, PG_USER}; +mod engines; mod setup; mod utils; -mod engines; const TEST_DIRECTORY: &str = "tests/sqllogictests/test_files"; const TEST_DIRECTORY_POSTGRES: &str = "tests/sqllogictests/postgres/test_files"; @@ -77,7 +77,10 @@ async fn run_test_file(path: &PathBuf, file_name: String) -> Result<(), Box Result<(), Box> { +async fn run_postgres_test_file( + path: &PathBuf, + file_name: String, +) -> Result<(), Box> { use sqllogictest::{default_validator, update_test_file}; info!("Running postgres test: {}", path.display()); @@ -85,14 +88,19 @@ async fn run_postgres_test_file(path: &PathBuf, file_name: String) -> Result<(), let postgres_container = docker.run(Postgres::postgres_docker_image()); let postgres_client = Postgres::connect_with_retry( - "127.0.0.1", postgres_container.get_host_port_ipv4(PG_PORT), PG_DB, PG_USER, PG_PASSWORD, - ).await?; + "127.0.0.1", + postgres_container.get_host_port_ipv4(PG_PORT), + PG_DB, + PG_USER, + PG_PASSWORD, + ) + .await?; let postgres_runner = sqllogictest::Runner::new(postgres_client); let temp_dir = tempdir()?; let copy_path = temp_dir.path().join(&file_name); - copy(&path, ©_path)?; + copy(path, ©_path)?; update_test_file(©_path, postgres_runner, " ", default_validator).await?; let ctx = SessionContext::new(); @@ -103,7 +111,10 @@ async fn run_postgres_test_file(path: &PathBuf, file_name: String) -> Result<(), Ok(()) } -async fn run_complete_file(path: &PathBuf, file_name: String) -> Result<(), Box> { +async fn run_complete_file( + path: &PathBuf, + file_name: String, +) -> Result<(), Box> { use sqllogictest::{default_validator, update_test_file}; info!("Using complete mode to complete: {}", path.display()); @@ -121,7 +132,11 @@ async fn run_complete_file(path: &PathBuf, file_name: String) -> Result<(), Box< } fn read_test_files(options: &Options) -> Vec { - let path = if options.postgres_mode { TEST_DIRECTORY_POSTGRES } else { TEST_DIRECTORY }; + let path = if options.postgres_mode { + TEST_DIRECTORY_POSTGRES + } else { + TEST_DIRECTORY + }; std::fs::read_dir(path) .unwrap() .map(|path| path.unwrap().path()) From d5369d0b05ce3b00c5a72c90eac567d7494fe20b Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Fri, 6 Jan 2023 22:02:00 +0100 Subject: [PATCH 04/19] Remove unused line --- .../core/tests/sqllogictests/postgres/test_files/simple_sort.slt | 1 - 1 file changed, 1 deletion(-) diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt index 8de1adbac4f6..42a37f9ac9b1 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt @@ -15,7 +15,6 @@ # specific language governing permissions and limitations # under the License. -# halt query IIT SELECT c2, From d06ef0f0603681357e2a5be8adcad34186f11bfa Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Mon, 9 Jan 2023 22:11:40 +0100 Subject: [PATCH 05/19] Floating types rounding --- datafusion/core/Cargo.toml | 3 + .../test_files/simple_aggregation.slt | 7 +- .../postgres/test_files/simple_group_by.slt | 8 +- .../test_files/simple_math_expressions.slt | 6 +- .../test_files/simple_sort_nulls_order.slt | 2 +- .../simple_window_full_aggregation.slt | 103 ++++++- .../simple_window_ordered_aggregation.slt | 103 ++++++- .../simple_window_partition_aggregation.slt | 103 ++++++- ...ple_window_partition_order_aggregation.slt | 112 +++++++- .../sqllogictests/src/engines/conversion.rs | 58 ++++ .../src/engines/datafusion/normalize.rs | 58 ++-- .../tests/sqllogictests/src/engines/mod.rs | 1 + .../src/engines/postgres/image.rs | 40 +++ .../sqllogictests/src/engines/postgres/mod.rs | 258 ++++++++++++------ .../core/tests/sqllogictests/src/main.rs | 16 +- 15 files changed, 751 insertions(+), 127 deletions(-) create mode 100644 datafusion/core/tests/sqllogictests/src/engines/conversion.rs create mode 100644 datafusion/core/tests/sqllogictests/src/engines/postgres/image.rs diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 80e6539c3609..462b14e5cc65 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -109,7 +109,10 @@ ctor = "0.1.22" doc-comment = "0.3" env_logger = "0.10" parquet-test-utils = { path = "../../parquet-test-utils" } +postgres-types = { version = "0.2.4", features = ["derive", "with-chrono-0_4"] } rstest = "0.16.0" +rust_decimal = { version = "1.27.0", features = ["tokio-pg"] } +half = "2.2.1" sqllogictest = "0.10.0" test-utils = { path = "../../test-utils" } tokio-postgres = "0.7.7" diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt index ee12d38b6d6f..b10ccdebc325 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt @@ -15,15 +15,14 @@ # specific language governing permissions and limitations # under the License. -# 100 100 7.8100000000000000 781 125 -117 --- postgres -# 100 100 7.81 781 125 -117 --- datafusion - query IIRIII SELECT count(*) AS count_all, count(c3) AS count_c3, - round(avg(c3), 0) AS avg, + avg(c3) AS avg, sum(c3) AS sum, max(c3) AS max, min(c3) AS min FROM aggregate_test_100_by_sql; +---- +100 100 7.81 781 125 -117 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt index 3b5b953e9d05..c77c0c6b598b 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt @@ -19,10 +19,16 @@ query IIRIII select c2, sum(c3) sum_c3, - round(avg(c3), 0) avg_c3, + avg(c3) avg_c3, max(c3) max_c3, min(c3) min_c3, count(c3) count_c3 from aggregate_test_100_by_sql group by c2 order by c2; +---- +1 367 16.681818181818 125 -99 22 +2 184 8.363636363636 122 -117 22 +3 395 20.789473684211 123 -101 19 +4 29 1.260869565217 123 -117 23 +5 -194 -13.857142857143 118 -101 14 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt index 22f5f3bd23fa..c61c5303a85c 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt @@ -18,7 +18,9 @@ query RRRRR SELECT abs(-1.1) as abs, - round(exp(2.0), 0) as exp, + exp(2.0) as exp, sin(3.0) as sin, cos(4.0) as cos, - round(tan(5.0)) as tan; + tan(5.0) as tan; +---- +1.1 7.389056098931 0.14112000806 -0.653643620864 -3.380515006247 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt index a4388008596c..d07f040dec58 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt @@ -21,4 +21,4 @@ SELECT c4, c10 FROM aggregate_test_100_by_sql -ORDER BY c5 ASC, c4 DESC, c10; \ No newline at end of file +ORDER BY c5 ASC, c4 DESC, c10; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt index 456dd682a6fc..5ec31226fc99 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt @@ -19,9 +19,110 @@ query IIRIII SELECT row_number() OVER () AS row_number, count(c3) OVER () AS count_c3, - round(avg(c3) OVER (), 0) AS avg, + avg(c3) OVER () AS avg, sum(c3) OVER () AS sum, max(c3) OVER () AS max, min(c3) OVER () AS min FROM aggregate_test_100_by_sql ORDER BY row_number; +---- +1 100 7.81 781 125 -117 +2 100 7.81 781 125 -117 +3 100 7.81 781 125 -117 +4 100 7.81 781 125 -117 +5 100 7.81 781 125 -117 +6 100 7.81 781 125 -117 +7 100 7.81 781 125 -117 +8 100 7.81 781 125 -117 +9 100 7.81 781 125 -117 +10 100 7.81 781 125 -117 +11 100 7.81 781 125 -117 +12 100 7.81 781 125 -117 +13 100 7.81 781 125 -117 +14 100 7.81 781 125 -117 +15 100 7.81 781 125 -117 +16 100 7.81 781 125 -117 +17 100 7.81 781 125 -117 +18 100 7.81 781 125 -117 +19 100 7.81 781 125 -117 +20 100 7.81 781 125 -117 +21 100 7.81 781 125 -117 +22 100 7.81 781 125 -117 +23 100 7.81 781 125 -117 +24 100 7.81 781 125 -117 +25 100 7.81 781 125 -117 +26 100 7.81 781 125 -117 +27 100 7.81 781 125 -117 +28 100 7.81 781 125 -117 +29 100 7.81 781 125 -117 +30 100 7.81 781 125 -117 +31 100 7.81 781 125 -117 +32 100 7.81 781 125 -117 +33 100 7.81 781 125 -117 +34 100 7.81 781 125 -117 +35 100 7.81 781 125 -117 +36 100 7.81 781 125 -117 +37 100 7.81 781 125 -117 +38 100 7.81 781 125 -117 +39 100 7.81 781 125 -117 +40 100 7.81 781 125 -117 +41 100 7.81 781 125 -117 +42 100 7.81 781 125 -117 +43 100 7.81 781 125 -117 +44 100 7.81 781 125 -117 +45 100 7.81 781 125 -117 +46 100 7.81 781 125 -117 +47 100 7.81 781 125 -117 +48 100 7.81 781 125 -117 +49 100 7.81 781 125 -117 +50 100 7.81 781 125 -117 +51 100 7.81 781 125 -117 +52 100 7.81 781 125 -117 +53 100 7.81 781 125 -117 +54 100 7.81 781 125 -117 +55 100 7.81 781 125 -117 +56 100 7.81 781 125 -117 +57 100 7.81 781 125 -117 +58 100 7.81 781 125 -117 +59 100 7.81 781 125 -117 +60 100 7.81 781 125 -117 +61 100 7.81 781 125 -117 +62 100 7.81 781 125 -117 +63 100 7.81 781 125 -117 +64 100 7.81 781 125 -117 +65 100 7.81 781 125 -117 +66 100 7.81 781 125 -117 +67 100 7.81 781 125 -117 +68 100 7.81 781 125 -117 +69 100 7.81 781 125 -117 +70 100 7.81 781 125 -117 +71 100 7.81 781 125 -117 +72 100 7.81 781 125 -117 +73 100 7.81 781 125 -117 +74 100 7.81 781 125 -117 +75 100 7.81 781 125 -117 +76 100 7.81 781 125 -117 +77 100 7.81 781 125 -117 +78 100 7.81 781 125 -117 +79 100 7.81 781 125 -117 +80 100 7.81 781 125 -117 +81 100 7.81 781 125 -117 +82 100 7.81 781 125 -117 +83 100 7.81 781 125 -117 +84 100 7.81 781 125 -117 +85 100 7.81 781 125 -117 +86 100 7.81 781 125 -117 +87 100 7.81 781 125 -117 +88 100 7.81 781 125 -117 +89 100 7.81 781 125 -117 +90 100 7.81 781 125 -117 +91 100 7.81 781 125 -117 +92 100 7.81 781 125 -117 +93 100 7.81 781 125 -117 +94 100 7.81 781 125 -117 +95 100 7.81 781 125 -117 +96 100 7.81 781 125 -117 +97 100 7.81 781 125 -117 +98 100 7.81 781 125 -117 +99 100 7.81 781 125 -117 +100 100 7.81 781 125 -117 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt index a4ae0df8af05..a47d1fc0363f 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt @@ -20,9 +20,110 @@ SELECT c9, row_number() OVER (ORDER BY c2, c9) AS row_number, count(c3) OVER (ORDER BY c9) AS count_c3, - round(avg(c3) OVER (ORDER BY c2), 0) AS avg_c3_by_c2, + avg(c3) OVER (ORDER BY c2) AS avg_c3_by_c2, sum(c3) OVER (ORDER BY c2) AS sum_c3_by_c2, max(c3) OVER (ORDER BY c2) AS max_c3_by_c2, min(c3) OVER (ORDER BY c2) AS min_c3_by_c2 FROM aggregate_test_100_by_sql ORDER BY row_number; +---- +225513085 1 6 16.681818181818 367 125 -99 +473294098 2 11 16.681818181818 367 125 -99 +520189543 3 12 16.681818181818 367 125 -99 +774637006 4 19 16.681818181818 367 125 -99 +879082834 5 21 16.681818181818 367 125 -99 +1454057357 6 34 16.681818181818 367 125 -99 +1842680163 7 40 16.681818181818 367 125 -99 +2125812933 8 46 16.681818181818 367 125 -99 +2610290479 9 56 16.681818181818 367 125 -99 +2669374863 10 57 16.681818181818 367 125 -99 +2712615025 11 59 16.681818181818 367 125 -99 +2830981072 12 62 16.681818181818 367 125 -99 +2861376515 13 64 16.681818181818 367 125 -99 +3275293996 14 72 16.681818181818 367 125 -99 +3276123488 15 73 16.681818181818 367 125 -99 +3542840110 16 82 16.681818181818 367 125 -99 +3625286410 17 87 16.681818181818 367 125 -99 +3766999078 18 90 16.681818181818 367 125 -99 +4015442341 19 94 16.681818181818 367 125 -99 +4076864659 20 96 16.681818181818 367 125 -99 +4216440507 21 98 16.681818181818 367 125 -99 +4229654142 22 99 16.681818181818 367 125 -99 +63044568 23 2 12.522727272727 551 125 -117 +141680161 24 4 12.522727272727 551 125 -117 +145294611 25 5 12.522727272727 551 125 -117 +598822671 26 16 12.522727272727 551 125 -117 +1000948272 27 24 12.522727272727 551 125 -117 +1098639440 28 27 12.522727272727 551 125 -117 +1157161427 29 28 12.522727272727 551 125 -117 +1289293657 30 31 12.522727272727 551 125 -117 +1491205016 31 35 12.522727272727 551 125 -117 +2013662838 32 43 12.522727272727 551 125 -117 +2293105904 33 48 12.522727272727 551 125 -117 +2525744318 34 54 12.522727272727 551 125 -117 +2705709344 35 58 12.522727272727 551 125 -117 +2844041986 36 63 12.522727272727 551 125 -117 +2939920218 37 66 12.522727272727 551 125 -117 +3188005828 38 70 12.522727272727 551 125 -117 +3314983189 39 74 12.522727272727 551 125 -117 +3398507249 40 77 12.522727272727 551 125 -117 +3455216719 41 78 12.522727272727 551 125 -117 +3717551163 42 88 12.522727272727 551 125 -117 +4061635107 43 95 12.522727272727 551 125 -117 +4144173353 44 97 12.522727272727 551 125 -117 +243203849 45 7 15.015873015873 946 125 -117 +431948861 46 9 15.015873015873 946 125 -117 +559847112 47 15 15.015873015873 946 125 -117 +754775609 48 18 15.015873015873 946 125 -117 +1088543984 49 26 15.015873015873 946 125 -117 +1362369177 50 32 15.015873015873 946 125 -117 +1538863055 51 37 15.015873015873 946 125 -117 +1824517658 52 39 15.015873015873 946 125 -117 +1995343206 53 42 15.015873015873 946 125 -117 +2093538928 54 45 15.015873015873 946 125 -117 +2214035726 55 47 15.015873015873 946 125 -117 +2592330556 56 55 15.015873015873 946 125 -117 +3105312559 57 68 15.015873015873 946 125 -117 +3473924576 58 80 15.015873015873 946 125 -117 +3577318119 59 85 15.015873015873 946 125 -117 +3759340273 60 89 15.015873015873 946 125 -117 +3862393166 61 91 15.015873015873 946 125 -117 +3959216334 62 92 15.015873015873 946 125 -117 +3998790955 63 93 15.015873015873 946 125 -117 +28774375 64 1 11.337209302326 975 125 -117 +326151275 65 8 11.337209302326 975 125 -117 +466439833 66 10 11.337209302326 975 125 -117 +538589788 67 13 11.337209302326 975 125 -117 +557517119 68 14 11.337209302326 975 125 -117 +811650497 69 20 11.337209302326 975 125 -117 +933879086 70 22 11.337209302326 975 125 -117 +1243785310 71 30 11.337209302326 975 125 -117 +1534194097 72 36 11.337209302326 975 125 -117 +1787652631 73 38 11.337209302326 975 125 -117 +1865307672 74 41 11.337209302326 975 125 -117 +2042457019 75 44 11.337209302326 975 125 -117 +2306130875 76 49 11.337209302326 975 125 -117 +2502326480 77 53 11.337209302326 975 125 -117 +2778168728 78 60 11.337209302326 975 125 -117 +2818832252 79 61 11.337209302326 975 125 -117 +3023531799 80 67 11.337209302326 975 125 -117 +3126475872 81 69 11.337209302326 975 125 -117 +3198969145 82 71 11.337209302326 975 125 -117 +3521368277 83 81 11.337209302326 975 125 -117 +3566741189 84 83 11.337209302326 975 125 -117 +3570297463 85 84 11.337209302326 975 125 -117 +3593959807 86 86 11.337209302326 975 125 -117 +141047417 87 3 7.81 781 125 -117 +662099130 88 17 7.81 781 125 -117 +974297360 89 23 7.81 781 125 -117 +1013876852 90 25 7.81 781 125 -117 +1229567292 91 29 7.81 781 125 -117 +1365198901 92 33 7.81 781 125 -117 +2307004493 93 50 7.81 781 125 -117 +2424630722 94 51 7.81 781 125 -117 +2496054700 95 52 7.81 781 125 -117 +2861911482 96 65 7.81 781 125 -117 +3342719438 97 75 7.81 781 125 -117 +3373581039 98 76 7.81 781 125 -117 +3457053821 99 79 7.81 781 125 -117 +4268716378 100 100 7.81 781 125 -117 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt index baa0c32a8639..3851387ec964 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt @@ -20,9 +20,110 @@ SELECT c9, row_number() OVER (PARTITION BY c2, c9) AS row_number, count(c3) OVER (PARTITION BY c2) AS count_c3, - round(avg(c3) OVER (PARTITION BY c2), 0) AS avg_c3_by_c2, + avg(c3) OVER (PARTITION BY c2) AS avg_c3_by_c2, sum(c3) OVER (PARTITION BY c2) AS sum_c3_by_c2, max(c3) OVER (PARTITION BY c2) AS max_c3_by_c2, min(c3) OVER (PARTITION BY c2) AS min_c3_by_c2 FROM aggregate_test_100_by_sql ORDER BY c9; +---- +28774375 1 23 1.260869565217 29 123 -117 +63044568 1 22 8.363636363636 184 122 -117 +141047417 1 14 -13.857142857143 -194 118 -101 +141680161 1 22 8.363636363636 184 122 -117 +145294611 1 22 8.363636363636 184 122 -117 +225513085 1 22 16.681818181818 367 125 -99 +243203849 1 19 20.789473684211 395 123 -101 +326151275 1 23 1.260869565217 29 123 -117 +431948861 1 19 20.789473684211 395 123 -101 +466439833 1 23 1.260869565217 29 123 -117 +473294098 1 22 16.681818181818 367 125 -99 +520189543 1 22 16.681818181818 367 125 -99 +538589788 1 23 1.260869565217 29 123 -117 +557517119 1 23 1.260869565217 29 123 -117 +559847112 1 19 20.789473684211 395 123 -101 +598822671 1 22 8.363636363636 184 122 -117 +662099130 1 14 -13.857142857143 -194 118 -101 +754775609 1 19 20.789473684211 395 123 -101 +774637006 1 22 16.681818181818 367 125 -99 +811650497 1 23 1.260869565217 29 123 -117 +879082834 1 22 16.681818181818 367 125 -99 +933879086 1 23 1.260869565217 29 123 -117 +974297360 1 14 -13.857142857143 -194 118 -101 +1000948272 1 22 8.363636363636 184 122 -117 +1013876852 1 14 -13.857142857143 -194 118 -101 +1088543984 1 19 20.789473684211 395 123 -101 +1098639440 1 22 8.363636363636 184 122 -117 +1157161427 1 22 8.363636363636 184 122 -117 +1229567292 1 14 -13.857142857143 -194 118 -101 +1243785310 1 23 1.260869565217 29 123 -117 +1289293657 1 22 8.363636363636 184 122 -117 +1362369177 1 19 20.789473684211 395 123 -101 +1365198901 1 14 -13.857142857143 -194 118 -101 +1454057357 1 22 16.681818181818 367 125 -99 +1491205016 1 22 8.363636363636 184 122 -117 +1534194097 1 23 1.260869565217 29 123 -117 +1538863055 1 19 20.789473684211 395 123 -101 +1787652631 1 23 1.260869565217 29 123 -117 +1824517658 1 19 20.789473684211 395 123 -101 +1842680163 1 22 16.681818181818 367 125 -99 +1865307672 1 23 1.260869565217 29 123 -117 +1995343206 1 19 20.789473684211 395 123 -101 +2013662838 1 22 8.363636363636 184 122 -117 +2042457019 1 23 1.260869565217 29 123 -117 +2093538928 1 19 20.789473684211 395 123 -101 +2125812933 1 22 16.681818181818 367 125 -99 +2214035726 1 19 20.789473684211 395 123 -101 +2293105904 1 22 8.363636363636 184 122 -117 +2306130875 1 23 1.260869565217 29 123 -117 +2307004493 1 14 -13.857142857143 -194 118 -101 +2424630722 1 14 -13.857142857143 -194 118 -101 +2496054700 1 14 -13.857142857143 -194 118 -101 +2502326480 1 23 1.260869565217 29 123 -117 +2525744318 1 22 8.363636363636 184 122 -117 +2592330556 1 19 20.789473684211 395 123 -101 +2610290479 1 22 16.681818181818 367 125 -99 +2669374863 1 22 16.681818181818 367 125 -99 +2705709344 1 22 8.363636363636 184 122 -117 +2712615025 1 22 16.681818181818 367 125 -99 +2778168728 1 23 1.260869565217 29 123 -117 +2818832252 1 23 1.260869565217 29 123 -117 +2830981072 1 22 16.681818181818 367 125 -99 +2844041986 1 22 8.363636363636 184 122 -117 +2861376515 1 22 16.681818181818 367 125 -99 +2861911482 1 14 -13.857142857143 -194 118 -101 +2939920218 1 22 8.363636363636 184 122 -117 +3023531799 1 23 1.260869565217 29 123 -117 +3105312559 1 19 20.789473684211 395 123 -101 +3126475872 1 23 1.260869565217 29 123 -117 +3188005828 1 22 8.363636363636 184 122 -117 +3198969145 1 23 1.260869565217 29 123 -117 +3275293996 1 22 16.681818181818 367 125 -99 +3276123488 1 22 16.681818181818 367 125 -99 +3314983189 1 22 8.363636363636 184 122 -117 +3342719438 1 14 -13.857142857143 -194 118 -101 +3373581039 1 14 -13.857142857143 -194 118 -101 +3398507249 1 22 8.363636363636 184 122 -117 +3455216719 1 22 8.363636363636 184 122 -117 +3457053821 1 14 -13.857142857143 -194 118 -101 +3473924576 1 19 20.789473684211 395 123 -101 +3521368277 1 23 1.260869565217 29 123 -117 +3542840110 1 22 16.681818181818 367 125 -99 +3566741189 1 23 1.260869565217 29 123 -117 +3570297463 1 23 1.260869565217 29 123 -117 +3577318119 1 19 20.789473684211 395 123 -101 +3593959807 1 23 1.260869565217 29 123 -117 +3625286410 1 22 16.681818181818 367 125 -99 +3717551163 1 22 8.363636363636 184 122 -117 +3759340273 1 19 20.789473684211 395 123 -101 +3766999078 1 22 16.681818181818 367 125 -99 +3862393166 1 19 20.789473684211 395 123 -101 +3959216334 1 19 20.789473684211 395 123 -101 +3998790955 1 19 20.789473684211 395 123 -101 +4015442341 1 22 16.681818181818 367 125 -99 +4061635107 1 22 8.363636363636 184 122 -117 +4076864659 1 22 16.681818181818 367 125 -99 +4144173353 1 22 8.363636363636 184 122 -117 +4216440507 1 22 16.681818181818 367 125 -99 +4229654142 1 22 16.681818181818 367 125 -99 +4268716378 1 14 -13.857142857143 -194 118 -101 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt index 1d0771b18d31..86f3fb94ed16 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt @@ -15,23 +15,115 @@ # specific language governing permissions and limitations # under the License. -# before round -# 4268716378 14 14 -13.8571428571428571 -194 118 -101 ---- postgres -# 4268716378 14 14 -13.857142857142858 -194 118 -101 ---- datafusion - -# before abs -# 2818832252 16 16 0 -3 102 -111 ---- postgres -# 2818832252 16 16 -0 -3 102 -111 ---- datafusion - query IIIRIII SELECT c9, row_number() OVER (PARTITION BY c2 ORDER BY c9) AS row_number, count(c3) OVER (PARTITION BY c2 ORDER BY c9) AS count_c3, - abs(round(avg(c3) OVER (PARTITION BY c2 ORDER BY c9), 0)) AS avg_c3_by_c2, + avg(c3) OVER (PARTITION BY c2 ORDER BY c9) AS avg_c3_by_c2, sum(c3) OVER (PARTITION BY c2 ORDER BY c9) AS sum_c3_by_c2, max(c3) OVER (PARTITION BY c2 ORDER BY c9) AS max_c3_by_c2, min(c3) OVER (PARTITION BY c2 ORDER BY c9) AS min_c3_by_c2 FROM aggregate_test_100_by_sql ORDER BY c9; - +---- +28774375 1 1 30 30 30 30 +63044568 1 1 113 113 113 113 +141047417 1 1 36 36 36 36 +141680161 2 2 3.5 7 113 -106 +145294611 3 3 17.333333333333 52 113 -106 +225513085 1 1 -98 -98 -98 -98 +243203849 1 1 -101 -101 -101 -101 +326151275 2 2 38.5 77 47 30 +431948861 2 2 -43.5 -87 14 -101 +466439833 3 3 -8 -24 47 -101 +473294098 2 2 -14 -28 70 -98 +520189543 3 3 -17.333333333333 -52 70 -98 +538589788 4 4 12.25 49 73 -101 +557517119 5 5 -1.4 -7 73 -101 +559847112 3 3 -60.666666666667 -182 14 -101 +598822671 4 4 5.75 23 113 -106 +662099130 2 2 50 100 64 36 +754775609 4 4 -41.25 -165 17 -101 +774637006 4 4 -34.25 -137 70 -98 +811650497 6 6 8 48 73 -101 +879082834 5 5 -16 -80 70 -98 +933879086 7 7 9.285714285714 65 73 -101 +974297360 3 3 56 168 68 36 +1000948272 5 5 23.2 116 113 -106 +1013876852 4 4 34.25 137 68 -31 +1088543984 5 5 -18.4 -92 73 -101 +1098639440 6 6 24.5 147 113 -106 +1157161427 7 7 5.714285714286 40 113 -107 +1229567292 5 5 51 255 118 -31 +1243785310 8 8 -5.75 -46 73 -111 +1289293657 8 8 11.125 89 113 -107 +1362369177 6 6 -11.666666666667 -70 73 -101 +1365198901 6 6 32.666666666667 196 118 -59 +1454057357 6 6 -22.666666666667 -136 70 -98 +1491205016 9 9 10 90 113 -107 +1534194097 9 9 6.222222222222 56 102 -111 +1538863055 7 7 -7.571428571429 -53 73 -101 +1787652631 10 10 1.8 18 102 -111 +1824517658 8 8 -16.125 -129 73 -101 +1842680163 7 7 -11.714285714286 -82 70 -98 +1865307672 11 11 7.545454545455 83 102 -111 +1995343206 9 9 -22.333333333333 -201 73 -101 +2013662838 10 10 14.2 142 113 -107 +2042457019 12 12 15 180 102 -111 +2093538928 10 10 -12.4 -124 77 -101 +2125812933 8 8 -5.125 -41 70 -98 +2214035726 11 11 -10.090909090909 -111 77 -101 +2293105904 11 11 2.272727272727 25 113 -117 +2306130875 13 13 14.076923076923 183 102 -111 +2307004493 7 7 36.857142857143 258 118 -59 +2424630722 8 8 31.625 253 118 -59 +2496054700 9 9 16.888888888889 152 118 -101 +2502326480 14 14 9.214285714286 129 102 -111 +2525744318 12 12 -2.916666666667 -35 113 -117 +2592330556 12 12 1 12 123 -101 +2610290479 9 9 -0.555555555556 -5 70 -98 +2669374863 10 10 -1 -10 70 -98 +2705709344 13 13 2.153846153846 28 113 -117 +2712615025 11 11 2.545454545455 28 70 -98 +2778168728 15 15 5.066666666667 76 102 -111 +2818832252 16 16 -0.1875 -3 102 -111 +2830981072 12 12 12.333333333333 148 120 -98 +2844041986 14 14 -2.285714285714 -32 113 -117 +2861376515 13 13 10.769230769231 140 120 -98 +2861911482 10 10 6.6 66 118 -101 +2939920218 15 15 -5 -75 113 -117 +3023531799 17 17 -7.058823529412 -120 102 -117 +3105312559 13 13 6.384615384615 83 123 -101 +3126475872 18 18 -6.388888888889 -115 102 -117 +3188005828 16 16 1.375 22 113 -117 +3198969145 19 19 -2.157894736842 -41 102 -117 +3275293996 14 14 12.071428571429 169 120 -98 +3276123488 15 15 9.6 144 120 -98 +3314983189 17 17 4.352941176471 74 113 -117 +3342719438 11 11 -1.454545454545 -16 118 -101 +3373581039 12 12 -4.666666666667 -56 118 -101 +3398507249 18 18 5.722222222222 103 113 -117 +3455216719 19 19 9 171 113 -117 +3457053821 13 13 -7.692307692308 -100 118 -101 +3473924576 14 14 12.857142857143 180 123 -101 +3521368277 20 20 2.75 55 102 -117 +3542840110 16 16 4.5 72 120 -98 +3566741189 21 21 8.47619047619 178 123 -117 +3570297463 22 22 5.409090909091 119 123 -117 +3577318119 15 15 18.933333333333 284 123 -101 +3593959807 23 23 1.260869565217 29 123 -117 +3625286410 17 17 11.588235294118 197 125 -98 +3717551163 20 20 6.15 123 113 -117 +3759340273 16 16 24.75 396 123 -101 +3766999078 18 18 16.666666666667 300 125 -98 +3862393166 17 17 23.176470588235 394 123 -101 +3959216334 18 18 21.222222222222 382 123 -101 +3998790955 19 19 20.789473684211 395 123 -101 +4015442341 19 19 20.157894736842 383 125 -98 +4061635107 21 21 11.666666666667 245 122 -117 +4076864659 20 20 19.75 395 125 -98 +4144173353 22 22 8.363636363636 184 122 -117 +4216440507 21 21 14.095238095238 296 125 -99 +4229654142 22 22 16.681818181818 367 125 -99 +4268716378 14 14 -13.857142857143 -194 118 -101 diff --git a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs new file mode 100644 index 000000000000..ea23009c0f63 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs @@ -0,0 +1,58 @@ +use half::f16; +use rust_decimal::{Decimal, RoundingStrategy}; + +pub fn bool_to_str(value: bool) -> String { + if value { + "t".to_string() + } else { + "f".to_string() + } +} + +pub fn varchar_to_str(value: &str) -> String { + if value.is_empty() { + "(empty)".to_string() + } else { + value.to_string() + } +} + +pub fn float2_to_str(value: f16) -> String { + if value.is_nan() { + "NaN".to_string() + } else if value == f16::INFINITY { + "Infinity".to_string() + } else if value == f16::NEG_INFINITY { + "-Infinity".to_string() + } else { + decimal_to_str(Decimal::from_f32_retain(value.to_f32()).unwrap()) + } +} + +pub fn float4_to_str(value: f32) -> String { + if value.is_nan() { + "NaN".to_string() + } else if value == f32::INFINITY { + "Infinity".to_string() + } else if value == f32::NEG_INFINITY { + "-Infinity".to_string() + } else { + decimal_to_str(Decimal::from_f32_retain(value).unwrap()) + } +} + +pub fn float8_to_str(value: f64) -> String { + if value.is_nan() { + "NaN".to_string() + } else if value == f64::INFINITY { + "Infinity".to_string() + } else if value == f64::NEG_INFINITY { + "-Infinity".to_string() + } else { + decimal_to_str(Decimal::from_f64_retain(value).unwrap()) + } +} + +pub fn decimal_to_str(value: Decimal) -> String { + value.round_dp(12).normalize().to_string() +} diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs index 78cfa49ccedf..50f96be6d935 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs @@ -15,10 +15,12 @@ // specific language governing permissions and limitations // under the License. -use super::error::{DFSqlLogicTestError, Result}; -use arrow::{array::ArrayRef, datatypes::DataType, record_batch::RecordBatch}; -use datafusion::error::DataFusionError; +use arrow::{array, array::ArrayRef, datatypes::DataType, record_batch::RecordBatch}; use sqllogictest::{ColumnType, DBOutput}; +use datafusion::error::DataFusionError; + +use super::super::conversion::*; +use super::error::{DFSqlLogicTestError, Result}; /// Converts `batches` to a DBOutput as expected by sqllogicteset. /// @@ -67,6 +69,27 @@ fn convert_batch(batch: RecordBatch) -> Result>> { .collect() } +macro_rules! get_row_value { + ($array_type:ty, $column: ident, $row: ident) => {{ + let array = $column.as_any().downcast_ref::<$array_type>().unwrap(); + + array.value($row) + }}; +} + +macro_rules! get_string_value { + ($array_type:ty, $column: ident, $row: ident) => {{ + let array = $column.as_any().downcast_ref::<$array_type>().unwrap(); + + let s = array.value($row); + if s.is_empty() { + "(empty)".to_string() + } else { + s.to_string() + } + }}; +} + /// Normalizes the content of a single cell in RecordBatch prior to printing. /// /// This is to make the output comparable to the semi-standard .slt format @@ -75,21 +98,22 @@ fn convert_batch(batch: RecordBatch) -> Result>> { /// /// [NULL Values and empty strings]: https://duckdb.org/dev/sqllogictest/result_verification#null-values-and-empty-strings /// +/// Floating numbers are rounded to have a consistent representation with the Postgres runner. +/// pub fn cell_to_string(col: &ArrayRef, row: usize) -> Result { - // represent any null value with the string "NULL" + f64::max; if !col.is_valid(row) { - return Ok("NULL".into()); + // represent any null value with the string "NULL" + Ok("NULL".to_string()) + } else { + match col.data_type() { + DataType::Boolean => Ok(bool_to_str(get_row_value!(array::BooleanArray, col, row))), + DataType::Float16 => Ok(float2_to_str(get_row_value!(array::Float16Array, col, row))), + DataType::Float32 => Ok(float4_to_str(get_row_value!(array::Float32Array, col, row))), + DataType::Float64 => Ok(float8_to_str(get_row_value!(array::Float64Array, col, row))), + DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(array::LargeStringArray, col, row))), + DataType::Utf8 => Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))), + _ => arrow::util::display::array_value_to_string(col, row) + }.map_err(DFSqlLogicTestError::Arrow) } - - // Convert to normal string representation - let mut s = arrow::util::display::array_value_to_string(col, row) - .map_err(DFSqlLogicTestError::Arrow)?; - - // apply subsequent normalization depending on type if - if matches!(col.data_type(), DataType::Utf8 | DataType::LargeUtf8) && s.is_empty() { - // All empty strings are replaced with this value - s = "(empty)".to_string(); - } - - Ok(s) } diff --git a/datafusion/core/tests/sqllogictests/src/engines/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/mod.rs index 2ca1a8366de1..8e3a108e7a6a 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/mod.rs @@ -1,2 +1,3 @@ pub mod datafusion; pub mod postgres; +mod conversion; diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/image.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/image.rs new file mode 100644 index 000000000000..c285742fc6cd --- /dev/null +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/image.rs @@ -0,0 +1,40 @@ +use testcontainers::core::WaitFor; +use testcontainers::images::generic::GenericImage; + +pub const PG_USER: &str = "postgres"; +pub const PG_PASSWORD: &str = "postgres"; +pub const PG_DB: &str = "test"; +pub const PG_PORT: u16 = 5432; + +pub fn postgres_docker_image() -> GenericImage { + let postgres_test_data = match datafusion::test_util::get_data_dir( + "POSTGRES_TEST_DATA", + "tests/sqllogictests/postgres", + ) { + Ok(pb) => pb.display().to_string(), + Err(err) => panic!("failed to get arrow data dir: {err}"), + }; + GenericImage::new("postgres", "15") + .with_wait_for(WaitFor::message_on_stderr( + "database system is ready to accept connections", + )) + .with_env_var("POSTGRES_DB", PG_DB) + .with_env_var("POSTGRES_USER", PG_USER) + .with_env_var("POSTGRES_PASSWORD", PG_PASSWORD) + .with_env_var( + "POSTGRES_INITDB_ARGS", + "--encoding=UTF-8 --lc-collate=C --lc-ctype=C", + ) + .with_exposed_port(PG_PORT) + .with_volume( + format!( + "{0}/csv/aggregate_test_100.csv", + datafusion::test_util::arrow_test_data() + ), + "/opt/data/csv/aggregate_test_100.csv", + ) + .with_volume( + format!("{0}/postgres_create_table.sql", postgres_test_data), + "/docker-entrypoint-initdb.d/0_create_table.sql", + ) +} diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs index 55e064163ad0..e665290ca78e 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -17,6 +17,7 @@ use std::sync::Arc; use std::time::Duration; +use std::fmt::Write; use async_trait::async_trait; use log::info; @@ -25,50 +26,20 @@ use testcontainers::core::WaitFor; use testcontainers::images::generic::GenericImage; use tokio::task::JoinHandle; +use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime}; +use postgres_types::Type; +use tokio_postgres::{Column, Row}; +use rust_decimal::Decimal; +use super::conversion::*; + +pub mod image; + pub struct Postgres { client: Arc, join_handle: JoinHandle<()>, } -pub const PG_USER: &str = "postgres"; -pub const PG_PASSWORD: &str = "postgres"; -pub const PG_DB: &str = "test"; -pub const PG_PORT: u16 = 5432; - impl Postgres { - pub fn postgres_docker_image() -> GenericImage { - let postgres_test_data = match datafusion::test_util::get_data_dir( - "POSTGRES_TEST_DATA", - "tests/sqllogictests/postgres", - ) { - Ok(pb) => pb.display().to_string(), - Err(err) => panic!("failed to get arrow data dir: {err}"), - }; - GenericImage::new("postgres", "15") - .with_wait_for(WaitFor::message_on_stderr( - "database system is ready to accept connections", - )) - .with_env_var("POSTGRES_DB", PG_DB) - .with_env_var("POSTGRES_USER", PG_USER) - .with_env_var("POSTGRES_PASSWORD", PG_PASSWORD) - .with_env_var( - "POSTGRES_INITDB_ARGS", - "--encoding=UTF-8 --lc-collate=C --lc-ctype=C", - ) - .with_exposed_port(PG_PORT) - .with_volume( - format!( - "{0}/csv/aggregate_test_100.csv", - datafusion::test_util::arrow_test_data() - ), - "/opt/data/csv/aggregate_test_100.csv", - ) - .with_volume( - format!("{0}/postgres_create_table.sql", postgres_test_data), - "/docker-entrypoint-initdb.d/0_create_table.sql", - ) - } - pub async fn connect_with_retry( host: &str, port: u16, @@ -90,13 +61,11 @@ impl Postgres { } } - async fn connect( - host: &str, - port: u16, - db: &str, - user: &str, - pass: &str, - ) -> Result { + pub async fn connect(host: &str, + port: u16, + db: &str, + user: &str, + pass: &str) -> Result { let (client, connection) = tokio_postgres::Config::new() .host(host) .port(port) @@ -125,13 +94,162 @@ impl Drop for Postgres { } } +macro_rules! array_process { + ($row:ident, $row_vec:ident, $idx:ident, $t:ty) => { + let value: Option>> = $row.get($idx); + match value { + Some(value) => { + let mut output = String::new(); + write!(output, "{{").unwrap(); + for (i, v) in value.iter().enumerate() { + match v { + Some(v) => { + write!(output, "{}", v).unwrap(); + } + None => { + write!(output, "NULL").unwrap(); + } + } + if i < value.len() - 1 { + write!(output, ",").unwrap(); + } + } + write!(output, "}}").unwrap(); + $row_vec.push(output); + } + None => { + $row_vec.push("NULL".to_string()); + } + } + }; + ($row:ident, $row_vec:ident, $idx:ident, $t:ty, $convert:ident) => { + let value: Option>> = $row.get($idx); + match value { + Some(value) => { + let mut output = String::new(); + write!(output, "{{").unwrap(); + for (i, v) in value.iter().enumerate() { + match v { + Some(v) => { + write!(output, "{}", $convert(v)).unwrap(); + } + None => { + write!(output, "NULL").unwrap(); + } + } + if i < value.len() - 1 { + write!(output, ",").unwrap(); + } + } + write!(output, "}}").unwrap(); + $row_vec.push(output); + } + None => { + $row_vec.push("NULL".to_string()); + } + } + }; + // ($self:ident, $row:ident, $row_vec:ident, $idx:ident, $t:ty, $ty_name:expr) => { + // let value: Option>> = $row.get($idx); + // match value { + // Some(value) => { + // let mut output = String::new(); + // write!(output, "{{").unwrap(); + // for (i, v) in value.iter().enumerate() { + // match v { + // Some(v) => { + // let sql = format!("select ($1::{})::varchar", stringify!($ty_name)); + // let tmp_rows = $self.client.query(&sql, &[&v]).await.unwrap(); + // let value: &str = tmp_rows.get(0).unwrap().get(0); + // assert!(value.len() > 0); + // write!(output, "{}", value).unwrap(); + // } + // None => { + // write!(output, "NULL").unwrap(); + // } + // } + // if i < value.len() - 1 { + // write!(output, ",").unwrap(); + // } + // } + // write!(output, "}}").unwrap(); + // $row_vec.push(output); + // } + // None => { + // $row_vec.push("NULL".to_string()); + // } + // } + // }; +} + +macro_rules! make_string { + ($row:ident, $idx:ident, $t:ty) => {{ + let value:Option<$t> = $row.get($idx); + value.unwrap().to_string() + }}; + ($row:ident, $idx:ident, $t:ty, $convert:ident) => {{ + let value: Option<$t> = $row.get($idx); + $convert(value.unwrap()).to_string() + }}; +} + +fn cell_to_string(row: &Row, column: &Column, idx: usize) -> String { + if idx >= row.columns().len() { + return "NULL".to_string(); + } + match column.type_().clone() { + Type::INT2 => make_string!(row, idx, i16), + Type::INT4 => make_string!(row, idx, i32), + Type::INT8 => make_string!(row, idx, i64), + Type::NUMERIC => make_string!(row, idx, Decimal, decimal_to_str), + Type::DATE => make_string!(row, idx, NaiveDate), + Type::TIME => make_string!(row, idx, NaiveTime), + Type::TIMESTAMP => make_string!(row, idx, NaiveDateTime), + Type::BOOL => make_string!(row, idx, bool, bool_to_str), + // Type::INT2_ARRAY => array_process!(row, row_vec, idx, i16), + // Type::INT4_ARRAY => array_process!(row, row_vec, idx, i32), + // Type::INT8_ARRAY => array_process!(row, row_vec, idx, i64), + // Type::BOOL_ARRAY => array_process!(row, row_vec, idx, bool, bool_to_str), + // Type::FLOAT4_ARRAY => array_process!(row, row_vec, idx, f32, float4_to_str), + // Type::FLOAT8_ARRAY => array_process!(row, row_vec, idx, f64, float8_to_str), + // Type::NUMERIC_ARRAY => array_process!(row, row_vec, idx, Decimal), + // Type::DATE_ARRAY => array_process!(row, row_vec, idx, NaiveDate), + // Type::TIME_ARRAY => array_process!(row, row_vec, idx, NaiveTime), + // Type::TIMESTAMP_ARRAY => array_process!(row, row_vec, idx, NaiveDateTime), + // Type::VARCHAR_ARRAY | Type::TEXT_ARRAY => array_process!(row, row_vec, idx, String, varchar_to_str), + Type::VARCHAR | Type::TEXT => make_string!(row, idx, &str, varchar_to_str), + Type::FLOAT4 => make_string!(row, idx, f32, float4_to_str), + Type::FLOAT8 => make_string!(row, idx, f64, float8_to_str), + // Type::INTERVAL => { + // single_process!(self, row, row_vec, idx, Interval, INTERVAL); + // } + // Type::TIMESTAMPTZ => { + // single_process!( + // self, + // row, + // row_vec, + // idx, + // DateTime, + // TIMESTAMPTZ + // ); + // } + // Type::INTERVAL_ARRAY => { + // array_process!(self, row, row_vec, idx, Interval, INTERVAL); + // } + // Type::TIMESTAMPTZ_ARRAY => { + // array_process!(self, row, row_vec, idx, DateTime, TIMESTAMPTZ); + // } + _ => { + todo!("Unsupported type: {}", column.type_().name()) + } + } +} + #[async_trait] impl sqllogictest::AsyncDB for Postgres { type Error = tokio_postgres::error::Error; async fn run(&mut self, sql: &str) -> Result { - let mut output = vec![]; - let is_query_sql = { let lower_sql = sql.trim_start().to_ascii_lowercase(); lower_sql.starts_with("select") @@ -140,42 +258,18 @@ impl sqllogictest::AsyncDB for Postgres { || lower_sql.starts_with("with") || lower_sql.starts_with("describe") }; - - // NOTE: - // We use `simple_query` API which returns the query results as strings. - // This means that we can not reformat values based on their type, - // and we have to follow the format given by the specific database (pg). - // For example, postgres will output `t` as true and `f` as false, - // thus we have to write `t`/`f` in the expected results. - let rows = self.client.simple_query(sql).await?; - for row in rows { - let mut row_vec = vec![]; - match row { - tokio_postgres::SimpleQueryMessage::Row(row) => { - for i in 0..row.len() { - match row.get(i) { - Some(v) => { - if v.is_empty() { - row_vec.push("(empty)".to_string()); - } else { - row_vec.push(v.to_string()); - } - } - None => row_vec.push("NULL".to_string()), - } - } - } - tokio_postgres::SimpleQueryMessage::CommandComplete(cnt) => { - if is_query_sql { - break; - } else { - return Ok(DBOutput::StatementComplete(cnt)); - } - } - _ => unreachable!(), - } - output.push(row_vec); + if !is_query_sql { + self.client.execute(sql, &[]).await?; + return Ok(DBOutput::StatementComplete(0)); } + let rows = self.client.query(sql, &[]).await?; + let output = rows.iter().map(|row| { + row.columns().iter().enumerate() + .map(|(idx, column)| { + cell_to_string(&row, &column, idx) + }) + .collect::>() + }).collect::>(); if output.is_empty() { let stmt = self.client.prepare(sql).await?; diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index 00aa907bebb3..840c1651412f 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -26,7 +26,9 @@ use testcontainers::clients::Cli as Docker; use datafusion::prelude::SessionContext; use crate::engines::datafusion::DataFusion; -use crate::engines::postgres::{Postgres, PG_DB, PG_PASSWORD, PG_PORT, PG_USER}; +use crate::engines::postgres; +use crate::engines::postgres::{Postgres}; +use crate::engines::postgres::image::{PG_DB, PG_PASSWORD, PG_PORT, PG_USER}; mod engines; mod setup; @@ -85,7 +87,7 @@ async fn run_postgres_test_file( info!("Running postgres test: {}", path.display()); let docker = Docker::default(); - let postgres_container = docker.run(Postgres::postgres_docker_image()); + let postgres_container = docker.run(postgres::image::postgres_docker_image()); let postgres_client = Postgres::connect_with_retry( "127.0.0.1", @@ -97,17 +99,17 @@ async fn run_postgres_test_file( .await?; let postgres_runner = sqllogictest::Runner::new(postgres_client); - let temp_dir = tempdir()?; - let copy_path = temp_dir.path().join(&file_name); + // let temp_dir = tempdir()?; + // let copy_path = temp_dir.path().join(&file_name); - copy(path, ©_path)?; - update_test_file(©_path, postgres_runner, " ", default_validator).await?; + // copy(path, ©_path)?; + update_test_file(&path, postgres_runner, " ", default_validator).await?; let ctx = SessionContext::new(); setup::register_aggregate_csv_by_sql(&ctx).await; let mut df_runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); - df_runner.run_file_async(copy_path).await?; + df_runner.run_file_async(path).await?; Ok(()) } From f8c122b66df56eec0d51f172025c8fa730817d39 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 09:05:08 +0100 Subject: [PATCH 06/19] Make basic types compatible --- .../test_files/type_representation.slt | 104 ++++++++++++ .../sqllogictests/src/engines/conversion.rs | 14 +- .../src/engines/datafusion/normalize.rs | 11 +- .../sqllogictests/src/engines/postgres/mod.rs | 151 +++--------------- .../core/tests/sqllogictests/src/main.rs | 26 +-- 5 files changed, 155 insertions(+), 151 deletions(-) create mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt new file mode 100644 index 000000000000..db8396073793 --- /dev/null +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt @@ -0,0 +1,104 @@ +query T +select null::VARCHAR +---- +NULL + +query TT +select 'a'::VARCHAR, ''::VARCHAR +---- +a (empty) + +skipif postgres +query TT +select 'a'::CHAR, ''::CHAR +---- +a (empty) + +query TT +select 'a'::TEXT, ''::TEXT +---- +a (empty) + +skipif postgres +query I +select -1::TINYINT +---- +-1 + +query I +select -1::SMALLINT +---- +-1 + +query II +select -1::INT as one, -2::INTEGER as two +---- +-1 -2 + +query I +select -1::BIGINT +---- +-1 + +skipif postgres +query I +select 1::TINYINT UNSIGNED +---- +1 + +query I +select 1::SMALLINT UNSIGNED +---- +1 + +skipif postgres +query II +select 1::INT UNSIGNED as one, 2::INTEGER UNSIGNED as two +---- +1 2 + +query I +select 1::BIGINT UNSIGNED +---- +1 + +query RRRRR +select 1.0::FLOAT, 1.023::FLOAT, 'NaN'::FLOAT,'+Inf'::FLOAT,'-Inf'::FLOAT +---- +1 1.023 NaN Infinity -Infinity + +query RRRRR +select 1.0::REAL, 1.023::REAL, 'NaN'::REAL,'+Inf'::REAL,'-Inf'::REAL +---- +1 1.023 NaN Infinity -Infinity + +skipif postgres +query RRRRR +select 1.0::DOUBLE, 1.023::DOUBLE, 'NaN'::DOUBLE,'+Inf'::DOUBLE,'-Inf'::DOUBLE +---- +1 1.023 NaN Infinity -Infinity + +query RRR +select 1.0::DECIMAL(5,3) as one, 2.023::DECIMAL(5,3) as two, 3.023::DECIMAL(5,2) as three +---- +1 2.023 3.02 + +query ? +select '2018-01-01'::DATE +---- +2018-01-01 + +query ? +select '12:00:01'::TIME +---- +12:00:01 + +query ? +select '2018-01-01 12:00:00'::TIMESTAMP +---- +2018-01-01T12:00:00 + +query I +select true::BOOLEAN, 'false'::BOOLEAN +---- +t f diff --git a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs index ea23009c0f63..4e309cb57ece 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs @@ -1,5 +1,7 @@ use half::f16; +use log::info; use rust_decimal::{Decimal, RoundingStrategy}; +use sqlparser::ast::DataType::Dec; pub fn bool_to_str(value: bool) -> String { if value { @@ -17,7 +19,7 @@ pub fn varchar_to_str(value: &str) -> String { } } -pub fn float2_to_str(value: f16) -> String { +pub fn f16_to_str(value: f16) -> String { if value.is_nan() { "NaN".to_string() } else if value == f16::INFINITY { @@ -29,7 +31,7 @@ pub fn float2_to_str(value: f16) -> String { } } -pub fn float4_to_str(value: f32) -> String { +pub fn f32_to_str(value: f32) -> String { if value.is_nan() { "NaN".to_string() } else if value == f32::INFINITY { @@ -41,7 +43,7 @@ pub fn float4_to_str(value: f32) -> String { } } -pub fn float8_to_str(value: f64) -> String { +pub fn f64_to_str(value: f64) -> String { if value.is_nan() { "NaN".to_string() } else if value == f64::INFINITY { @@ -53,6 +55,10 @@ pub fn float8_to_str(value: f64) -> String { } } +pub fn i128_to_str(value: i128, scale: u32) -> String { + decimal_to_str(Decimal::from_i128_with_scale(value, scale)) +} + pub fn decimal_to_str(value: Decimal) -> String { - value.round_dp(12).normalize().to_string() + value.round_dp(8).normalize().to_string() } diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs index 50f96be6d935..7e68abc89acc 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs @@ -108,9 +108,14 @@ pub fn cell_to_string(col: &ArrayRef, row: usize) -> Result { } else { match col.data_type() { DataType::Boolean => Ok(bool_to_str(get_row_value!(array::BooleanArray, col, row))), - DataType::Float16 => Ok(float2_to_str(get_row_value!(array::Float16Array, col, row))), - DataType::Float32 => Ok(float4_to_str(get_row_value!(array::Float32Array, col, row))), - DataType::Float64 => Ok(float8_to_str(get_row_value!(array::Float64Array, col, row))), + DataType::Float16 => Ok(f16_to_str(get_row_value!(array::Float16Array, col, row))), + DataType::Float32 => Ok(f32_to_str(get_row_value!(array::Float32Array, col, row))), + DataType::Float64 => Ok(f64_to_str(get_row_value!(array::Float64Array, col, row))), + DataType::Decimal128(_, scale) => { + let value = get_row_value!(array::Decimal128Array, col, row); + let decimal_scale = u32::try_from((*scale).max(0)).unwrap(); + Ok(i128_to_str(value, decimal_scale)) + } DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(array::LargeStringArray, col, row))), DataType::Utf8 => Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))), _ => arrow::util::display::array_value_to_string(col, row) diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs index e665290ca78e..344effc3ef24 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -26,7 +26,8 @@ use testcontainers::core::WaitFor; use testcontainers::images::generic::GenericImage; use tokio::task::JoinHandle; -use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime}; +use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, offset::Utc}; +use futures::TryStreamExt; use postgres_types::Type; use tokio_postgres::{Column, Row}; use rust_decimal::Decimal; @@ -94,109 +95,24 @@ impl Drop for Postgres { } } -macro_rules! array_process { - ($row:ident, $row_vec:ident, $idx:ident, $t:ty) => { - let value: Option>> = $row.get($idx); - match value { - Some(value) => { - let mut output = String::new(); - write!(output, "{{").unwrap(); - for (i, v) in value.iter().enumerate() { - match v { - Some(v) => { - write!(output, "{}", v).unwrap(); - } - None => { - write!(output, "NULL").unwrap(); - } - } - if i < value.len() - 1 { - write!(output, ",").unwrap(); - } - } - write!(output, "}}").unwrap(); - $row_vec.push(output); - } - None => { - $row_vec.push("NULL".to_string()); - } - } - }; - ($row:ident, $row_vec:ident, $idx:ident, $t:ty, $convert:ident) => { - let value: Option>> = $row.get($idx); - match value { - Some(value) => { - let mut output = String::new(); - write!(output, "{{").unwrap(); - for (i, v) in value.iter().enumerate() { - match v { - Some(v) => { - write!(output, "{}", $convert(v)).unwrap(); - } - None => { - write!(output, "NULL").unwrap(); - } - } - if i < value.len() - 1 { - write!(output, ",").unwrap(); - } - } - write!(output, "}}").unwrap(); - $row_vec.push(output); - } - None => { - $row_vec.push("NULL".to_string()); - } - } - }; - // ($self:ident, $row:ident, $row_vec:ident, $idx:ident, $t:ty, $ty_name:expr) => { - // let value: Option>> = $row.get($idx); - // match value { - // Some(value) => { - // let mut output = String::new(); - // write!(output, "{{").unwrap(); - // for (i, v) in value.iter().enumerate() { - // match v { - // Some(v) => { - // let sql = format!("select ($1::{})::varchar", stringify!($ty_name)); - // let tmp_rows = $self.client.query(&sql, &[&v]).await.unwrap(); - // let value: &str = tmp_rows.get(0).unwrap().get(0); - // assert!(value.len() > 0); - // write!(output, "{}", value).unwrap(); - // } - // None => { - // write!(output, "NULL").unwrap(); - // } - // } - // if i < value.len() - 1 { - // write!(output, ",").unwrap(); - // } - // } - // write!(output, "}}").unwrap(); - // $row_vec.push(output); - // } - // None => { - // $row_vec.push("NULL".to_string()); - // } - // } - // }; -} - macro_rules! make_string { ($row:ident, $idx:ident, $t:ty) => {{ let value:Option<$t> = $row.get($idx); - value.unwrap().to_string() + match value { + Some(value) => value.to_string(), + None => "NULL".to_string() + } }}; ($row:ident, $idx:ident, $t:ty, $convert:ident) => {{ let value: Option<$t> = $row.get($idx); - $convert(value.unwrap()).to_string() + match value { + Some(value) => $convert(value).to_string(), + None => "NULL".to_string() + } }}; } fn cell_to_string(row: &Row, column: &Column, idx: usize) -> String { - if idx >= row.columns().len() { - return "NULL".to_string(); - } match column.type_().clone() { Type::INT2 => make_string!(row, idx, i16), Type::INT4 => make_string!(row, idx, i32), @@ -204,44 +120,17 @@ fn cell_to_string(row: &Row, column: &Column, idx: usize) -> String { Type::NUMERIC => make_string!(row, idx, Decimal, decimal_to_str), Type::DATE => make_string!(row, idx, NaiveDate), Type::TIME => make_string!(row, idx, NaiveTime), - Type::TIMESTAMP => make_string!(row, idx, NaiveDateTime), - Type::BOOL => make_string!(row, idx, bool, bool_to_str), - // Type::INT2_ARRAY => array_process!(row, row_vec, idx, i16), - // Type::INT4_ARRAY => array_process!(row, row_vec, idx, i32), - // Type::INT8_ARRAY => array_process!(row, row_vec, idx, i64), - // Type::BOOL_ARRAY => array_process!(row, row_vec, idx, bool, bool_to_str), - // Type::FLOAT4_ARRAY => array_process!(row, row_vec, idx, f32, float4_to_str), - // Type::FLOAT8_ARRAY => array_process!(row, row_vec, idx, f64, float8_to_str), - // Type::NUMERIC_ARRAY => array_process!(row, row_vec, idx, Decimal), - // Type::DATE_ARRAY => array_process!(row, row_vec, idx, NaiveDate), - // Type::TIME_ARRAY => array_process!(row, row_vec, idx, NaiveTime), - // Type::TIMESTAMP_ARRAY => array_process!(row, row_vec, idx, NaiveDateTime), - // Type::VARCHAR_ARRAY | Type::TEXT_ARRAY => array_process!(row, row_vec, idx, String, varchar_to_str), - Type::VARCHAR | Type::TEXT => make_string!(row, idx, &str, varchar_to_str), - Type::FLOAT4 => make_string!(row, idx, f32, float4_to_str), - Type::FLOAT8 => make_string!(row, idx, f64, float8_to_str), - // Type::INTERVAL => { - // single_process!(self, row, row_vec, idx, Interval, INTERVAL); - // } - // Type::TIMESTAMPTZ => { - // single_process!( - // self, - // row, - // row_vec, - // idx, - // DateTime, - // TIMESTAMPTZ - // ); - // } - // Type::INTERVAL_ARRAY => { - // array_process!(self, row, row_vec, idx, Interval, INTERVAL); - // } - // Type::TIMESTAMPTZ_ARRAY => { - // array_process!(self, row, row_vec, idx, DateTime, TIMESTAMPTZ); - // } - _ => { - todo!("Unsupported type: {}", column.type_().name()) + Type::TIMESTAMP => { + let value: Option = row.get(idx); + value + .map(|d| format!("{:?}", d)) + .unwrap_or_else(|| "NULL".to_string()) } + Type::BOOL => make_string!(row, idx, bool, bool_to_str), + Type::BPCHAR | Type::VARCHAR | Type::TEXT => make_string!(row, idx, &str, varchar_to_str), + Type::FLOAT4 => make_string!(row, idx, f32, f32_to_str), + Type::FLOAT8 => make_string!(row, idx, f64, f64_to_str), + _ => todo!("Unsupported type: {}", column.type_().name()) } } diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index 840c1651412f..43756bd70164 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -86,24 +86,24 @@ async fn run_postgres_test_file( use sqllogictest::{default_validator, update_test_file}; info!("Running postgres test: {}", path.display()); - let docker = Docker::default(); - let postgres_container = docker.run(postgres::image::postgres_docker_image()); - - let postgres_client = Postgres::connect_with_retry( - "127.0.0.1", - postgres_container.get_host_port_ipv4(PG_PORT), - PG_DB, - PG_USER, - PG_PASSWORD, - ) - .await?; - let postgres_runner = sqllogictest::Runner::new(postgres_client); + // let docker = Docker::default(); + // let postgres_container = docker.run(postgres::image::postgres_docker_image()); + // + // let postgres_client = Postgres::connect_with_retry( + // "127.0.0.1", + // postgres_container.get_host_port_ipv4(PG_PORT), + // PG_DB, + // PG_USER, + // PG_PASSWORD, + // ) + // .await?; + // let postgres_runner = sqllogictest::Runner::new(postgres_client); // let temp_dir = tempdir()?; // let copy_path = temp_dir.path().join(&file_name); // copy(path, ©_path)?; - update_test_file(&path, postgres_runner, " ", default_validator).await?; + // update_test_file(&path, postgres_runner, " ", default_validator).await?; let ctx = SessionContext::new(); setup::register_aggregate_csv_by_sql(&ctx).await; From ff1e0895b829c5cae78c17347df3bd91f47d9ca9 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 11:32:18 +0100 Subject: [PATCH 07/19] Format with BigDecimal to keep arbitrary precision. --- datafusion/core/Cargo.toml | 1 + .../postgres/postgres_create_table.sql | 2 +- .../test_files/type_representation.slt | 2 +- .../sqllogictests/src/engines/conversion.rs | 22 ++++++++----- .../core/tests/sqllogictests/src/main.rs | 32 +++++++++---------- .../core/tests/sqllogictests/src/setup.rs | 6 ++-- .../sqllogictests/test_files/aggregate.slt | 4 +-- .../tests/sqllogictests/test_files/ddl.slt | 4 +-- 8 files changed, 40 insertions(+), 33 deletions(-) diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 462b14e5cc65..f4aa3ed261fd 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -112,6 +112,7 @@ parquet-test-utils = { path = "../../parquet-test-utils" } postgres-types = { version = "0.2.4", features = ["derive", "with-chrono-0_4"] } rstest = "0.16.0" rust_decimal = { version = "1.27.0", features = ["tokio-pg"] } +bigdecimal = "0.3.0" half = "2.2.1" sqllogictest = "0.10.0" test-utils = { path = "../../test-utils" } diff --git a/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql b/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql index 9cffa664cc0d..ef76c711657b 100644 --- a/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql +++ b/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql @@ -10,7 +10,7 @@ CREATE TABLE aggregate_test_100_by_sql c8 integer NOT NULL, c9 bigint NOT NULL, c10 character varying NOT NULL, - c11 double precision NOT NULL, + c11 real NOT NULL, c12 double precision NOT NULL, c13 character varying NOT NULL ); diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt index db8396073793..c200e3481ede 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt @@ -101,4 +101,4 @@ select '2018-01-01 12:00:00'::TIMESTAMP query I select true::BOOLEAN, 'false'::BOOLEAN ---- -t f +true false diff --git a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs index 4e309cb57ece..513ba8caa84e 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs @@ -1,13 +1,15 @@ use half::f16; use log::info; -use rust_decimal::{Decimal, RoundingStrategy}; +use rust_decimal::Decimal; use sqlparser::ast::DataType::Dec; +use rust_decimal::prelude::*; +use bigdecimal::BigDecimal; pub fn bool_to_str(value: bool) -> String { if value { - "t".to_string() + "true".to_string() } else { - "f".to_string() + "false".to_string() } } @@ -27,7 +29,7 @@ pub fn f16_to_str(value: f16) -> String { } else if value == f16::NEG_INFINITY { "-Infinity".to_string() } else { - decimal_to_str(Decimal::from_f32_retain(value.to_f32()).unwrap()) + big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap()) } } @@ -39,7 +41,7 @@ pub fn f32_to_str(value: f32) -> String { } else if value == f32::NEG_INFINITY { "-Infinity".to_string() } else { - decimal_to_str(Decimal::from_f32_retain(value).unwrap()) + big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap()) } } @@ -51,14 +53,18 @@ pub fn f64_to_str(value: f64) -> String { } else if value == f64::NEG_INFINITY { "-Infinity".to_string() } else { - decimal_to_str(Decimal::from_f64_retain(value).unwrap()) + big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap()) } } pub fn i128_to_str(value: i128, scale: u32) -> String { - decimal_to_str(Decimal::from_i128_with_scale(value, scale)) + big_decimal_to_str(BigDecimal::from_str(&Decimal::from_i128_with_scale(value, scale).to_string()).unwrap()) } pub fn decimal_to_str(value: Decimal) -> String { - value.round_dp(8).normalize().to_string() + big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap()) +} + +pub fn big_decimal_to_str(value: BigDecimal) -> String { + value.round(20).normalized().to_string() } diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index 43756bd70164..c20102a7acf5 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -86,18 +86,18 @@ async fn run_postgres_test_file( use sqllogictest::{default_validator, update_test_file}; info!("Running postgres test: {}", path.display()); - // let docker = Docker::default(); - // let postgres_container = docker.run(postgres::image::postgres_docker_image()); - // - // let postgres_client = Postgres::connect_with_retry( - // "127.0.0.1", - // postgres_container.get_host_port_ipv4(PG_PORT), - // PG_DB, - // PG_USER, - // PG_PASSWORD, - // ) - // .await?; - // let postgres_runner = sqllogictest::Runner::new(postgres_client); + let docker = Docker::default(); + let postgres_container = docker.run(postgres::image::postgres_docker_image()); + + let postgres_client = Postgres::connect_with_retry( + "127.0.0.1", + postgres_container.get_host_port_ipv4(PG_PORT), + PG_DB, + PG_USER, + PG_PASSWORD, + ) + .await?; + let mut postgres_runner = sqllogictest::Runner::new(postgres_client); // let temp_dir = tempdir()?; // let copy_path = temp_dir.path().join(&file_name); @@ -105,11 +105,11 @@ async fn run_postgres_test_file( // copy(path, ©_path)?; // update_test_file(&path, postgres_runner, " ", default_validator).await?; - let ctx = SessionContext::new(); - setup::register_aggregate_csv_by_sql(&ctx).await; - let mut df_runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); + // let ctx = SessionContext::new(); + // setup::register_aggregate_csv_by_sql(&ctx).await; + // let mut df_runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); - df_runner.run_file_async(path).await?; + postgres_runner.run_file_async(path).await?; Ok(()) } diff --git a/datafusion/core/tests/sqllogictests/src/setup.rs b/datafusion/core/tests/sqllogictests/src/setup.rs index 71015bca1ce7..1c82e28e96dc 100644 --- a/datafusion/core/tests/sqllogictests/src/setup.rs +++ b/datafusion/core/tests/sqllogictests/src/setup.rs @@ -119,15 +119,15 @@ pub async fn register_aggregate_csv_by_sql(ctx: &SessionContext) { " CREATE EXTERNAL TABLE aggregate_test_100_by_sql ( c1 VARCHAR NOT NULL, - c2 INT NOT NULL, + c2 TINYINT NOT NULL, c3 SMALLINT NOT NULL, c4 SMALLINT, c5 INT, c6 BIGINT NOT NULL, c7 SMALLINT NOT NULL, c8 INT NOT NULL, - c9 BIGINT NOT NULL, - c10 VARCHAR NOT NULL, + c9 INT UNSIGNED NOT NULL, + c10 BIGINT UNSIGNED NOT NULL, c11 FLOAT NOT NULL, c12 DOUBLE NOT NULL, c13 VARCHAR NOT NULL diff --git a/datafusion/core/tests/sqllogictests/test_files/aggregate.slt b/datafusion/core/tests/sqllogictests/test_files/aggregate.slt index 7a1b012b8410..540930d4a349 100644 --- a/datafusion/core/tests/sqllogictests/test_files/aggregate.slt +++ b/datafusion/core/tests/sqllogictests/test_files/aggregate.slt @@ -980,14 +980,14 @@ select max(c1) from d_table query R select sum(c1) from d_table ---- -100.000 +100 # FIX: doesn't check datatype # aggregate_decimal_avg query R select avg(c1) from d_table ---- -5.0000000 +5 # FIX: different test table # aggregate diff --git a/datafusion/core/tests/sqllogictests/test_files/ddl.slt b/datafusion/core/tests/sqllogictests/test_files/ddl.slt index 2e0667b5807c..590243639b9e 100644 --- a/datafusion/core/tests/sqllogictests/test_files/ddl.slt +++ b/datafusion/core/tests/sqllogictests/test_files/ddl.slt @@ -311,8 +311,8 @@ CREATE EXTERNAL TABLE aggregate_test_100 ( c1 VARCHAR NOT NULL, c2 TINYINT NOT NULL, c3 SMALLINT NOT NULL, - c4 SMALLINT NOT NULL, - c5 INTEGER NOT NULL, + c4 SMALLINT, + c5 INT, c6 BIGINT NOT NULL, c7 SMALLINT NOT NULL, c8 INT NOT NULL, From 55a49af44f19296582433d87015e0f3c9e2bca91 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 12:27:21 +0100 Subject: [PATCH 08/19] Fill postgres queries with results --- .../postgres/postgres_create_table.sql | 2 +- .../postgres/test_files/character_length.slt | 2 + .../partitioned_window_built_in_functions.slt | 101 ++++++++++++++++++ .../test_files/self_join_with_alias.slt | 101 ++++++++++++++++++ .../postgres/test_files/simple_except.slt | 4 + .../postgres/test_files/simple_except_all.slt | 59 ++++++++++ .../postgres/test_files/simple_intersect.slt | 3 + .../test_files/simple_intersect_all.slt | 43 ++++++++ .../test_files/simple_ordered_row.slt | 101 ++++++++++++++++++ .../test_files/simple_row_past_future.slt | 101 ++++++++++++++++++ .../postgres/test_files/simple_select.slt | 2 + .../postgres/test_files/simple_sort.slt | 101 ++++++++++++++++++ .../test_files/simple_sort_nulls_order.slt | 101 ++++++++++++++++++ .../postgres/test_files/simple_union_all.slt | 3 + .../simple_window_built_in_functions.slt | 101 ++++++++++++++++++ .../test_files/simple_window_groups.slt | 101 ++++++++++++++++++ .../simple_window_lead_built_in_functions.slt | 101 ++++++++++++++++++ .../test_files/simple_window_range.slt | 101 ++++++++++++++++++ ...imple_window_ranked_built_in_functions.slt | 101 ++++++++++++++++++ .../postgres/test_files/test_data.slt | 101 ++++++++++++++++++ .../postgres/test_files/values_list.slt | 13 +-- .../sqllogictests/src/engines/conversion.rs | 4 +- .../src/engines/datafusion/mod.rs | 11 +- .../src/engines/datafusion/normalize.rs | 55 ++++++---- .../sqllogictests/src/engines/postgres/mod.rs | 5 +- .../core/tests/sqllogictests/src/main.rs | 22 ++-- .../core/tests/sqllogictests/src/setup.rs | 4 +- 27 files changed, 1390 insertions(+), 54 deletions(-) diff --git a/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql b/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql index ef76c711657b..7df5943ae262 100644 --- a/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql +++ b/datafusion/core/tests/sqllogictests/postgres/postgres_create_table.sql @@ -1,7 +1,7 @@ CREATE TABLE aggregate_test_100_by_sql ( c1 character varying NOT NULL, - c2 integer NOT NULL, + c2 smallint NOT NULL, c3 smallint NOT NULL, c4 smallint, c5 integer, diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt index 364a54f5622f..e3846b4aca20 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt @@ -17,3 +17,5 @@ query I select length('ä'); +---- +2 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt index 8ae64633df6c..4bd488e8906d 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt @@ -29,3 +29,104 @@ SELECT nth_value(c9, 2) OVER (PARTITION BY c2 ORDER BY c9 DESC) second_c9_desc FROM aggregate_test_100_by_sql ORDER BY c9; +---- +28774375 1 326151275 NULL 28774375 3593959807 28774375 28774375 NULL 3570297463 +63044568 1 141680161 NULL 63044568 4144173353 63044568 63044568 NULL 4061635107 +141047417 1 662099130 NULL 141047417 4268716378 141047417 141047417 NULL 3457053821 +141680161 2 145294611 63044568 63044568 4144173353 141680161 141680161 141680161 4061635107 +145294611 3 598822671 141680161 63044568 4144173353 145294611 145294611 141680161 4061635107 +225513085 1 473294098 NULL 225513085 4229654142 225513085 225513085 NULL 4216440507 +243203849 1 431948861 NULL 243203849 3998790955 243203849 243203849 NULL 3959216334 +326151275 2 466439833 28774375 28774375 3593959807 326151275 326151275 326151275 3570297463 +431948861 2 559847112 243203849 243203849 3998790955 431948861 431948861 431948861 3959216334 +466439833 3 538589788 326151275 28774375 3593959807 466439833 466439833 326151275 3570297463 +473294098 2 520189543 225513085 225513085 4229654142 473294098 473294098 473294098 4216440507 +520189543 3 774637006 473294098 225513085 4229654142 520189543 520189543 473294098 4216440507 +538589788 4 557517119 466439833 28774375 3593959807 538589788 538589788 326151275 3570297463 +557517119 5 811650497 538589788 28774375 3593959807 557517119 557517119 326151275 3570297463 +559847112 3 754775609 431948861 243203849 3998790955 559847112 559847112 431948861 3959216334 +598822671 4 1000948272 145294611 63044568 4144173353 598822671 598822671 141680161 4061635107 +662099130 2 974297360 141047417 141047417 4268716378 662099130 662099130 662099130 3457053821 +754775609 4 1088543984 559847112 243203849 3998790955 754775609 754775609 431948861 3959216334 +774637006 4 879082834 520189543 225513085 4229654142 774637006 774637006 473294098 4216440507 +811650497 6 933879086 557517119 28774375 3593959807 811650497 811650497 326151275 3570297463 +879082834 5 1454057357 774637006 225513085 4229654142 879082834 879082834 473294098 4216440507 +933879086 7 1243785310 811650497 28774375 3593959807 933879086 933879086 326151275 3570297463 +974297360 3 1013876852 662099130 141047417 4268716378 974297360 974297360 662099130 3457053821 +1000948272 5 1098639440 598822671 63044568 4144173353 1000948272 1000948272 141680161 4061635107 +1013876852 4 1229567292 974297360 141047417 4268716378 1013876852 1013876852 662099130 3457053821 +1088543984 5 1362369177 754775609 243203849 3998790955 1088543984 1088543984 431948861 3959216334 +1098639440 6 1157161427 1000948272 63044568 4144173353 1098639440 1098639440 141680161 4061635107 +1157161427 7 1289293657 1098639440 63044568 4144173353 1157161427 1157161427 141680161 4061635107 +1229567292 5 1365198901 1013876852 141047417 4268716378 1229567292 1229567292 662099130 3457053821 +1243785310 8 1534194097 933879086 28774375 3593959807 1243785310 1243785310 326151275 3570297463 +1289293657 8 1491205016 1157161427 63044568 4144173353 1289293657 1289293657 141680161 4061635107 +1362369177 6 1538863055 1088543984 243203849 3998790955 1362369177 1362369177 431948861 3959216334 +1365198901 6 2307004493 1229567292 141047417 4268716378 1365198901 1365198901 662099130 3457053821 +1454057357 6 1842680163 879082834 225513085 4229654142 1454057357 1454057357 473294098 4216440507 +1491205016 9 2013662838 1289293657 63044568 4144173353 1491205016 1491205016 141680161 4061635107 +1534194097 9 1787652631 1243785310 28774375 3593959807 1534194097 1534194097 326151275 3570297463 +1538863055 7 1824517658 1362369177 243203849 3998790955 1538863055 1538863055 431948861 3959216334 +1787652631 10 1865307672 1534194097 28774375 3593959807 1787652631 1787652631 326151275 3570297463 +1824517658 8 1995343206 1538863055 243203849 3998790955 1824517658 1824517658 431948861 3959216334 +1842680163 7 2125812933 1454057357 225513085 4229654142 1842680163 1842680163 473294098 4216440507 +1865307672 11 2042457019 1787652631 28774375 3593959807 1865307672 1865307672 326151275 3570297463 +1995343206 9 2093538928 1824517658 243203849 3998790955 1995343206 1995343206 431948861 3959216334 +2013662838 10 2293105904 1491205016 63044568 4144173353 2013662838 2013662838 141680161 4061635107 +2042457019 12 2306130875 1865307672 28774375 3593959807 2042457019 2042457019 326151275 3570297463 +2093538928 10 2214035726 1995343206 243203849 3998790955 2093538928 2093538928 431948861 3959216334 +2125812933 8 2610290479 1842680163 225513085 4229654142 2125812933 2125812933 473294098 4216440507 +2214035726 11 2592330556 2093538928 243203849 3998790955 2214035726 2214035726 431948861 3959216334 +2293105904 11 2525744318 2013662838 63044568 4144173353 2293105904 2293105904 141680161 4061635107 +2306130875 13 2502326480 2042457019 28774375 3593959807 2306130875 2306130875 326151275 3570297463 +2307004493 7 2424630722 1365198901 141047417 4268716378 2307004493 2307004493 662099130 3457053821 +2424630722 8 2496054700 2307004493 141047417 4268716378 2424630722 2424630722 662099130 3457053821 +2496054700 9 2861911482 2424630722 141047417 4268716378 2496054700 2496054700 662099130 3457053821 +2502326480 14 2778168728 2306130875 28774375 3593959807 2502326480 2502326480 326151275 3570297463 +2525744318 12 2705709344 2293105904 63044568 4144173353 2525744318 2525744318 141680161 4061635107 +2592330556 12 3105312559 2214035726 243203849 3998790955 2592330556 2592330556 431948861 3959216334 +2610290479 9 2669374863 2125812933 225513085 4229654142 2610290479 2610290479 473294098 4216440507 +2669374863 10 2712615025 2610290479 225513085 4229654142 2669374863 2669374863 473294098 4216440507 +2705709344 13 2844041986 2525744318 63044568 4144173353 2705709344 2705709344 141680161 4061635107 +2712615025 11 2830981072 2669374863 225513085 4229654142 2712615025 2712615025 473294098 4216440507 +2778168728 15 2818832252 2502326480 28774375 3593959807 2778168728 2778168728 326151275 3570297463 +2818832252 16 3023531799 2778168728 28774375 3593959807 2818832252 2818832252 326151275 3570297463 +2830981072 12 2861376515 2712615025 225513085 4229654142 2830981072 2830981072 473294098 4216440507 +2844041986 14 2939920218 2705709344 63044568 4144173353 2844041986 2844041986 141680161 4061635107 +2861376515 13 3275293996 2830981072 225513085 4229654142 2861376515 2861376515 473294098 4216440507 +2861911482 10 3342719438 2496054700 141047417 4268716378 2861911482 2861911482 662099130 3457053821 +2939920218 15 3188005828 2844041986 63044568 4144173353 2939920218 2939920218 141680161 4061635107 +3023531799 17 3126475872 2818832252 28774375 3593959807 3023531799 3023531799 326151275 3570297463 +3105312559 13 3473924576 2592330556 243203849 3998790955 3105312559 3105312559 431948861 3959216334 +3126475872 18 3198969145 3023531799 28774375 3593959807 3126475872 3126475872 326151275 3570297463 +3188005828 16 3314983189 2939920218 63044568 4144173353 3188005828 3188005828 141680161 4061635107 +3198969145 19 3521368277 3126475872 28774375 3593959807 3198969145 3198969145 326151275 3570297463 +3275293996 14 3276123488 2861376515 225513085 4229654142 3275293996 3275293996 473294098 4216440507 +3276123488 15 3542840110 3275293996 225513085 4229654142 3276123488 3276123488 473294098 4216440507 +3314983189 17 3398507249 3188005828 63044568 4144173353 3314983189 3314983189 141680161 4061635107 +3342719438 11 3373581039 2861911482 141047417 4268716378 3342719438 3342719438 662099130 3457053821 +3373581039 12 3457053821 3342719438 141047417 4268716378 3373581039 3373581039 662099130 3457053821 +3398507249 18 3455216719 3314983189 63044568 4144173353 3398507249 3398507249 141680161 4061635107 +3455216719 19 3717551163 3398507249 63044568 4144173353 3455216719 3455216719 141680161 4061635107 +3457053821 13 4268716378 3373581039 141047417 4268716378 3457053821 3457053821 662099130 3457053821 +3473924576 14 3577318119 3105312559 243203849 3998790955 3473924576 3473924576 431948861 3959216334 +3521368277 20 3566741189 3198969145 28774375 3593959807 3521368277 3521368277 326151275 3570297463 +3542840110 16 3625286410 3276123488 225513085 4229654142 3542840110 3542840110 473294098 4216440507 +3566741189 21 3570297463 3521368277 28774375 3593959807 3566741189 3566741189 326151275 3570297463 +3570297463 22 3593959807 3566741189 28774375 3593959807 3570297463 3570297463 326151275 3570297463 +3577318119 15 3759340273 3473924576 243203849 3998790955 3577318119 3577318119 431948861 3959216334 +3593959807 23 NULL 3570297463 28774375 3593959807 3593959807 3593959807 326151275 NULL +3625286410 17 3766999078 3542840110 225513085 4229654142 3625286410 3625286410 473294098 4216440507 +3717551163 20 4061635107 3455216719 63044568 4144173353 3717551163 3717551163 141680161 4061635107 +3759340273 16 3862393166 3577318119 243203849 3998790955 3759340273 3759340273 431948861 3959216334 +3766999078 18 4015442341 3625286410 225513085 4229654142 3766999078 3766999078 473294098 4216440507 +3862393166 17 3959216334 3759340273 243203849 3998790955 3862393166 3862393166 431948861 3959216334 +3959216334 18 3998790955 3862393166 243203849 3998790955 3959216334 3959216334 431948861 3959216334 +3998790955 19 NULL 3959216334 243203849 3998790955 3998790955 3998790955 431948861 NULL +4015442341 19 4076864659 3766999078 225513085 4229654142 4015442341 4015442341 473294098 4216440507 +4061635107 21 4144173353 3717551163 63044568 4144173353 4061635107 4061635107 141680161 4061635107 +4076864659 20 4216440507 4015442341 225513085 4229654142 4076864659 4076864659 473294098 4216440507 +4144173353 22 NULL 4061635107 63044568 4144173353 4144173353 4144173353 141680161 NULL +4216440507 21 4229654142 4076864659 225513085 4229654142 4216440507 4216440507 473294098 4216440507 +4229654142 22 NULL 4216440507 225513085 4229654142 4229654142 4229654142 473294098 NULL +4268716378 14 NULL 3457053821 141047417 4268716378 4268716378 4268716378 662099130 NULL diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt index 90f2cd5c946f..d7b3adf1d1b4 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt @@ -22,3 +22,104 @@ FROM aggregate_test_100_by_sql t1 INNER JOIN aggregate_test_100_by_sql t2 ON t1.c9 = t2.c9 ORDER BY result; +---- +28774375 +63044568 +141047417 +141680161 +145294611 +225513085 +243203849 +326151275 +431948861 +466439833 +473294098 +520189543 +538589788 +557517119 +559847112 +598822671 +662099130 +754775609 +774637006 +811650497 +879082834 +933879086 +974297360 +1000948272 +1013876852 +1088543984 +1098639440 +1157161427 +1229567292 +1243785310 +1289293657 +1362369177 +1365198901 +1454057357 +1491205016 +1534194097 +1538863055 +1787652631 +1824517658 +1842680163 +1865307672 +1995343206 +2013662838 +2042457019 +2093538928 +2125812933 +2214035726 +2293105904 +2306130875 +2307004493 +2424630722 +2496054700 +2502326480 +2525744318 +2592330556 +2610290479 +2669374863 +2705709344 +2712615025 +2778168728 +2818832252 +2830981072 +2844041986 +2861376515 +2861911482 +2939920218 +3023531799 +3105312559 +3126475872 +3188005828 +3198969145 +3275293996 +3276123488 +3314983189 +3342719438 +3373581039 +3398507249 +3455216719 +3457053821 +3473924576 +3521368277 +3542840110 +3566741189 +3570297463 +3577318119 +3593959807 +3625286410 +3717551163 +3759340273 +3766999078 +3862393166 +3959216334 +3998790955 +4015442341 +4061635107 +4076864659 +4144173353 +4216440507 +4229654142 +4268716378 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt index 1c98689134c6..d2abeabc3b7c 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt @@ -25,3 +25,7 @@ SELECT * FROM ( WHERE c2 IN (3, 4) ) s ORDER BY c2 +---- +1 +2 +5 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt index 67d777afd45f..3742ae8a690c 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt @@ -25,3 +25,62 @@ SELECT * FROM ( WHERE c2 IN (3, 4) ) s ORDER BY c2 +---- +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt index 9d28da71ca98..9f16b1170559 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt @@ -25,3 +25,6 @@ SELECT * FROM ( WHERE c2 IN (3, 4) ) s ORDER BY c2 +---- +3 +4 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt index 87e630d0dcfd..7b807f3316f5 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt @@ -25,3 +25,46 @@ SELECT * FROM ( WHERE c2 IN (3, 4) ) s ORDER BY c2 +---- +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt index d81cf3be33f8..2070f4becfbb 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt @@ -26,3 +26,104 @@ SUM(c2) OVER(PARTITION BY c5, c7, c9 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRE SUM(c2) OVER(PARTITION BY c5 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation21 FROM aggregate_test_100_by_sql ORDER BY c9; +---- +-4942047943 4 63 65888489655 -49496272718 4 4 +926757956 2 44 65239119005 -49988667320 2 2 +1732087197 5 60 63348565756 -44072309439 5 5 +-3150892396 2 56 22284849433 -18365391649 2 2 +-2580856019 2 60 26501601552 -22133107901 2 2 +-335727035 1 44 20146078803 -16466216538 1 1 +1814066719 3 62 63285534470 -49613916090 3 3 +2053694183 4 62 52482905660 -42707727919 4 4 +3621641894 3 60 65599174579 -47485937795 3 3 +-400780807 4 60 26398188956 1363051884 4 4 +7402117831 1 56 49945227444 -26269037388 1 1 +-494733298 1 56 30420363606 -25755253815 1 1 +795974017 4 63 52321603367 -28960619870 4 4 +1026366728 4 63 40718554341 -15787873259 4 4 +2286728521 3 63 22540519030 5443690406 3 3 +-1126902361 2 56 60886848761 -48311607997 2 2 +3039607922 5 63 36368366538 -10535560995 5 5 +452227974 3 60 48731300455 -24855926380 3 3 +5227296299 1 60 56253092820 -34082599483 1 1 +69074581 4 44 31650501220 -4686718095 4 4 +-1471170754 1 44 48781585534 -39865989020 1 1 +2660538843 4 62 57667039791 -46297932749 4 4 +1419803598 5 62 54487875635 -31586207821 5 5 +2419395622 2 44 14499576077 13719154870 2 2 +2481391591 5 60 63779944434 -44742807337 5 5 +-459020887 3 56 62748392040 -49376491044 3 3 +-624495791 2 62 56738273175 -45668446269 2 2 +-2096656853 2 56 51306415182 -41804411830 2 2 +1272929184 5 56 64903708596 -50030091076 5 5 +32805265 4 62 65476544051 -49938800703 4 4 +-4061661128 2 63 60213611118 -47890565531 2 2 +3706903676 3 56 18004627099 -14557735645 3 3 +540986341 5 44 15862627961 -12630107535 5 5 +6758184069 1 60 10418937555 15862627961 1 1 +2026749584 2 56 20549346056 7494915128 2 2 +5467570199 4 44 28223071121 -667913323 4 4 +2067671449 3 62 62474806028 -42663256555 3 3 +-1130350427 4 60 59934937400 -39537955622 4 4 +-2003065005 3 44 65892719037 -49125296903 3 3 +5408019493 1 62 46149116149 -21995471817 1 1 +-3164970139 4 60 32328844499 -27415680288 4 4 +-2694469368 3 60 15862627961 -8540168355 3 3 +-658921663 2 63 50083881192 -40875645214 2 2 +2805599223 4 63 18556152866 9548294540 4 4 +1553855901 3 44 44727303772 -36620277699 3 3 +1692583850 1 56 58570355880 -46885764079 1 1 +2735533457 3 60 57810649168 -36458975406 3 3 +2950771606 2 56 46110466191 -37764080037 2 2 +4826625882 4 56 62914544356 -43369697823 4 4 +-782600284 5 62 65645302382 -49877765574 5 5 +5648017295 5 62 29961402376 -2693524905 5 5 +-2767729102 5 60 55728616981 -45024220800 5 5 +5149003448 4 60 64604572155 -46025333589 4 4 +2961127755 2 62 24402796316 -20250814045 2 2 +5898948877 3 44 65851295281 -48741944194 3 3 +3960521203 1 63 53626707998 -43550421386 1 1 +3778827061 1 60 59232325784 -38625247674 1 1 +1686841798 2 62 15862627961 -10638973591 2 2 +2045904111 1 44 63753193492 -49782674421 1 1 +3236123325 4 63 12466574915 15862627961 4 4 +1611761891 4 56 64174235958 -49916888328 4 4 +1661243641 1 63 43278308249 -35443787221 1 1 +-1804099697 2 56 34228019610 -28864675811 2 2 +-1806255458 1 44 39809671411 -32918957573 1 1 +2971205313 5 63 61531074230 -48694091008 5 5 +3282334404 2 60 65801428664 -48344513742 2 2 +1922873587 4 62 16530541284 11612449585 4 4 +944558002 3 63 43486204682 -18961550403 3 3 +-2057472121 4 44 61887961550 -41948021207 4 4 +3274034209 2 63 37858099778 -12360443160 2 2 +-1924817872 4 63 28492735496 -23947043450 4 4 +-1526835643 1 62 57047716212 -35270885423 1 1 +-4360794332 1 60 65740393535 -47917316473 1 1 +440089321 2 63 60605435298 -40390464859 2 2 +-349482531 5 62 33244301624 -6677891069 5 5 +-1444906781 5 44 61264858032 -41185088251 5 5 +124105851 2 56 47448835782 -23431968584 2 2 +1507069678 2 62 65779516289 -49736546618 2 2 +-1359045062 5 62 59413049347 -47422906509 5 5 +-6342944350 3 56 54716947420 -44350983157 3 3 +2754612412 4 63 65358900679 -47051916395 4 4 +2926012685 1 44 55400583583 -32868672494 1 1 +-634904850 4 56 58525884516 -37630943686 4 4 +2039004659 4 62 44823247831 -20505738577 4 4 +1022726318 3 63 34824178364 -8633537157 3 3 +3963879356 4 56 39294596545 -14098774415 4 4 +-5184324536 1 44 47450052344 -38854319459 1 1 +2632160834 2 60 64207141703 -45402230071 2 2 +-2188934048 3 63 62160560710 -49041080635 3 3 +4261991101 1 56 64987924864 -46612178067 1 1 +-2680809293 3 56 15862627961 -6422221472 3 3 +-46187270 3 60 42131665349 -17381673663 3 3 +-255767708 3 60 51133513384 -27623576721 3 3 +3129721465 1 60 8367712833 15862627961 1 1 +2499782052 2 44 64556718969 -50025861694 2 2 +-1609671980 1 62 37995735862 -31587424383 1 1 +-1595655683 2 63 36113442006 -30247838230 2 2 +-1524432418 1 44 53493571647 -30286488188 1 1 +-5214552988 1 63 41617881776 -34221253231 1 1 +-1718403224 5 56 24496165118 3396053046 5 5 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt index 7b61030e4b5f..f566b02ad65a 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt @@ -24,3 +24,104 @@ SELECT SUM(c2) OVER(ORDER BY c5 RANGE BETWEEN 1 PRECEDING AND 1 PRECEDING) as summation5 FROM aggregate_test_100_by_sql ORDER BY c9; +---- +2 5 159 162 NULL +5 7 173 177 NULL +5 7 125 129 NULL +1 6 264 266 NULL +2 5 258 262 NULL +3 4 266 268 NULL +3 6 190 191 NULL +2 8 229 230 NULL +1 5 146 150 NULL +4 5 21 26 NULL +3 3 79 82 NULL +4 4 253 257 NULL +1 4 83 86 NULL +3 7 58 62 NULL +5 8 16 18 NULL +2 6 200 205 NULL +2 9 48 51 NULL +1 5 77 79 NULL +1 6 96 97 NULL +5 8 34 39 NULL +1 6 236 238 NULL +2 7 214 215 NULL +1 7 90 91 NULL +4 2 2 6 NULL +2 7 129 134 NULL +3 5 191 194 NULL +5 6 215 219 NULL +2 4 230 234 NULL +2 9 177 179 NULL +2 6 168 173 NULL +5 8 205 207 NULL +5 4 268 269 NULL +2 3 269 272 NULL +4 NULL NULL 1 NULL +3 6 12 16 NULL +5 8 26 30 NULL +4 7 118 122 NULL +2 7 106 107 NULL +4 3 156 159 NULL +2 6 72 76 NULL +1 3 251 253 NULL +3 8 277 279 NULL +1 5 234 236 NULL +2 6 8 12 NULL +1 2 240 242 NULL +4 4 209 214 NULL +4 2 98 99 NULL +3 3 239 240 NULL +5 9 122 125 NULL +4 7 166 168 NULL +4 9 30 34 NULL +3 5 219 221 NULL +1 10 139 141 NULL +2 5 262 264 NULL +3 4 154 156 NULL +4 7 226 229 NULL +4 4 102 106 NULL +3 4 272 277 NULL +3 7 186 190 NULL +2 1 1 2 NULL +1 7 184 186 NULL +1 3 242 245 NULL +4 2 249 251 NULL +1 4 246 247 NULL +2 6 197 200 NULL +3 7 153 154 NULL +4 5 6 8 NULL +4 8 66 69 NULL +3 6 113 118 NULL +4 8 51 56 NULL +2 6 257 258 NULL +3 6 97 98 NULL +2 5 150 153 NULL +5 5 107 111 NULL +3 9 39 43 NULL +4 5 111 113 NULL +3 7 76 77 NULL +5 6 162 166 NULL +1 7 207 209 NULL +1 6 221 226 NULL +3 6 145 146 NULL +1 5 91 96 NULL +1 2 99 102 NULL +1 7 69 72 NULL +5 9 43 48 NULL +4 8 56 58 NULL +2 4 238 239 NULL +4 9 134 139 NULL +5 4 194 197 NULL +4 7 141 145 NULL +NULL 7 279 282 NULL +3 6 62 66 NULL +4 5 82 83 NULL +1 NULL NULL NULL NULL +4 6 179 184 NULL +2 2 247 248 NULL +2 2 248 249 NULL +5 4 86 90 NULL +1 5 245 246 NULL +4 6 18 21 NULL diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt index b9de947ab707..1e55f0c2cda6 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt @@ -17,3 +17,5 @@ query I SELECT 1 as num; +---- +1 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt index 42a37f9ac9b1..50b2c13f3bec 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt @@ -22,3 +22,104 @@ SELECT c10 FROM aggregate_test_100_by_sql ORDER BY c2 ASC, c3 DESC, c10; +---- +1 125 17869394731126786457 +1 120 16439861276703750332 +1 103 10901819591635583995 +1 83 4602675983996931623 +1 71 10297218950720052365 +1 70 4976799313755010034 +1 57 4338034436871150616 +1 54 17818611040257178339 +1 41 15419512479294091215 +1 38 1842662804748246269 +1 36 7788847578701297242 +1 29 14857091259186476033 +1 12 15449267433866484283 +1 -5 4776679784701509574 +1 -8 9904216782086286050 +1 -24 2402288956117186783 +1 -25 12763583666216333412 +1 -56 677091006469429514 +1 -72 5885937420286765261 +1 -85 12101411955859039553 +1 -98 9634106610243643486 +1 -99 14933742247195536130 +2 122 15695681119022625322 +2 113 4225581724448081782 +2 97 2792105417953811674 +2 93 5536487915963301239 +2 68 3898128009708892708 +2 63 13144161537396946288 +2 52 12565360638488684051 +2 52 7386391799827871203 +2 49 10948666249269100825 +2 45 8554426087132697832 +2 31 3343692635488765507 +2 29 562977550464243101 +2 1 5863949479783605708 +2 -29 11759014161799384683 +2 -43 906367167997372130 +2 -48 9135746610908713318 +2 -60 1719090662556698549 +2 -60 7045482583778080653 +2 -61 939909697866979632 +2 -106 7464432081248293405 +2 -107 4403623840168496677 +2 -117 12659011877190539078 +3 123 12883447461717956514 +3 112 9916295859593918600 +3 104 13079037564113702254 +3 97 8188072741116415408 +3 77 17419098323248948387 +3 73 2906943497598597237 +3 71 3998472996619161534 +3 22 196777795886465166 +3 17 12662506238151717757 +3 17 732272194388185106 +3 14 8164671015278284913 +3 13 10771380284714693539 +3 13 14881411008939145569 +3 -2 13062025193350212516 +3 -12 16060348691054629425 +3 -72 17452974532402389080 +3 -76 12046662515387914426 +3 -95 10966649192992996919 +3 -101 17929716297117857676 +4 123 4546434653720168472 +4 102 2240998421986827216 +4 97 9726016502640071617 +4 96 5437030162957481122 +4 74 10767179755613315144 +4 73 9575476605699527641 +4 65 11378396836996498283 +4 55 1524771507450695976 +4 47 2881913079548128905 +4 30 13526465947516666293 +4 17 3732692885824435932 +4 5 35363005357834672 +4 3 8622584762448622224 +4 -38 878137512938218976 +4 -53 9463973906560740422 +4 -54 7966148640299601101 +4 -56 2774306934041974261 +4 -59 15100310750150419896 +4 -79 2464584078983135763 +4 -90 4094315663314091142 +4 -101 16778113360088370541 +4 -111 8382489916947120498 +4 -117 13684453606722360110 +5 118 16493024289408725403 +5 68 9865419128970328044 +5 64 16127995415060805595 +5 62 10575647935385523483 +5 36 17448660630302620693 +5 -5 11429640193932435507 +5 -31 11005002152861474932 +5 -40 11720144131976083864 +5 -44 2413406423648025909 +5 -59 2501626630745849169 +5 -82 3330177516592499461 +5 -86 2126626171973341689 +5 -94 12849419495718510869 +5 -101 2243924747182709810 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt index d07f040dec58..6ed5ba5c9803 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt @@ -22,3 +22,104 @@ SELECT c10 FROM aggregate_test_100_by_sql ORDER BY c5 ASC, c4 DESC, c10; +---- +-2141999138 -18655 13062025193350212516 +-2141451704 -11122 17452974532402389080 +-2138770630 21456 13144161537396946288 +-2117946883 2045 2501626630745849169 +-2098805236 13741 196777795886465166 +-1991133944 13630 9634106610243643486 +-1927628110 -1114 7464432081248293405 +-1908480893 -21739 1719090662556698549 +-1899175111 15673 8554426087132697832 +-1885422396 -12612 10767179755613315144 +-1882293856 -24085 2402288956117186783 +-1813935549 -28462 11378396836996498283 +-1808210365 -16312 7045482583778080653 +-1660426473 -2888 939909697866979632 +-1448995523 7652 15449267433866484283 +-1383162419 27138 9904216782086286050 +-1339586153 -5479 10297218950720052365 +-1331533190 10837 16439861276703750332 +-1302295658 15091 17419098323248948387 +-1222533990 -30187 12659011877190539078 +-1176490478 31106 17869394731126786457 +-1143802338 28781 4338034436871150616 +-1090239422 -12056 12565360638488684051 +-1011669561 -2904 4403623840168496677 +-1009656194 20690 2881913079548128905 +-928766616 -21481 7788847578701297242 +-903316089 29106 8188072741116415408 +-842693467 -12484 2243924747182709810 +-800561771 23127 3343692635488765507 +-673237643 -28070 3732692885824435932 +-644225469 -4667 15419512479294091215 +-629486480 15788 2413406423648025909 +-587831330 24495 10948666249269100825 +-537142430 25305 11759014161799384683 +-467659022 32514 2126626171973341689 +-421042466 -6823 9916295859593918600 +-382483011 -9565 2906943497598597237 +-346989627 -13217 17929716297117857676 +-335410409 18384 1842662804748246269 +-237425046 5281 2464584078983135763 +-168758331 10130 15695681119022625322 +-134213907 19208 16493024289408725403 +-108973366 3917 4225581724448081782 +-4229382 -1967 8382489916947120498 +41423756 16337 10575647935385523483 +49866617 15874 3898128009708892708 +61035129 -16110 13526465947516666293 +141218956 8809 12046662515387914426 +240273900 29533 12883447461717956514 +370975815 13080 906367167997372130 +383352709 15295 12763583666216333412 +397430452 28162 8164671015278284913 +427197269 -30336 5437030162957481122 +431378678 -22186 10901819591635583995 +434021400 -2376 7966148640299601101 +439738328 -18025 9135746610908713318 +586844478 -12907 11005002152861474932 +623103518 -16974 17448660630302620693 +659422734 -30508 8622584762448622224 +670497898 14457 12662506238151717757 +702611616 -7688 35363005357834672 +706441268 22614 11720144131976083864 +715235348 23388 7386391799827871203 +762932956 20744 878137512938218976 +794623392 12636 4776679784701509574 +852509237 16620 4546434653720168472 +912707948 32064 10771380284714693539 +994303988 -18218 14857091259186476033 +1171968280 -15154 12101411955859039553 +1188089983 25590 5885937420286765261 +1188285940 21576 9865419128970328044 +1213926989 5613 14933742247195536130 +1282464673 -22501 9575476605699527641 +1299719633 12613 14881411008939145569 +1325868318 27752 4976799313755010034 +1337043149 -22796 732272194388185106 +1354539333 -3855 562977550464243101 +1413111008 -18410 17818611040257178339 +1423957796 25286 15100310750150419896 +1436496767 194 3998472996619161534 +1489733240 -9168 16060348691054629425 +1544188174 -31500 2774306934041974261 +1579876740 -2935 4094315663314091142 +1593800404 18167 2792105417953811674 +1689098844 -26526 16127995415060805595 +1738331255 -25136 13079037564113702254 +1824882165 22080 3330177516592499461 +1902023838 -1471 1524771507450695976 +1955646088 24896 11429640193932435507 +1991172974 -24558 2240998421986827216 +1993193190 11640 16778113360088370541 +2025611582 -15880 12849419495718510869 +2030965207 13611 10966649192992996919 +2033001162 18109 5863949479783605708 +2047637360 -13181 9726016502640071617 +2051224722 19316 13684453606722360110 +2053379412 -12642 5536487915963301239 +2064155045 13788 9463973906560740422 +2106705285 8692 677091006469429514 +2143473091 -14704 4602675983996931623 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt index 2f5630a48fd5..8ab7be5105b9 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt @@ -17,3 +17,6 @@ query I SELECT 1 num UNION ALL SELECT 2 num ORDER BY num; +---- +1 +2 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt index aa5246a9b83a..8abefe4ea30d 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt @@ -29,3 +29,104 @@ SELECT nth_value(c9, 2) OVER (ORDER BY c9 DESC) second_c9_desc FROM aggregate_test_100_by_sql ORDER BY c9; +---- +28774375 1 63044568 NULL 28774375 4268716378 28774375 28774375 NULL 4229654142 +63044568 2 141047417 28774375 28774375 4268716378 63044568 63044568 63044568 4229654142 +141047417 3 141680161 63044568 28774375 4268716378 141047417 141047417 63044568 4229654142 +141680161 4 145294611 141047417 28774375 4268716378 141680161 141680161 63044568 4229654142 +145294611 5 225513085 141680161 28774375 4268716378 145294611 145294611 63044568 4229654142 +225513085 6 243203849 145294611 28774375 4268716378 225513085 225513085 63044568 4229654142 +243203849 7 326151275 225513085 28774375 4268716378 243203849 243203849 63044568 4229654142 +326151275 8 431948861 243203849 28774375 4268716378 326151275 326151275 63044568 4229654142 +431948861 9 466439833 326151275 28774375 4268716378 431948861 431948861 63044568 4229654142 +466439833 10 473294098 431948861 28774375 4268716378 466439833 466439833 63044568 4229654142 +473294098 11 520189543 466439833 28774375 4268716378 473294098 473294098 63044568 4229654142 +520189543 12 538589788 473294098 28774375 4268716378 520189543 520189543 63044568 4229654142 +538589788 13 557517119 520189543 28774375 4268716378 538589788 538589788 63044568 4229654142 +557517119 14 559847112 538589788 28774375 4268716378 557517119 557517119 63044568 4229654142 +559847112 15 598822671 557517119 28774375 4268716378 559847112 559847112 63044568 4229654142 +598822671 16 662099130 559847112 28774375 4268716378 598822671 598822671 63044568 4229654142 +662099130 17 754775609 598822671 28774375 4268716378 662099130 662099130 63044568 4229654142 +754775609 18 774637006 662099130 28774375 4268716378 754775609 754775609 63044568 4229654142 +774637006 19 811650497 754775609 28774375 4268716378 774637006 774637006 63044568 4229654142 +811650497 20 879082834 774637006 28774375 4268716378 811650497 811650497 63044568 4229654142 +879082834 21 933879086 811650497 28774375 4268716378 879082834 879082834 63044568 4229654142 +933879086 22 974297360 879082834 28774375 4268716378 933879086 933879086 63044568 4229654142 +974297360 23 1000948272 933879086 28774375 4268716378 974297360 974297360 63044568 4229654142 +1000948272 24 1013876852 974297360 28774375 4268716378 1000948272 1000948272 63044568 4229654142 +1013876852 25 1088543984 1000948272 28774375 4268716378 1013876852 1013876852 63044568 4229654142 +1088543984 26 1098639440 1013876852 28774375 4268716378 1088543984 1088543984 63044568 4229654142 +1098639440 27 1157161427 1088543984 28774375 4268716378 1098639440 1098639440 63044568 4229654142 +1157161427 28 1229567292 1098639440 28774375 4268716378 1157161427 1157161427 63044568 4229654142 +1229567292 29 1243785310 1157161427 28774375 4268716378 1229567292 1229567292 63044568 4229654142 +1243785310 30 1289293657 1229567292 28774375 4268716378 1243785310 1243785310 63044568 4229654142 +1289293657 31 1362369177 1243785310 28774375 4268716378 1289293657 1289293657 63044568 4229654142 +1362369177 32 1365198901 1289293657 28774375 4268716378 1362369177 1362369177 63044568 4229654142 +1365198901 33 1454057357 1362369177 28774375 4268716378 1365198901 1365198901 63044568 4229654142 +1454057357 34 1491205016 1365198901 28774375 4268716378 1454057357 1454057357 63044568 4229654142 +1491205016 35 1534194097 1454057357 28774375 4268716378 1491205016 1491205016 63044568 4229654142 +1534194097 36 1538863055 1491205016 28774375 4268716378 1534194097 1534194097 63044568 4229654142 +1538863055 37 1787652631 1534194097 28774375 4268716378 1538863055 1538863055 63044568 4229654142 +1787652631 38 1824517658 1538863055 28774375 4268716378 1787652631 1787652631 63044568 4229654142 +1824517658 39 1842680163 1787652631 28774375 4268716378 1824517658 1824517658 63044568 4229654142 +1842680163 40 1865307672 1824517658 28774375 4268716378 1842680163 1842680163 63044568 4229654142 +1865307672 41 1995343206 1842680163 28774375 4268716378 1865307672 1865307672 63044568 4229654142 +1995343206 42 2013662838 1865307672 28774375 4268716378 1995343206 1995343206 63044568 4229654142 +2013662838 43 2042457019 1995343206 28774375 4268716378 2013662838 2013662838 63044568 4229654142 +2042457019 44 2093538928 2013662838 28774375 4268716378 2042457019 2042457019 63044568 4229654142 +2093538928 45 2125812933 2042457019 28774375 4268716378 2093538928 2093538928 63044568 4229654142 +2125812933 46 2214035726 2093538928 28774375 4268716378 2125812933 2125812933 63044568 4229654142 +2214035726 47 2293105904 2125812933 28774375 4268716378 2214035726 2214035726 63044568 4229654142 +2293105904 48 2306130875 2214035726 28774375 4268716378 2293105904 2293105904 63044568 4229654142 +2306130875 49 2307004493 2293105904 28774375 4268716378 2306130875 2306130875 63044568 4229654142 +2307004493 50 2424630722 2306130875 28774375 4268716378 2307004493 2307004493 63044568 4229654142 +2424630722 51 2496054700 2307004493 28774375 4268716378 2424630722 2424630722 63044568 4229654142 +2496054700 52 2502326480 2424630722 28774375 4268716378 2496054700 2496054700 63044568 4229654142 +2502326480 53 2525744318 2496054700 28774375 4268716378 2502326480 2502326480 63044568 4229654142 +2525744318 54 2592330556 2502326480 28774375 4268716378 2525744318 2525744318 63044568 4229654142 +2592330556 55 2610290479 2525744318 28774375 4268716378 2592330556 2592330556 63044568 4229654142 +2610290479 56 2669374863 2592330556 28774375 4268716378 2610290479 2610290479 63044568 4229654142 +2669374863 57 2705709344 2610290479 28774375 4268716378 2669374863 2669374863 63044568 4229654142 +2705709344 58 2712615025 2669374863 28774375 4268716378 2705709344 2705709344 63044568 4229654142 +2712615025 59 2778168728 2705709344 28774375 4268716378 2712615025 2712615025 63044568 4229654142 +2778168728 60 2818832252 2712615025 28774375 4268716378 2778168728 2778168728 63044568 4229654142 +2818832252 61 2830981072 2778168728 28774375 4268716378 2818832252 2818832252 63044568 4229654142 +2830981072 62 2844041986 2818832252 28774375 4268716378 2830981072 2830981072 63044568 4229654142 +2844041986 63 2861376515 2830981072 28774375 4268716378 2844041986 2844041986 63044568 4229654142 +2861376515 64 2861911482 2844041986 28774375 4268716378 2861376515 2861376515 63044568 4229654142 +2861911482 65 2939920218 2861376515 28774375 4268716378 2861911482 2861911482 63044568 4229654142 +2939920218 66 3023531799 2861911482 28774375 4268716378 2939920218 2939920218 63044568 4229654142 +3023531799 67 3105312559 2939920218 28774375 4268716378 3023531799 3023531799 63044568 4229654142 +3105312559 68 3126475872 3023531799 28774375 4268716378 3105312559 3105312559 63044568 4229654142 +3126475872 69 3188005828 3105312559 28774375 4268716378 3126475872 3126475872 63044568 4229654142 +3188005828 70 3198969145 3126475872 28774375 4268716378 3188005828 3188005828 63044568 4229654142 +3198969145 71 3275293996 3188005828 28774375 4268716378 3198969145 3198969145 63044568 4229654142 +3275293996 72 3276123488 3198969145 28774375 4268716378 3275293996 3275293996 63044568 4229654142 +3276123488 73 3314983189 3275293996 28774375 4268716378 3276123488 3276123488 63044568 4229654142 +3314983189 74 3342719438 3276123488 28774375 4268716378 3314983189 3314983189 63044568 4229654142 +3342719438 75 3373581039 3314983189 28774375 4268716378 3342719438 3342719438 63044568 4229654142 +3373581039 76 3398507249 3342719438 28774375 4268716378 3373581039 3373581039 63044568 4229654142 +3398507249 77 3455216719 3373581039 28774375 4268716378 3398507249 3398507249 63044568 4229654142 +3455216719 78 3457053821 3398507249 28774375 4268716378 3455216719 3455216719 63044568 4229654142 +3457053821 79 3473924576 3455216719 28774375 4268716378 3457053821 3457053821 63044568 4229654142 +3473924576 80 3521368277 3457053821 28774375 4268716378 3473924576 3473924576 63044568 4229654142 +3521368277 81 3542840110 3473924576 28774375 4268716378 3521368277 3521368277 63044568 4229654142 +3542840110 82 3566741189 3521368277 28774375 4268716378 3542840110 3542840110 63044568 4229654142 +3566741189 83 3570297463 3542840110 28774375 4268716378 3566741189 3566741189 63044568 4229654142 +3570297463 84 3577318119 3566741189 28774375 4268716378 3570297463 3570297463 63044568 4229654142 +3577318119 85 3593959807 3570297463 28774375 4268716378 3577318119 3577318119 63044568 4229654142 +3593959807 86 3625286410 3577318119 28774375 4268716378 3593959807 3593959807 63044568 4229654142 +3625286410 87 3717551163 3593959807 28774375 4268716378 3625286410 3625286410 63044568 4229654142 +3717551163 88 3759340273 3625286410 28774375 4268716378 3717551163 3717551163 63044568 4229654142 +3759340273 89 3766999078 3717551163 28774375 4268716378 3759340273 3759340273 63044568 4229654142 +3766999078 90 3862393166 3759340273 28774375 4268716378 3766999078 3766999078 63044568 4229654142 +3862393166 91 3959216334 3766999078 28774375 4268716378 3862393166 3862393166 63044568 4229654142 +3959216334 92 3998790955 3862393166 28774375 4268716378 3959216334 3959216334 63044568 4229654142 +3998790955 93 4015442341 3959216334 28774375 4268716378 3998790955 3998790955 63044568 4229654142 +4015442341 94 4061635107 3998790955 28774375 4268716378 4015442341 4015442341 63044568 4229654142 +4061635107 95 4076864659 4015442341 28774375 4268716378 4061635107 4061635107 63044568 4229654142 +4076864659 96 4144173353 4061635107 28774375 4268716378 4076864659 4076864659 63044568 4229654142 +4144173353 97 4216440507 4076864659 28774375 4268716378 4144173353 4144173353 63044568 4229654142 +4216440507 98 4229654142 4144173353 28774375 4268716378 4216440507 4216440507 63044568 4229654142 +4229654142 99 4268716378 4216440507 28774375 4268716378 4229654142 4229654142 63044568 4229654142 +4268716378 100 NULL 4229654142 28774375 4268716378 4268716378 4268716378 63044568 NULL diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt index 46279fbb35c3..afa722791255 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt @@ -71,3 +71,104 @@ SELECT SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation73 FROM aggregate_test_100_by_sql ORDER BY c9; +---- +-35127 -20071 1171968280 -44741 -60 -1045189740 1645376618 15862627961 728662 61035129 2252131671 4277743253 2191096542 -16110 NULL NULL NULL NULL 61035129 61035129 61035129 -16110 61035129 61035129 61035129 NULL 22943 14370 41423756 51422 -76 152325502 813503800 15862627961 145307 61035129 65801428664 65851295281 65740393535 -37724 -22668 623103518 3056 -94 311073214 -1380600149 15862627961 -512775 61035129 13671531419 11863321054 13610496290 +37269 20967 1213926989 -54145 -59 -1574720463 1639694101 15862627961 951392 -108973366 5255341318 5017916272 5364314684 3917 NULL NULL NULL NULL -108973366 -108973366 -108973366 3917 -108973366 -108973366 -108973366 NULL 36569 15411 -168758331 30244 -111 -411945604 -21912375 15862627961 131173 -108973366 65779516289 65645302382 65888489655 -31020 -47322 1436496767 40175 -79 1208315423 -1743478794 15862627961 -715478 -108973366 10498313277 8380366394 10607286643 +14062 11006 61035129 -15056 -48 -1285298976 1303653581 15862627961 695376 623103518 3999306907 2191096542 3376203389 -16974 NULL NULL NULL NULL 623103518 623103518 623103518 -16974 623103518 623103518 623103518 NULL -80790 -20401 439738328 -23739 3 1649686324 2655635766 15862627961 137382 623103518 61887961550 62474806028 61264858032 -35127 -38183 994303988 29390 -60 -1045189740 -3184474087 15862627961 -480353 623103518 12486424572 12926162900 11863321054 +1164 19243 -2117946883 -15742 55 89808975 -2114836321 15862627961 952517 -1927628110 6045764800 7482261567 7973392910 -1114 NULL NULL NULL NULL -1927628110 -1927628110 -1927628110 -1114 -1927628110 -1927628110 -1927628110 NULL 6563 15786 -2098805236 -18678 -60 -6017567290 -7620706510 15862627961 19981 -1927628110 28492735496 26501601552 30420363606 -30917 -12838 -4229382 5182 71 -2943527053 -1901324969 15862627961 -721634 -1927628110 7889235051 9791258889 9816863161 +67523 35827 49866617 -24738 -25 -3496662635 -3184474087 15862627961 740879 -1899175111 7846553398 7217066918 9745728509 15673 NULL NULL NULL NULL -1899175111 -1899175111 -1899175111 15673 -1899175111 -1899175111 -1899175111 NULL -6162 12516 -1927628110 -65159 74 -5735284114 -7480826912 15862627961 13915 -1899175111 32328844499 30420363606 34228019610 11625 -20071 -1302295658 56517 -44 -2878810989 -3871666709 15862627961 -493209 -1899175111 6116899452 6500252161 8016074563 +14039 -18815 2064155045 -9562 -95 2065442845 -1901324969 15862627961 826881 -1991133944 10028823751 7930018515 12019957695 13630 NULL NULL NULL NULL -1991133944 -1991133944 -1991133944 13630 -1991133944 -1991133944 -1991133944 NULL 49758 23501 -2117946883 -7180 -106 -6207886063 -7726418058 15862627961 21095 -1991133944 26501601552 24402796316 28492735496 17679 -15175 370975815 -5204 22 26303141 3645319585 15862627961 -581254 -1991133944 3842670266 5873635473 5833804210 +17679 27241 586844478 -5985 83 26303141 -2140016957 15862627961 790510 -346989627 7246194997 9293832357 7593184624 -13217 NULL NULL NULL NULL -346989627 -346989627 -346989627 -13217 -346989627 -346989627 -346989627 NULL 21293 25691 -421042466 33795 38 -1150515104 -1088583413 15862627961 74253 -346989627 64556718969 64174235958 64903708596 -14433 -4871 1171968280 32854 97 -2135787575 2057268348 15862627961 -571730 -346989627 8269443337 10412916428 8616432964 +53780 -7078 -2138770630 29390 -117 -1972491598 -3888467183 15862627961 567403 -1009656194 12359612306 13122545262 13369268500 20690 NULL NULL NULL NULL -1009656194 -1009656194 -1009656194 20690 -1009656194 -1009656194 -1009656194 NULL 13030 16725 -1090239422 -4859 36 -3111565177 -3684432366 15862627961 20225 -1009656194 55728616981 54716947420 56738273175 74575 13717 -134213907 17417 -38 -3553056774 -559380590 15862627961 -314716 -1009656194 2493359461 4544584183 3503015655 +28098 -8332 -903316089 44641 70 -367071380 1863474126 15862627961 211266 397430452 18400914040 17257111702 18003483588 28162 NULL NULL NULL NULL 397430452 397430452 397430452 28162 397430452 397430452 397430452 NULL 55734 42613 370975815 -54898 96 1151758976 1690027799 15862627961 240186 397430452 64604572155 64987924864 64207141703 36394 -36 -1383162419 -44741 57 1160862510 1981771941 15862627961 48893 397430452 -2140855627 -814987309 -2538286079 +17679 27241 794623392 -5985 120 26303141 -2140016957 15862627961 890461 1993193190 7523673648 8823393281 5530480458 11640 NULL NULL NULL NULL 1993193190 1993193190 1993193190 11640 1993193190 1993193190 1993193190 NULL -5373 23425 1955646088 15840 -94 5940012252 8082771141 15862627961 214888 1993193190 20549346056 22540519030 18556152866 -14433 -4871 -168758331 32854 13 -2135787575 2057268348 15862627961 -646824 1993193190 10332147503 9000614313 8338954313 +15239 -44678 -1143802338 -17538 -8 2322760594 2439184170 15862627961 239018 1325868318 18003483588 18400914040 16677615270 27752 NULL NULL NULL NULL 1325868318 1325868318 1325868318 27752 1325868318 1325868318 1325868318 NULL 681 -16888 1282464673 -45061 17 3908052624 5430561808 15862627961 278980 1325868318 46149116149 47448835782 44823247831 4929 -54988 1188089983 -49963 14 750085326 437338198 15862627961 20731 1325868318 -814987309 -2198149728 -2140855627 +46712 64670 1282464673 27693 102 -1775723035 -1449239099 15862627961 487280 -1882293856 2457410212 3794453361 4339704068 -24085 NULL NULL NULL NULL -1882293856 -1882293856 -1882293856 -24085 -1882293856 -1882293856 -1882293856 NULL -71225 -6066 -1899175111 -47662 65 -5666891363 -7164866243 15862627961 -22782 -1882293856 36113442006 34228019610 37995735862 -5560 12398 1738331255 55502 17 -2036083577 974546445 15862627961 -279368 -1882293856 11522923893 13514096867 13405217749 +-49576 387 -1908480893 59917 17 -2287736392 3560913151 15862627961 534161 1282464673 5076918034 5508296712 3794453361 -22501 NULL NULL NULL NULL 1282464673 1282464673 1282464673 -22501 1282464673 1282464673 1282464673 NULL 42891 47166 1188285940 17569 13 3684677602 5245095773 15862627961 238615 1282464673 48731300455 49945227444 47448835782 15239 65202 -1882293856 -12225 103 2322760594 -144263301 15862627961 -324665 1282464673 12068174600 13405217749 10785709927 +-2090 -4237 427197269 -13608 NULL 6149069904 -2420213359 15862627961 231997 1544188174 1544188174 2203610908 NULL -31500 NULL NULL NULL NULL 1544188174 1544188174 1544188174 -31500 1544188174 1544188174 1544188174 NULL -18123 25480 1436496767 -11294 -90 4470418181 6406964162 15862627961 218731 1544188174 36368366538 37858099778 34824178364 -38792 -40939 NULL -6613 3 -759786886 6588808232 15862627961 -31500 1544188174 15862627961 15862627961 14318439787 +40940 29579 -2098805236 5182 -43 5636453529 2057268348 15862627961 840492 2030965207 12019957695 10028823751 9988992488 13611 NULL NULL NULL NULL 2030965207 2030965207 2030965207 13611 2030965207 2030965207 2030965207 NULL 2922 -12918 1993193190 24244 1 6049769979 8162828451 15862627961 212619 2030965207 16530541284 18556152866 14499576077 2913 -8448 794623392 13699 -98 1253758252 5168794507 15862627961 -594884 2030965207 5873635473 6244611288 3842670266 +-5560 -33253 -1383162419 30451 -59 -2036083577 1519076272 15862627961 317051 -537142430 16872687706 18060777689 17409830136 25305 NULL NULL NULL NULL -537142430 -537142430 -537142430 25305 -537142430 -537142430 -537142430 NULL 93435 11121 -629486480 16126 -86 -1754460240 -1808326929 15862627961 71344 -537142430 62748392040 62160560710 63285534470 71051 43358 1955646088 -17958 -72 812635004 -546350337 15862627961 -59749 -537142430 -1547202175 -123244379 -1010059745 +31670 65202 1991172974 66574 17 1113315852 -1552050368 15862627961 411060 1689098844 610199839 2348531094 -1078899005 -26526 NULL NULL NULL NULL 1689098844 1689098844 1689098844 -26526 1689098844 1689098844 1689098844 NULL -67930 -34435 1579876740 -4527 104 4862775988 7154336102 15862627961 207437 1689098844 31650501220 33244301624 29961402376 11586 45118 -1813935549 36740 104 -408248030 2439184170 15862627961 -205589 1689098844 16941526966 16268289323 15252428122 +-32689 -38183 431378678 80491 -24 1584341489 2495165914 15862627961 511365 1337043149 3794453361 5076918034 2457410212 -22796 NULL NULL NULL NULL 1337043149 1337043149 1337043149 -22796 1337043149 1337043149 1337043149 NULL -8787 -9888 1299719633 3021 29 3962631100 5528651286 15862627961 256184 1337043149 44823247831 46149116149 43486204682 57823 52329 1991172974 -24442 73 3944161437 1645376618 15862627961 -302164 1337043149 13405217749 11522923893 12068174600 +53530 14090 -346989627 13699 -94 2759425399 4309797580 15862627961 760652 1171968280 5449711533 7593184624 4277743253 -15154 NULL NULL NULL NULL 1171968280 1171968280 1171968280 -15154 1171968280 1171968280 1171968280 NULL 40902 48684 912707948 52779 -72 3078980216 4762271192 15862627961 208337 1171968280 53493571647 54487875635 52321603367 20625 -18815 61035129 36170 83 2284185998 2900644355 15862627961 -543809 1171968280 11584884708 13610496290 10412916428 +46693 37793 1436496767 17417 -111 799645256 2352299442 15862627961 951046 1902023838 7973392910 6045764800 6071369072 -1471 NULL NULL NULL NULL 1902023838 1902023838 1902023838 -1471 1902023838 1902023838 1902023838 NULL -6157 -51662 1738331255 11978 -5 5465237258 7842036090 15862627961 202910 1902023838 26398188956 28223071121 24496165118 44727 35827 434021400 66574 -106 2940130772 -1339125374 15862627961 -720520 1902023838 9791258889 9787029507 7889235051 +38577 -5070 240273900 -8549 14 -3241149212 1796328434 15862627961 183104 -1143802338 17257111702 16353795613 18400914040 28781 NULL NULL NULL NULL -1143802338 -1143802338 -1143802338 28781 -1143802338 -1143802338 -1143802338 NULL 32735 -15096 -1222533990 5730 52 -3542826806 -4255367515 15862627961 14495 -1143802338 52482905660 51306415182 53626707998 36569 -7078 1325868318 11267 97 2171332508 -1552050368 15862627961 77674 -1143802338 -2538286079 -2140855627 -1394483741 +-32689 -38183 1738331255 80491 65 1584341489 2495165914 15862627961 382990 -673237643 -1078899005 610199839 -405661362 -28070 NULL NULL NULL NULL -673237643 -673237643 -673237643 -28070 -673237643 -673237643 -673237643 NULL 7012 16622 -842693467 35616 41 -2316492881 -2534780922 15862627961 10423 -673237643 60213611118 59413049347 60886848761 57823 52329 -1222533990 -24442 64 3944161437 1645376618 15862627961 -179063 -673237643 16268289323 14454353774 16941526966 +-611 -37351 706441268 -33532 63 2660931489 -1025454778 15862627961 504513 1188285940 12172060572 13996942737 10983774632 21576 NULL NULL NULL NULL 1188285940 1188285940 1188285940 21576 1188285940 1188285940 1188285940 NULL 19407 -33372 1171968280 -4275 -99 3548344203 4984397235 15862627961 255503 1188285940 51133513384 52321603367 49945227444 31670 -5070 762932956 -9599 -82 1113315852 3560913151 15862627961 -250940 1188285940 4878853329 2740082699 3690567389 +-48148 9534 -842693467 -12225 -31 5218698356 1009134449 15862627961 829815 2053379412 11934056247 10048633851 9880676835 -12642 NULL NULL NULL NULL 2053379412 2053379412 2053379412 -12642 2053379412 2053379412 2053379412 NULL 25390 4928 2047637360 7776 -53 6152241494 8367712833 15862627961 224221 2053379412 8367712833 10418937555 6314333421 -55203 2479 2047637360 -20802 74 2894556845 7209871330 15862627961 -610460 2053379412 5981951126 6568795604 3928571714 +24352 -8790 -1885422396 56438 97 433054757 2427194517 15862627961 816908 586844478 9880676835 11934056247 9293832357 -12907 NULL NULL NULL NULL 586844478 586844478 586844478 -12907 586844478 586844478 586844478 NULL -72468 -24562 434021400 -33025 36 1460604206 2539868628 15862627961 154356 586844478 62474806028 62914544356 61887961550 68836 35694 -346989627 16515 93 2056218702 -1449239099 15862627961 -597818 586844478 6568795604 8616432964 5981951126 +-49576 387 702611616 59917 -72 -2287736392 3560913151 15862627961 890731 -382483011 5591766247 7081499487 5974249258 -9565 NULL NULL NULL NULL -382483011 -382483011 -382483011 -9565 -382483011 -382483011 -382483011 NULL 28214 57819 -467659022 10448 -101 -1271184499 -1302308093 15862627961 87470 -382483011 64174235958 63753193492 64556718969 15239 65202 -1090239422 -12225 -12 2322760594 -144263301 15862627961 -668299 -382483011 9888378703 7746926999 10270861714 +-17721 13717 -587831330 -24442 -40 -1441635278 -489488557 15862627961 438243 -800561771 13902822234 14618057582 14703384005 23127 NULL NULL NULL NULL -800561771 -800561771 -800561771 23127 -800561771 -800561771 -800561771 NULL -9802 7625 -903316089 -16949 17 -2546571327 -2747511363 15862627961 38493 -800561771 59413049347 58570355880 60213611118 -39770 -8332 1824882165 -24738 52 1609316679 -2085860747 15862627961 -183119 -800561771 1159243956 1865685224 1959805727 +-14433 -8448 434021400 -12838 -90 -2135787575 -187208211 15862627961 940911 -1011669561 7302003527 5641577054 8313673088 -2904 NULL NULL NULL NULL -1011669561 -1011669561 -1011669561 -2904 -1011669561 -1011669561 -1011669561 NULL 65617 59887 -1143802338 28315 47 -3245711321 -3853408460 15862627961 -465 -1011669561 54716947420 53626707998 55728616981 -16856 -10871 1354539333 -9562 -61 -187208211 -921860586 15862627961 -711818 -1011669561 7548954873 9128831613 8560624434 +90245 56283 -1009656194 -28042 38 -1634505428 1074101516 15862627961 605927 -134213907 11318043778 13369268500 11452257685 19208 NULL NULL NULL NULL -134213907 -134213907 -134213907 19208 -134213907 -134213907 -134213907 NULL 56920 23665 -237425046 18287 113 -540397284 -205992899 15862627961 127256 -134213907 65645302382 65476544051 65779516289 2003 -31959 1593800404 67120 -117 -664229739 -541722291 15862627961 -354722 -134213907 4410370276 4074959867 4544584183 +-30917 -15175 -1927628110 -10871 -54 -2943527053 824461350 15862627961 949079 -4229382 6071369072 7973392910 6075598454 -1967 NULL NULL NULL NULL -4229382 -4229382 -4229382 -1967 -4229382 -4229382 -4229382 NULL 47625 29338 -134213907 16101 62 -247416655 148096120 15862627961 129206 -4229382 65888489655 65779516289 65892719037 -15742 NULL -1660426473 -18079 55 824461350 -2140016957 15862627961 -719049 -4229382 9787029507 10221050907 9791258889 +36636 -19881 1423957796 31696 52 450275604 -4140888104 15862627961 391728 -587831330 14030226252 15985872340 14618057582 24495 NULL NULL NULL NULL -587831330 -587831330 -587831330 24495 -587831330 -587831330 -587831330 NULL 32851 -32737 -644225469 50996 -29 -1861543279 -2013675248 15862627961 46039 -587831330 62160560710 61531074230 62748392040 67523 11006 -800561771 -8549 -5 -3496662635 2352299442 15862627961 -135236 -587831330 1244570379 1959805727 1832401709 +-37724 7017 670497898 36430 -98 311073214 1845356201 15862627961 813251 -2098805236 7930018515 9994173560 10028823751 13741 NULL NULL NULL NULL -2098805236 -2098805236 -2098805236 13741 -2098805236 -2098805236 -2098805236 NULL 39750 10334 -2138770630 -9223 -98 -6355522749 -7926048183 15862627961 7465 -2098805236 24402796316 22284849433 26501601552 28098 72839 2030965207 -15056 -53 -367071380 -489488557 15862627961 -567513 -2098805236 5833804210 3842670266 7932609446 +-22116 11412 -237425046 -26471 71 3390925772 -7024468539 15862627961 953437 -2117946883 5364314684 5255341318 7482261567 2045 NULL NULL NULL NULL -2117946883 -2117946883 -2117946883 2045 -2117946883 -2117946883 -2117946883 NULL 7465 -29777 -2141451704 26257 22 -6398169217 -8135514173 15862627961 -6276 -2117946883 22284849433 20146078803 24402796316 -21948 11580 -1927628110 -11396 113 -6071106818 5455080817 15862627961 -719395 -2117946883 8380366394 9816863161 10498313277 +-2090 -4237 -168758331 -13608 12 6149069904 -2420213359 15862627961 928929 2106705285 6889553023 7030771979 4782847738 8692 NULL NULL NULL NULL 2106705285 2106705285 2106705285 8692 2106705285 2106705285 2106705285 NULL 14450 6674 2053379412 -14704 83 6224239742 4250178376 15862627961 246701 2106705285 4250178376 6314333421 2143473091 -38792 -40939 1213926989 -6613 -76 -759786886 6588808232 15862627961 -688240 2106705285 11079780223 9630784700 8973074938 +-31090 -36 -335410409 46015 123 3395035512 1258109085 15862627961 660587 2033001162 10193867690 11787668094 8160866528 18109 NULL NULL NULL NULL 2033001162 2033001162 2033001162 18109 2033001162 2033001162 2033001162 NULL 14299 -4240 2025611582 -6507 97 6089577951 8185242656 15862627961 230728 2033001162 14499576077 16530541284 12466574915 33616 64670 41423756 -30544 97 2641271504 1946039989 15862627961 -410481 2033001162 7701761433 8554270670 5668760271 +-44611 -31959 1337043149 -8886 104 4160882907 7209871330 15862627961 462722 1991172974 4339704068 2457410212 2348531094 -24558 NULL NULL NULL NULL 1991172974 1991172974 1991172974 -24558 1991172974 1991172974 1991172974 NULL 32587 20609 1902023838 9371 -101 5848842900 8040942953 15862627961 203248 1991172974 22540519030 24496165118 20549346056 -55630 -42978 1689098844 -54145 -24 5156491918 3739840441 15862627961 -255283 1991172974 13514096867 15252428122 11522923893 +-32689 -38183 383352709 80491 -53 1584341489 2495165914 15862627961 785722 670497898 10664671458 9362375800 9994173560 14457 NULL NULL NULL NULL 670497898 670497898 670497898 14457 670497898 670497898 670497898 NULL -53620 -29881 623103518 38314 5 1953024150 2794786130 15862627961 121331 670497898 60605435298 61264858032 59934937400 57823 52329 -2098805236 -24442 77 3944161437 1645376618 15862627961 -539268 670497898 5868454401 7932609446 5197956503 +71051 40600 1188285940 51482 47 812635004 1210863559 15862627961 546713 762932956 13122545262 10983774632 12359612306 20744 NULL NULL NULL NULL 762932956 762932956 762932956 20744 762932956 762932956 762932956 NULL 71694 14926 706441268 61320 -5 2184609572 3322773533 15862627961 180389 762932956 57810649168 58525884516 57047716212 59319 28868 2051224722 27693 63 1840350039 1195987713 15862627961 -293972 762932956 3503015655 2493359461 2740082699 +-12381 -40939 -1331533190 12207 -56 -2472569238 2900644355 15862627961 920237 141218956 7030771979 6862013648 6889553023 8809 NULL NULL NULL NULL 141218956 141218956 141218956 8809 141218956 141218956 141218956 NULL 54443 32211 49866617 57908 123 252120702 1135821380 15862627961 154116 141218956 65740393535 65801428664 65599174579 35484 6926 -1448995523 -26471 122 1728676075 -6189260496 15862627961 -679431 141218956 8973074938 11079780223 8831855982 +36569 45118 439738328 56517 -2 2171332508 -559380590 15862627961 640723 1413111008 1942161073 2936465061 529050065 -18410 NULL NULL NULL NULL 1413111008 1413111008 1413111008 -18410 1413111008 1413111008 1413111008 NULL 7977 4956 1337043149 16312 -59 4104693490 5763298811 15862627961 233919 1413111008 42131665349 43486204682 40718554341 36636 45185 -928766616 43647 29 450275604 2212756264 15862627961 -427136 1413111008 15333577896 13191578758 13920466888 +4929 22467 1689098844 11267 -117 750085326 -2222183579 15862627961 354528 -1813935549 -405661362 -1078899005 1408274187 -28462 NULL NULL NULL NULL -1813935549 -1813935549 -1813935549 -28462 -1813935549 -1813935549 -1813935549 NULL -65798 3061 -1885422396 -11548 -60 -5581651801 -6731567910 15862627961 -51244 -1813935549 37995735862 36113442006 39809671411 20255 37793 427197269 59917 17 -2263607335 846995940 15862627961 -150993 -1813935549 14454353774 13231819784 16268289323 +9669 -10720 1489733240 36170 52 -6330479452 775314354 15862627961 879609 -2141451704 5974249258 5591766247 8115700962 -11122 NULL NULL NULL NULL -2141451704 -2141451704 -2141451704 -11122 -2141451704 -2141451704 -2141451704 NULL -8321 NULL NULL 37242 63 -4283450842 -8496974453 15862627961 -29777 -2141451704 18004627099 15862627961 20146078803 47750 27361 -842693467 -13608 73 -1049567811 -7024468539 15862627961 -658734 -2141451704 7746926999 6656687577 9888378703 +44727 27310 -382483011 60858 -101 2940130772 -3871666709 15862627961 867553 -1090239422 8115700962 5974249258 9205940384 -12056 NULL NULL NULL NULL -1090239422 -1090239422 -1090239422 -12056 -1090239422 -1090239422 -1090239422 NULL 14740 919 -1176490478 -3695 -107 -3410532238 -4040331793 15862627961 2439 -1090239422 53626707998 52482905660 54716947420 53780 36363 -1885422396 8900 -72 -1972491598 1796328434 15862627961 -647612 -1090239422 6656687577 5813994110 7746926999 +-68124 -47322 2053379412 -57682 -101 5160673327 7362171447 15862627961 803727 2047637360 9293832357 9880676835 7246194997 -13181 NULL NULL NULL NULL 2047637360 2047637360 2047637360 -13181 2047637360 2047637360 2047637360 NULL 21975 -2269 2030965207 20462 -117 6111603729 8216396539 15862627961 217547 2047637360 12466574915 14499576077 10418937555 -48148 -27346 2143473091 -71880 -31 5218698356 6899004582 15862627961 -584911 2047637360 8616432964 8269443337 6568795604 +-55203 -42978 -1899175111 -49963 17 2894556845 -2190825778 15862627961 771265 -1302295658 9362375800 9745728509 10664671458 15091 NULL NULL NULL NULL -1302295658 -1302295658 -1302295658 15091 -1302295658 -1302295658 -1302295658 NULL 17400 21659 -1339586153 29700 -117 -3973415001 -4845122464 15862627961 -15205 -1302295658 48781585534 47450052344 50083881192 -49576 -37351 2064155045 -57682 -25 -2287736392 3321754114 15862627961 -524177 -1302295658 5197956503 5868454401 6500252161 +74575 45185 1579876740 3056 71 -3553056774 -2085860747 15862627961 929454 -644225469 5379257015 6733796348 6023482484 -4667 NULL NULL NULL NULL -644225469 -644225469 -644225469 -4667 -644225469 -644225469 -644225469 NULL -6306 10643 -800561771 65588 -44 -2118024883 -2398685709 15862627961 5756 -644225469 60886848761 60213611118 61531074230 14062 -15328 -421042466 60858 29 -1285298976 -4140888104 15862627961 -702124 -644225469 9839145477 8499559324 10483370946 +57823 -22668 NULL -30544 125 3944161437 2125466408 15862627961 64578 912707948 16330286983 15862627961 15417579035 32064 NULL NULL NULL NULL 912707948 912707948 912707948 32064 912707948 912707948 912707948 NULL 63846 33380 794623392 -7782 29 2559840577 4267070199 15862627961 241709 912707948 55400583583 56253092820 54487875635 42295 -38196 240273900 5494 -86 1466043674 1845356201 15862627961 199483 912707948 445048926 -731441552 -467659022 +-16856 -4018 -673237643 NULL 96 -187208211 828690732 15862627961 324341 -1222533990 1408274187 -405661362 2630808177 -30187 NULL NULL NULL NULL -1222533990 -1222533990 -1222533990 -30187 -1222533990 -1222533990 -1222533990 NULL 21368 5358 -1331533190 47831 125 -3856362838 -4633066228 15862627961 -45392 -1222533990 50083881192 48781585534 51306415182 -12838 NULL 659422734 -5985 65 828690732 -2114836321 15862627961 -122531 -1222533990 13231819784 13659017053 14454353774 +32242 52329 -1222533990 36986 -56 -86961173 3300694238 15862627961 263497 659422734 2203610908 2630808177 1544188174 -30508 NULL NULL NULL NULL 659422734 659422734 659422734 -30508 659422734 659422734 659422734 NULL -63957 -30932 586844478 29383 17 1869370730 2738973516 15862627961 106874 659422734 61264858032 61887961550 60605435298 -1210 18877 NULL 44641 96 550424758 2125466408 15862627961 -62008 659422734 14318439787 15862627961 13659017053 +11586 -54988 2033001162 8900 68 -408248030 2212756264 15862627961 693544 41423756 7308357291 8160866528 7266933535 16337 NULL NULL NULL NULL 41423756 41423756 41423756 16337 41423756 41423756 41423756 NULL 53369 23125 -108973366 8573 68 -71778992 293544458 15862627961 145543 41423756 65892719037 65888489655 65851295281 46693 -19881 -629486480 -33532 123 799645256 -2222183579 15862627961 -445210 41423756 8595694426 8645561043 8554270670 +33616 -12399 -537142430 -6115 49 2641271504 974546445 15862627961 367233 1955646088 15985872340 17409830136 14030226252 24896 NULL NULL NULL NULL 1955646088 1955646088 1955646088 24896 1955646088 1955646088 1955646088 NULL -4189 -3056 1824882165 -28798 102 5682552091 7965623834 15862627961 227806 1955646088 24496165118 26398188956 22540519030 12762 -33253 715235348 -31054 -59 2856840301 3300694238 15862627961 -110340 1955646088 1832401709 1244570379 -123244379 +17679 27241 -2141451704 -5985 74 26303141 -2140016957 15862627961 855069 -842693467 9205940384 8115700962 10048633851 -12484 NULL NULL NULL NULL -842693467 -842693467 -842693467 -12484 -842693467 -842693467 -842693467 NULL 38958 -791 -928766616 -9610 31 -2674776172 -2960718350 15862627961 15366 -842693467 58570355880 57667039791 59413049347 -14433 -4871 2053379412 32854 52 -2135787575 2057268348 15862627961 -635556 -842693467 5813994110 3928571714 6656687577 +-13633 -2237 1902023838 -33528 -61 2937914773 -325765486 15862627961 946703 434021400 6075598454 6071369072 5641577054 -2376 NULL NULL NULL NULL 434021400 434021400 434021400 -2376 434021400 434021400 434021400 NULL -44761 -2174 427197269 -47906 -48 1292597347 2083707724 15862627961 185288 434021400 63348565756 63779944434 62914544356 -22116 -10720 -1011669561 11551 -111 3390925772 2308428293 15862627961 -717082 434021400 10221050907 8560624434 9787029507 +-38792 -25184 -2141999138 20389 103 -759786886 -6189260496 15862627961 578848 -1908480893 3599815819 2671049203 5508296712 -21739 NULL NULL NULL NULL -1908480893 -1908480893 -1908480893 -21739 -1908480893 -1908480893 -1908480893 NULL 20191 27371 -1991133944 -21024 45 -5827242947 -7575372256 15862627961 -1758 -1908480893 30420363606 28492735496 32328844499 9669 23277 1282464673 2147 36 -6330479452 -325765486 15862627961 -368590 -1908480893 10354331249 10785709927 12262812142 +87389 NULL 912707948 40175 97 -83707341 -541722291 15862627961 125217 240273900 16594069513 15417579035 16353795613 29533 NULL NULL NULL NULL 240273900 240273900 240273900 29533 240273900 240273900 240273900 NULL 51186 -236 61035129 56537 -43 442527985 1392032876 15862627961 183649 240273900 65599174579 65740393535 65358900679 117434 30045 -1143802338 31106 125 -407508384 -83707341 15862627961 136313 240273900 -491167652 -1394483741 -731441552 +14062 11006 1413111008 -15056 -60 -1285298976 1303653581 15862627961 600587 -928766616 2671049203 529050065 3599815819 -21481 NULL NULL NULL NULL -928766616 -928766616 -928766616 -21481 -928766616 -928766616 -928766616 NULL 13355 -14960 -1011669561 39749 97 -2950092371 -3475337943 15862627961 -1256 -928766616 56738273175 55728616981 57667039791 -35127 -38183 431378678 29390 -2 -1045189740 -3184474087 15862627961 -390071 -928766616 12262812142 10354331249 13191578758 +33616 -12399 2030965207 -6115 13 2641271504 974546445 15862627961 866208 794623392 9618016673 9988992488 8823393281 12636 NULL NULL NULL NULL 794623392 794623392 794623392 12636 794623392 794623392 794623392 NULL 96002 46002 715235348 30466 123 2272791696 3554144565 15862627961 193025 794623392 57047716212 57810649168 56253092820 12762 -33253 1993193190 -31054 -43 2856840301 3300694238 15862627961 -621575 794623392 7039234680 8338954313 6244611288 +20255 8988 1824882165 43647 -38 -2263607335 -1339125374 15862627961 525969 -2138770630 10983774632 12172060572 13122545262 21456 NULL NULL NULL NULL -2138770630 -2138770630 -2138770630 21456 -2138770630 -2138770630 -2138770630 NULL -6276 -18655 -2141999138 29416 -59 -6422221472 -8346656693 15862627961 -8321 -2138770630 20146078803 18004627099 22284849433 38577 27310 -1009656194 -17538 68 -3241149212 -1025454778 15862627961 -272516 -2138770630 2740082699 3503015655 4878853329 +11625 36363 2051224722 -31438 97 -2878810989 -1380600149 15862627961 624311 -335410409 11452257685 11318043778 11787668094 18384 NULL NULL NULL NULL -335410409 -335410409 -335410409 18384 -335410409 -335410409 -335410409 NULL -5940 -16388 -382483011 34619 -79 -1064883047 -875807693 15862627961 92637 -335410409 64903708596 64556718969 65239119005 -17721 7017 2033001162 31696 118 -1441635278 -3888467183 15862627961 -373930 -335410409 4074959867 5668760271 4410370276 +22255 28868 -1302295658 2147 22 1874406893 5455080817 15862627961 799510 2064155045 9994173560 10664671458 7930018515 13788 NULL NULL NULL NULL 2064155045 2064155045 2064155045 13788 2064155045 2064155045 2064155045 NULL 15973 6135 2051224722 -6012 -56 6168759179 6314333421 15862627961 238009 2064155045 6314333421 8367712833 4250178376 -2090 4523 -1991133944 10843 17 6149069904 2245382708 15862627961 -553725 2064155045 7932609446 5833804210 5868454401 +47750 11580 -1448995523 39440 113 -1049567811 2291766377 15862627961 947475 -237425046 5017916272 6231843261 5255341318 5281 NULL NULL NULL NULL -237425046 -237425046 -237425046 5281 -237425046 -237425046 -237425046 NULL 11013 -22782 -346989627 33255 122 -919825082 -649370650 15862627961 97918 -237425046 65239119005 64903708596 65476544051 53530 17360 -2117946883 20389 -99 2759425399 -2709994284 15862627961 -710197 -237425046 10607286643 10498313277 10844711689 +117434 77259 1299719633 16302 122 -407508384 -1995762929 15862627961 901298 -1331533190 5530480458 7523673648 6862013648 10837 NULL NULL NULL NULL -1331533190 -1331533190 -1331533190 10837 -1331533190 -1331533190 -1331533190 NULL 55239 34790 -1383162419 16010 77 -4054281762 -5032853316 15862627961 -30296 -1331533190 47450052344 46110466191 48781585534 37269 -2906 141218956 87389 -101 -1574720463 -1583998862 15862627961 -658464 -1331533190 9000614313 8831855982 10332147503 +-38792 -25184 2025611582 20389 36 -759786886 -6189260496 15862627961 712350 -1808210365 2191096542 2252131671 3999306907 -16312 NULL NULL NULL NULL -1808210365 -1808210365 -1808210365 -16312 -1808210365 -1808210365 -1808210365 NULL -84359 -36697 -1882293856 31902 -61 -5504439770 -6300794780 15862627961 -67556 -1808210365 39809671411 37995735862 41617881776 9669 23277 439738328 2147 30 -6330479452 -325765486 15862627961 -496665 -1808210365 11863321054 12486424572 13671531419 +54956 -546 397430452 -17958 -72 -774892077 -1392370326 15862627961 266156 -1383162419 16677615270 18003483588 18060777689 27138 NULL NULL NULL NULL -1383162419 -1383162419 -1383162419 27138 -1383162419 -1383162419 -1383162419 NULL 10111 -19200 -1660426473 20449 71 -4492584415 -5356577420 15862627961 -35654 -1383162419 44727303772 43278308249 46110466191 46712 -8790 -537142430 36986 70 -1775723035 1258109085 15862627961 -7021 -1383162419 -2198149728 -1010059745 -814987309 +41786 27361 NULL -5204 13 2529191423 5168794507 15862627961 32514 -467659022 15862627961 15862627961 16330286983 32514 NULL NULL NULL NULL -467659022 -467659022 -467659022 32514 -467659022 -467659022 -467659022 NULL 91279 40283 -587831330 -29605 112 -1592632782 -1618174126 15862627961 103858 -467659022 63285534470 62748392040 63753193492 12156 -2269 -1176490478 12207 NULL 3137829300 2291766377 15862627961 231997 -467659022 -467659022 445048926 NULL +59319 7837 -1991133944 11551 -5 1840350039 2245382708 15862627961 853572 370975815 9988992488 12019957695 9618016673 13080 NULL NULL NULL NULL 370975815 370975815 370975815 13080 370975815 370975815 370975815 NULL 50607 -7301 141218956 13121 -25 752468671 1578956245 15862627961 196729 370975815 65358900679 65599174579 64987924864 47245 -4237 1299719633 30451 -95 181227663 2427194517 15862627961 -608495 370975815 6244611288 7039234680 5873635473 +-16856 -4018 762932956 NULL 118 -187208211 828690732 15862627961 586719 2051224722 13369268500 12359612306 11318043778 19316 NULL NULL NULL NULL 2051224722 2051224722 2051224722 19316 2051224722 2051224722 2051224722 NULL 25213 31720 2033001162 9838 93 6131863244 8275464464 15862627961 236863 2051224722 10418937555 12466574915 8367712833 -12838 NULL -335410409 -5985 47 828690732 -2114836321 15862627961 -335406 2051224722 4544584183 4410370276 2493359461 +-7120 2479 -108973366 36740 -106 -888530120 846995940 15862627961 953631 1436496767 7482261567 5364314684 6045764800 194 NULL NULL NULL NULL 1436496767 1436496767 1436496767 194 1436496767 1436496767 1436496767 NULL -5953 -22265 1413111008 -43603 -12 4273565571 6050294921 15862627961 259399 1436496767 39294596545 40718554341 37858099778 -611 8988 1902023838 -29587 -59 2660931489 -2190825778 15862627961 -721440 1436496767 9816863161 7889235051 8380366394 +42295 72839 -1339586153 -31054 -12 1466043674 1253036374 15862627961 909464 702611616 7784111103 7363068637 7081499487 -7688 NULL NULL NULL NULL 702611616 702611616 702611616 -7688 702611616 702611616 702611616 NULL -18099 -47482 659422734 66746 -40 2032532248 2887221188 15862627961 113643 702611616 59934937400 60605435298 59232325784 -31090 -546 -382483011 80491 112 3395035512 1863474126 15862627961 -685155 702611616 8781128474 10270861714 8078516858 +-68124 -47322 -134213907 -57682 1 5160673327 7362171447 15862627961 642478 1593800404 11787668094 11452257685 10193867690 18167 NULL NULL NULL NULL 1593800404 1593800404 1593800404 18167 1593800404 1593800404 1593800404 NULL -51962 -40668 1544188174 -29582 64 4717865318 6846112668 15862627961 233963 1593800404 33244301624 34824178364 31650501220 -48148 -27346 852509237 -71880 38 5218698356 6899004582 15862627961 -392314 1593800404 5668760271 7701761433 4074959867 +-56933 -27346 -1090239422 -9599 93 -1044244963 437338198 15862627961 842457 -1885422396 10048633851 9205940384 11934056247 -12612 NULL NULL NULL NULL -1885422396 -1885422396 -1885422396 -12612 -1885422396 -1885422396 -1885422396 NULL -43877 -22853 -1908480893 -68859 -24 -5693078400 -7389862166 15862627961 1303 -1885422396 34228019610 32328844499 36113442006 -7120 22467 586844478 -12255 -101 -888530120 1009134449 15862627961 -623072 -1885422396 3928571714 5981951126 5813994110 +-39770 -15328 623103518 5494 54 1609316679 1981771941 15862627961 659133 994303988 2936465061 3376203389 1942161073 -18218 NULL NULL NULL NULL 994303988 994303988 994303988 -18218 994303988 994303988 994303988 NULL 27948 29256 852509237 32012 -85 2759521173 4542648191 15862627961 223491 994303988 54487875635 55400583583 53493571647 -32689 -8247 -2141999138 -31438 -48 1584341489 1303653581 15862627961 -445354 994303988 13920466888 15333577896 12926162900 +34485 17970 -629486480 33142 77 -9207907 1195987713 15862627961 756174 383352709 9745728509 7846553398 9362375800 15295 NULL NULL NULL NULL 383352709 383352709 383352709 15295 383352709 383352709 383352709 NULL 94879 38342 240273900 -24360 14 994602424 1639359108 15862627961 212024 383352709 64987924864 65358900679 64604572155 24352 7837 670497898 -6115 45 433054757 -1392370326 15862627961 -508882 383352709 6500252161 5197956503 6116899452 +44727 27310 1955646088 60858 31 2940130772 -3871666709 15862627961 415116 715235348 14618057582 14030226252 13902822234 23388 NULL NULL NULL NULL 715235348 715235348 715235348 23388 715235348 715235348 715235348 NULL 73515 6769 702611616 50000 -38 2124288232 3125300933 15862627961 159645 715235348 58525884516 59232325784 57810649168 53780 36363 706441268 8900 49 -1972491598 1796328434 15862627961 -159731 715235348 1959805727 1159243956 1244570379 +35484 23277 -800561771 14425 68 1728676075 4109068163 15862627961 482937 1824882165 13996942737 14703384005 12172060572 22080 NULL NULL NULL NULL 1824882165 1824882165 1824882165 22080 1824882165 1824882165 1824882165 NULL -12886 -8359 1689098844 -1133 55 5252312264 7673725065 15862627961 204381 1824882165 28223071121 29961402376 26398188956 41786 29579 -2138770630 28558 -40 2529191423 775314354 15862627961 -228860 1824882165 3690567389 4878853329 1865685224 +68836 12398 715235348 10843 -82 2056218702 887668931 15862627961 460857 706441268 14703384005 13902822234 13996942737 22614 NULL NULL NULL NULL 706441268 706441268 706441268 22614 706441268 706441268 706441268 NULL 22263 -16051 670497898 56768 52 2079550782 2979232964 15862627961 136257 706441268 59232325784 59934937400 58525884516 54201 -2237 1188285940 33142 31 447930603 1519076272 15862627961 -206246 706441268 1865685224 3690567389 1159243956 +-39770 -15328 -1011669561 5494 41 1609316679 1981771941 15862627961 934121 1354539333 6733796348 8313673088 5379257015 -3855 NULL NULL NULL NULL 1354539333 1354539333 1354539333 -3855 1354539333 1354539333 1354539333 NULL -4696 40365 1325868318 7070 54 4017450800 5628104904 15862627961 252329 1354539333 43486204682 44823247831 42131665349 -32689 -8247 -1339586153 -31438 -90 1584341489 1303653581 15862627961 -705979 1354539333 10483370946 9839145477 9128831613 +-611 -37351 852509237 -33532 -44 2660931489 -1025454778 15862627961 709418 49866617 7266933535 7308357291 7217066918 15874 NULL NULL NULL NULL 49866617 49866617 49866617 15874 49866617 49866617 49866617 NULL 18051 1950 -4229382 22232 30 87060991 492394602 15862627961 161417 49866617 65851295281 65892719037 65801428664 31670 -5070 -1899175111 -9599 62 1113315852 3560913151 15862627961 -461547 49866617 8645561043 8016074563 8595694426 +54201 43358 41423756 -6613 45 447930603 2308428293 15862627961 725206 -629486480 7217066918 7266933535 7846553398 15788 NULL NULL NULL NULL -629486480 -629486480 -629486480 15788 -629486480 -629486480 -629486480 NULL 30673 -4943 -673237643 82314 49 -1946949592 -2222119262 15862627961 21544 -629486480 61531074230 60886848761 62160560710 22255 11412 383352709 56438 68 1874406893 1210863559 15862627961 -477421 -629486480 8016074563 6116899452 8645561043 +-68124 -47322 -1176490478 -57682 57 5160673327 7362171447 15862627961 154323 -903316089 16353795613 16594069513 17257111702 29106 NULL NULL NULL NULL -903316089 -903316089 -903316089 29106 -903316089 -903316089 -903316089 NULL 12927 17786 -1009656194 -17427 -101 -2841738899 -3219808970 15862627961 27850 -903316089 57667039791 56738273175 58570355880 -48148 -27346 397430452 -71880 123 5218698356 6899004582 15862627961 106780 -903316089 -1394483741 -2538286079 -491167652 +-55630 -46744 -1813935549 -12255 3 5156491918 3321754114 15862627961 294005 427197269 2630808177 1408274187 2203610908 -30336 NULL NULL NULL NULL 427197269 427197269 427197269 -30336 427197269 427197269 427197269 NULL 4015 28375 383352709 -42587 103 1207980430 1732335675 15862627961 209850 427197269 64207141703 64604572155 63779944434 -8499 387 1544188174 -12652 -117 4624049772 5587870596 15862627961 -92344 427197269 13659017053 14318439787 13231819784 +9669 -10720 1325868318 36170 -29 -6330479452 775314354 15862627961 291746 1188089983 18060777689 16677615270 16872687706 25590 NULL NULL NULL NULL 1188089983 1188089983 1188089983 25590 1188089983 1188089983 1188089983 NULL 45858 13846 994303988 4688 68 3354362251 4872767585 15862627961 233927 1188089983 52321603367 53493571647 51133513384 47750 27361 1423957796 -13608 -8 -1049567811 -7024468539 15862627961 -34159 1188089983 -1010059745 -1547202175 -2198149728 +87389 NULL 1593800404 40175 62 -83707341 -541722291 15862627961 677207 852509237 8160866528 10193867690 7308357291 16620 NULL NULL NULL NULL 852509237 852509237 852509237 16620 852509237 852509237 852509237 NULL 105452 44132 762932956 -1308 13 2410065585 3931489453 15862627961 209645 852509237 56253092820 57047716212 55400583583 117434 30045 49866617 31106 1 -407508384 -83707341 15862627961 -428590 852509237 8554270670 8595694426 7701761433 +-22116 11412 1188089983 -26471 -5 3390925772 -7024468539 15862627961 342337 1423957796 17409830136 16872687706 15985872340 25286 NULL NULL NULL NULL 1423957796 1423957796 1423957796 25286 1423957796 1423957796 1423957796 NULL -19581 -26651 1354539333 -40474 71 4191608137 5894375977 15862627961 259205 1423957796 40718554341 42131665349 39294596545 -21948 11580 -587831330 -11396 -29 -6071106818 5455080817 15862627961 -85054 1423957796 -123244379 1832401709 -1547202175 +-31020 23125 -1882293856 -12652 64 1208315423 6899004582 15862627961 437586 1738331255 2348531094 4339704068 610199839 -25136 NULL NULL NULL NULL 1738331255 1738331255 1738331255 -25136 1738331255 1738331255 1738331255 NULL -14350 15232 1593800404 45505 -82 5021230503 7420883346 15862627961 182301 1738331255 29961402376 31650501220 28223071121 -44611 9534 -673237643 16302 102 4160882907 1074101516 15862627961 -230725 1738331255 15252428122 16941526966 13514096867 +20625 6926 -1660426473 11361 29 2284185998 3645319585 15862627961 937976 1579876740 8313673088 7302003527 6733796348 -2935 NULL NULL NULL NULL 1579876740 1579876740 1579876740 -2935 1579876740 1579876740 1579876740 NULL -25242 -8974 1489733240 -33495 97 4613798154 6601107243 15862627961 215796 1579876740 34824178364 36368366538 33244301624 40940 27241 -644225469 39440 -107 5636453529 4109068163 15862627961 -708914 1579876740 9128831613 10483370946 7548954873 +77259 NULL -467659022 67120 123 -1176490478 -1583998862 15862627961 95684 -1176490478 15417579035 16330286983 16594069513 31106 NULL NULL NULL NULL -1176490478 -1176490478 -1176490478 31106 -1176490478 -1176490478 -1176490478 NULL 55628 25928 -1302295658 13821 57 -3701320126 -4422201799 15862627961 -14286 -1176490478 51306415182 50083881192 52482905660 98226 20967 -903316089 NULL 13 -252465672 -1176490478 15862627961 167419 -1176490478 -731441552 -491167652 445048926 +47245 35694 -1808210365 -11396 29 181227663 6588808232 15862627961 677351 439738328 3376203389 3999306907 2936465061 -18025 NULL NULL NULL NULL 439738328 439738328 439738328 -18025 439738328 439738328 439738328 NULL -85830 -52522 431378678 -60389 -31 1305138406 2309109058 15862627961 167263 439738328 62914544356 63348565756 62474806028 -13633 -25184 1413111008 51482 36 2937914773 887668931 15862627961 -463379 439738328 12926162900 13920466888 12486424572 +2003 30045 -644225469 -71880 5 -664229739 3739840441 15862627961 917152 -421042466 7363068637 6023482484 7784111103 -6823 NULL NULL NULL NULL -421042466 -421042466 -421042466 -6823 -421042466 -421042466 -421042466 NULL 65926 49800 -537142430 -4398 73 -1425843918 -1485925513 15862627961 97035 -421042466 63753193492 63285534470 64174235958 -74786 -46744 1489733240 33962 71 1748667467 -1995762929 15862627961 -691978 -421042466 8078516858 8781128474 8499559324 +-74786 -2906 -928766616 -20802 73 1748667467 5587870596 15862627961 556662 431378678 5508296712 3599815819 5076918034 -22186 NULL NULL NULL NULL 431378678 431378678 431378678 -22186 431378678 431378678 431378678 NULL -11441 43457 397430452 -33308 -54 1256006399 1891982884 15862627961 187664 431378678 63779944434 64207141703 63348565756 -68124 3756 1337043149 -28042 -60 5160673327 1639694101 15862627961 -346851 431378678 10785709927 12068174600 10354331249 +-1210 -38196 994303988 55502 36 550424758 714841163 15862627961 622068 -2141999138 529050065 1942161073 2671049203 -18655 NULL NULL NULL NULL -2141999138 -2141999138 -2141999138 -18655 -2141999138 -2141999138 -2141999138 NULL -29777 NULL NULL 12379 -72 -2141999138 -8540168355 15862627961 -18655 -2141999138 15862627961 15862627961 18004627099 54956 17970 -1908480893 -20087 54 -774892077 1253036374 15862627961 -408726 -2141999138 13191578758 12262812142 15333577896 +12762 18877 -421042466 16515 73 2856840301 -546350337 15862627961 900296 1489733240 7081499487 7784111103 5591766247 -9168 NULL NULL NULL NULL 1489733240 1489733240 1489733240 -9168 1489733240 1489733240 1489733240 NULL -33598 6876 1423957796 -16268 -56 4350187803 6207598558 15862627961 250231 1489733240 37858099778 39294596545 36368366538 34485 40600 -2141451704 46015 5 -9207907 714841163 15862627961 -677467 1489733240 10270861714 9888378703 8781128474 +57823 -22668 370975815 -30544 -101 3944161437 2125466408 15862627961 878821 1299719633 8823393281 9618016673 7523673648 12613 NULL NULL NULL NULL 1299719633 1299719633 1299719633 12613 1299719633 1299719633 1299719633 NULL 45053 27189 1213926989 1101 70 3796111295 5317170433 15862627961 251228 1299719633 47448835782 48731300455 46149116149 42295 -38196 -1331533190 5494 -5 1466043674 1845356201 15862627961 -634211 1299719633 8338954313 10332147503 7039234680 +-8499 3756 2047637360 -29587 -85 4624049772 -144263301 15862627961 775806 2143473091 7593184624 7246194997 5449711533 -14704 NULL NULL NULL NULL 2143473091 2143473091 2143473091 -14704 2143473091 2143473091 2143473091 NULL -4866 1146 2064155045 NULL NULL 6314333421 2143473091 15862627961 231997 2143473091 2143473091 4250178376 NULL -56933 -44678 2025611582 -8886 -101 -1044244963 7362171447 15862627961 -558513 2143473091 10412916428 11584884708 8269443337 +98226 31106 1993193190 33962 -76 -252465672 -1743478794 15862627961 911428 -168758331 6862013648 5530480458 7030771979 10130 NULL NULL NULL NULL -168758331 -168758331 -168758331 10130 -168758331 -168758331 -168758331 NULL 39786 5167 -335410409 21158 118 -741593786 -416174986 15862627961 108048 -168758331 65476544051 65239119005 65645302382 90245 23125 2106705285 77259 120 -1634505428 -252465672 15862627961 -669301 -168758331 8831855982 8973074938 9000614313 +36394 -8247 141218956 -20087 -99 1160862510 1946039989 15862627961 936581 -1448995523 4782847738 6889553023 6231843261 7652 NULL NULL NULL NULL -1448995523 -1448995523 -1448995523 7652 -1448995523 -1448995523 -1448995523 NULL -12872 -44774 -1808210365 32496 -8 -4917632361 -5503277285 15862627961 -62792 -1448995523 43278308249 41617881776 44727303772 32242 -12399 -237425046 36430 -56 -86961173 2495165914 15862627961 -696932 -1448995523 9630784700 10844711689 11079780223 +-21948 4523 -4229382 28558 -107 -6071106818 -2709994284 15862627961 943815 -1660426473 5641577054 6075598454 7302003527 -2888 NULL NULL NULL NULL -1660426473 -1660426473 -1660426473 -2888 -1660426473 -1660426473 -1660426473 NULL -64095 -52547 -1813935549 29311 12 -5282572387 -5832170568 15862627961 -70444 -1660426473 41617881776 39809671411 43278308249 -12381 14090 1579876740 -33528 -54 -2472569238 -2420213359 15862627961 -714706 -1660426473 8560624434 7548954873 10221050907 +2913 -2269 2106705285 -18079 -79 1253758252 -921860586 15862627961 942194 1213926989 6231843261 4782847738 5017916272 5613 NULL NULL NULL NULL 1213926989 1213926989 1213926989 5613 1213926989 1213926989 1213926989 NULL 15124 10436 1188089983 17864 73 3590302912 5121979613 15862627961 261116 1213926989 49945227444 51133513384 48731300455 1164 -4018 -108973366 11361 12 89808975 3279369834 15862627961 -704584 1213926989 10844711689 10607286643 9630784700 +-7120 2479 1354539333 36740 112 -888530120 846995940 15862627961 923975 -1339586153 6023482484 5379257015 7363068637 -5479 NULL NULL NULL NULL -1339586153 -1339586153 -1339586153 -5479 -1339586153 -1339586153 -1339586153 NULL 37260 4764 -1448995523 -4259 120 -4171744095 -5195948991 15862627961 -41133 -1339586153 46110466191 44727303772 47450052344 -611 8988 702611616 -29587 41 2660931489 -2190825778 15862627961 -697457 -1339586153 8499559324 8078516858 9839145477 +12156 17360 2143473091 32854 30 3137829300 3279369834 15862627961 744772 2025611582 4277743253 5449711533 2252131671 -15880 NULL NULL NULL NULL 2025611582 2025611582 2025611582 -15880 2025611582 2025611582 2025611582 NULL 9709 338 1991172974 18539 -95 6009977746 8137215311 15862627961 199008 2025611582 18556152866 20549346056 16530541284 14039 19243 -1808210365 14425 -85 2065442845 4309797580 15862627961 -528655 2025611582 13610496290 13671531419 11584884708 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt index df6b3f2da365..b0c7ec96fba0 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt @@ -26,3 +26,104 @@ SELECT LAG(c8, -200, 10) OVER() AS prev_out_of_bounds_c8 FROM aggregate_test_100_by_sql ORDER BY c8; +---- +102 33715 48099 10 31648 28086 10 +299 NULL 10 10 7781 0 10 +363 17910 40566 10 48048 27744 10 +417 18736 53000 10 45185 29458 10 +794 44507 49283 10 3583 40622 10 +829 33821 11872 10 61069 59663 10 +832 53012 2684 10 40622 48483 10 +1535 34970 48048 10 50842 2516 10 +2516 57594 17910 10 34970 36599 10 +2555 24770 34970 10 28086 53000 10 +2684 47061 57751 10 12876 14722 10 +2809 56980 3691 10 64517 27600 10 +2986 35477 28086 10 12757 45185 10 +3583 794 24022 10 35429 44507 10 +3691 50009 35429 10 63353 5494 10 +3975 59134 10 10 39363 30972 10 +4168 24022 829 10 15573 49283 10 +5382 12393 31648 10 24380 12757 10 +5494 21119 794 10 50009 52046 10 +7781 299 10 10 30972 0 10 +9489 52286 32712 10 14337 34331 10 +9832 20807 12393 10 34331 17835 10 +11872 39363 10 10 57885 3975 10 +12393 12757 102 10 5382 2986 10 +12757 2986 33715 10 12393 35477 10 +12876 2684 29527 10 45253 47061 10 +13763 15573 53815 10 48483 4168 10 +14337 9489 15777 10 43062 52286 10 +14722 53815 54276 10 47061 61069 10 +15573 4168 61069 10 13763 24022 10 +15777 32712 18736 10 62167 24380 10 +17835 57510 2986 10 20807 45465 10 +17910 27744 34206 10 363 20421 10 +18736 29458 39635 10 417 35106 10 +20120 57885 10 10 54276 11872 10 +20421 63353 23948 10 27744 3691 10 +20807 17835 12757 10 9832 57510 10 +21119 52046 44507 10 5494 40566 10 +21463 48099 56980 10 43655 50842 10 +23948 61637 13763 10 55620 35429 10 +24022 49283 33821 10 4168 45253 10 +24380 5382 35106 10 32712 12393 10 +24770 53000 2516 10 2555 39635 10 +27034 48048 21119 10 27600 363 10 +27600 27034 5494 10 56980 48048 10 +27744 20421 55620 10 17910 63353 10 +28086 2555 1535 10 33715 24770 10 +29458 35106 52569 10 18736 31648 10 +29527 57751 30972 10 30296 42171 10 +30296 29527 59134 10 59663 57751 10 +30972 7781 10 10 59134 299 10 +31648 102 21463 10 35106 33715 10 +32712 24380 29458 10 15777 5382 10 +33715 28086 50842 10 102 2555 10 +33821 59663 39363 10 829 30296 10 +34206 55620 53012 10 40566 23948 10 +34331 9832 5382 10 52286 20807 10 +34970 2516 363 10 1535 57594 10 +35106 31648 43655 10 29458 102 10 +35429 3583 4168 10 61637 794 10 +35477 45185 2555 10 2986 417 10 +36599 64517 20421 10 57594 2809 10 +39363 3975 10 10 11872 59134 10 +39635 52569 36599 10 53000 43655 10 +40566 34206 832 10 52046 55620 10 +40622 832 12876 10 44507 53012 10 +42171 54276 299 10 57751 20120 10 +43062 14337 62167 10 NULL 9489 10 +43655 21463 2809 10 52569 48099 10 +44507 40622 45253 10 794 832 10 +45185 417 24770 10 35477 18736 10 +45253 12876 30296 10 49283 2684 10 +45465 62167 45185 10 57510 15777 10 +47061 14722 42171 10 2684 53815 10 +48048 363 52046 10 27034 17910 10 +48099 50842 27600 10 21463 1535 10 +48483 13763 14722 10 53012 15573 10 +49283 45253 59663 10 24022 12876 10 +50009 5494 3583 10 3691 21119 10 +50842 1535 27034 10 48099 34970 10 +52046 40566 40622 10 21119 34206 10 +52286 34331 24380 10 9489 9832 10 +52569 43655 64517 10 39635 21463 10 +53000 39635 57594 10 24770 52569 10 +53012 48483 47061 10 832 13763 10 +53815 61069 20120 10 14722 829 10 +54276 20120 10 10 42171 57885 10 +55620 23948 48483 10 34206 61637 10 +56980 27600 50009 10 2809 27034 10 +57510 45465 35477 10 17835 62167 10 +57594 36599 27744 10 2516 64517 10 +57751 42171 7781 10 29527 54276 10 +57885 11872 10 10 20120 39363 10 +59134 30972 10 10 3975 7781 10 +59663 30296 3975 10 33821 29527 10 +61069 829 57885 10 53815 33821 10 +61637 35429 15573 10 23948 3583 10 +62167 15777 417 10 45465 32712 10 +63353 3691 61637 10 20421 50009 10 +64517 2809 63353 10 36599 56980 10 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt index 1b6451e0314c..b81b2207be1a 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt @@ -29,3 +29,104 @@ SELECT SUM(c2) OVER(PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation21 FROM aggregate_test_100_by_sql ORDER BY c9; +---- +61035129 -38183 231997 145307 4 -9603 63 -16110 4 4 +-108973366 -2906 231997 131173 2 150222 44 3917 2 2 +623103518 -38455 231997 137382 5 -30140 60 -16974 5 5 +-1927628110 -4018 231997 19981 2 -6028 56 -1114 2 2 +-1899175111 15673 231997 13915 2 4551 60 15673 2 2 +-1991133944 5182 231997 21095 1 15675 44 13630 1 1 +-346989627 -14061 231997 74253 3 25687 62 -13217 3 3 +-1009656194 36363 231997 20225 4 28059 62 20690 4 4 +397430452 80491 231997 240186 3 20142 60 28162 3 3 +1993193190 -14061 231997 214888 4 12439 60 11640 4 4 +1325868318 65202 231997 278980 1 -23170 56 27752 1 1 +-1882293856 -8790 231997 -22782 1 -30113 56 -24085 1 1 +1282464673 -9599 231997 238615 4 -39052 63 -22501 4 4 +1544188174 4523 231997 218731 4 -70358 63 -31500 4 4 +2030965207 27241 231997 212619 3 -90242 63 13611 3 3 +-537142430 12398 231997 71344 2 -29772 56 25305 2 2 +1689098844 11267 231997 207437 5 -78717 63 -26526 5 5 +1337043149 -8247 231997 256184 3 9967 60 -22796 3 3 +1171968280 17360 231997 208337 1 20150 60 -15154 1 1 +1902023838 -8549 231997 202910 4 233222 44 -1471 4 4 +-1143802338 8900 231997 14495 1 117791 44 28781 1 1 +-673237643 -8247 231997 10423 4 23116 62 -28070 4 4 +1188285940 8988 231997 255503 5 73746 62 21576 5 5 +2053379412 -12642 231997 224221 2 196022 44 -12642 2 2 +586844478 -12907 231997 154356 5 -13166 60 -12907 5 5 +-382483011 -9599 231997 87470 3 -39337 56 -9565 3 3 +-800561771 -15056 231997 38493 2 51186 62 23127 2 2 +-1011669561 -2904 231997 -465 2 -79516 56 -2904 2 2 +-134213907 19208 231997 127256 5 -14848 56 19208 5 5 +-4229382 -1967 231997 129206 4 23720 62 -1967 4 4 +-587831330 45185 231997 46039 2 -19184 63 24495 2 2 +-2098805236 13741 231997 7465 3 -4914 56 13741 3 3 +-2117946883 -13608 231997 -6276 5 2045 44 2045 5 5 +2106705285 4523 231997 246701 1 21131 60 8692 1 1 +2033001162 -546 231997 230728 2 -27731 56 18109 2 2 +1991172974 -24558 231997 203248 4 208664 44 -24558 4 4 +670497898 -8247 231997 121331 3 70388 62 14457 3 3 +762932956 43358 231997 180389 4 -9396 60 20744 4 4 +141218956 14090 231997 154116 3 159031 44 8809 3 3 +1413111008 -7078 231997 233919 1 55336 62 -18410 1 1 +-1813935549 -17195 231997 -51244 4 -23911 60 -28462 4 4 +-2141451704 14468 231997 -29777 3 -11122 60 -11122 3 3 +-1090239422 35827 231997 2439 2 -22198 63 -12056 2 2 +2047637360 3756 231997 217547 4 -103423 63 -13181 4 4 +-1302295658 2479 231997 -15205 3 57904 44 15091 3 3 +-644225469 13717 231997 5756 1 -55077 56 -4667 1 1 +912707948 52329 231997 241709 3 35304 60 32064 3 3 +-1222533990 -10871 231997 -45392 2 -76612 56 -30187 2 2 +659422734 -12399 231997 106874 4 -67542 56 -30508 4 4 +41423756 16337 231997 145543 5 40057 62 16337 5 5 +1955646088 64670 231997 227806 5 127598 62 24896 5 5 +-842693467 -14061 231997 15366 5 -36395 60 -12484 5 5 +434021400 -25184 231997 185288 4 17766 60 -2376 4 4 +-1908480893 -40939 231997 -1758 2 -283 62 -21739 2 2 +240273900 67120 231997 183649 3 188564 44 29533 3 3 +-928766616 -38455 231997 -1256 1 -43679 63 -21481 1 1 +794623392 64670 231997 193025 1 3240 60 12636 1 1 +-2138770630 37793 231997 -8321 2 21456 62 21456 2 2 +-335410409 -20071 231997 92637 1 136175 44 18384 1 1 +2064155045 -11396 231997 238009 4 -89635 63 13788 4 4 +-237425046 27361 231997 97918 4 -34056 56 5281 4 4 +-1331533190 30045 231997 -30296 1 -10142 63 10837 1 1 +-1808210365 -40939 231997 -67556 2 -46425 56 -16312 2 2 +-1383162419 27138 231997 -35654 1 42813 44 27138 1 1 +-467659022 32514 231997 103858 5 13330 63 32514 5 5 +370975815 28868 231997 196729 2 -23315 60 13080 2 2 +2051224722 -10871 231997 236863 4 146914 62 19316 4 4 +1436496767 59917 231997 259399 3 -38858 63 194 3 3 +702611616 -38196 231997 113643 4 180876 44 -7688 4 4 +1593800404 3756 231997 233963 2 -52191 63 18167 2 2 +-1885422396 -49963 231997 1303 4 -12612 63 -12612 4 4 +994303988 -22073 231997 223491 1 52170 62 -18218 1 1 +383352709 15295 231997 212024 1 -8020 60 15295 1 1 +715235348 35827 231997 159645 2 -16551 63 23388 2 2 +1824882165 6926 231997 204381 5 102702 62 22080 5 5 +706441268 35694 231997 136257 5 203490 44 22614 5 5 +1354539333 -22073 231997 252329 2 -27025 56 -3855 2 2 +49866617 8988 231997 161417 2 55931 62 15874 2 2 +-629486480 15788 231997 21544 5 38904 62 15788 5 5 +-903316089 3756 231997 27850 3 -50410 56 29106 3 3 +427197269 -42978 231997 209850 4 -39939 63 -30336 4 4 +1188089983 14468 231997 233927 1 229080 44 25590 1 1 +852509237 67120 231997 209645 4 -50922 56 16620 4 4 +1423957796 -13608 231997 259205 4 80622 62 25286 4 4 +1738331255 -71880 231997 182301 3 -103853 63 -25136 3 3 +1579876740 -2935 231997 215796 4 -29960 56 -2935 4 4 +-1176490478 87389 231997 -14286 1 89010 44 31106 1 1 +439738328 -18025 231997 167263 2 -259 60 -18025 2 2 +-421042466 -6823 231997 97035 3 6507 63 -6823 3 3 +431378678 -46744 231997 187664 1 -37034 56 -22186 1 1 +-2141999138 18877 231997 -18655 3 -18655 56 -18655 3 3 +1489733240 -9168 231997 250231 3 799 60 -9168 3 3 +1299719633 52329 231997 251228 3 32763 60 12613 3 3 +2143473091 -14704 231997 231997 1 6427 60 -14704 1 1 +-168758331 20967 231997 108048 2 146305 44 10130 2 2 +-1448995523 7652 231997 -62792 1 7369 62 7652 1 1 +-1660426473 -2888 231997 -70444 2 -15500 63 -2888 2 2 +1213926989 -8448 231997 261116 1 234693 44 5613 1 1 +-1339586153 59917 231997 -41133 1 -20979 63 -5479 1 1 +2025611582 -2269 231997 199008 5 -45840 56 -15880 5 5 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt index ac722307d99a..92e587409035 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt @@ -24,3 +24,104 @@ select percent_rank() OVER (PARTITION BY c2 ORDER BY c3) percent_rank_by_c3 FROM aggregate_test_100_by_sql ORDER BY c9; +---- +28774375 0.608695652174 14 14 0.590909090909 +63044568 0.954545454545 21 19 0.952380952381 +141047417 0.714285714286 10 10 0.692307692308 +141680161 0.136363636364 3 3 0.095238095238 +145294611 0.590909090909 13 12 0.571428571429 +225513085 0.090909090909 2 2 0.047619047619 +243203849 0.052631578947 1 1 0 +326151275 0.652173913043 15 15 0.636363636364 +431948861 0.473684210526 9 8 0.444444444444 +466439833 0.130434782609 3 3 0.090909090909 +473294098 0.772727272727 17 17 0.761904761905 +520189543 0.318181818182 7 7 0.285714285714 +538589788 0.782608695652 18 18 0.772727272727 +557517119 0.304347826087 7 7 0.272727272727 +559847112 0.105263157895 2 2 0.055555555556 +598822671 0.409090909091 9 8 0.380952380952 +662099130 0.857142857143 12 12 0.846153846154 +754775609 0.578947368421 10 9 0.5 +774637006 0.136363636364 3 3 0.095238095238 +811650497 0.695652173913 16 16 0.681818181818 +879082834 0.727272727273 16 16 0.714285714286 +933879086 0.565217391304 13 13 0.545454545455 +974297360 0.928571428571 13 13 0.923076923077 +1000948272 0.863636363636 19 17 0.857142857143 +1013876852 0.571428571429 8 8 0.538461538462 +1088543984 0.736842105263 14 12 0.722222222222 +1098639440 0.545454545455 12 11 0.52380952381 +1157161427 0.090909090909 2 2 0.047619047619 +1229567292 1 14 14 1 +1243785310 0.086956521739 2 2 0.045454545455 +1289293657 0.636363636364 14 13 0.619047619048 +1362369177 0.631578947368 12 10 0.611111111111 +1365198901 0.357142857143 5 5 0.307692307692 +1454057357 0.227272727273 5 5 0.190476190476 +1491205016 0.454545454545 10 9 0.428571428571 +1534194097 0.95652173913 22 22 0.954545454545 +1538863055 0.578947368421 10 9 0.5 +1787652631 0.434782608696 10 10 0.409090909091 +1824517658 0.157894736842 3 3 0.111111111111 +1842680163 0.681818181818 15 15 0.666666666667 +1865307672 0.739130434783 17 17 0.727272727273 +1995343206 0.210526315789 4 4 0.166666666667 +2013662838 0.727272727273 15 14 0.666666666667 +2042457019 0.913043478261 21 21 0.909090909091 +2093538928 0.789473684211 15 13 0.777777777778 +2125812933 0.636363636364 14 14 0.619047619048 +2214035726 0.421052631579 7 7 0.333333333333 +2293105904 0.045454545455 1 1 0 +2306130875 0.478260869565 11 11 0.454545454545 +2307004493 0.785714285714 11 11 0.769230769231 +2424630722 0.642857142857 9 9 0.615384615385 +2496054700 0.071428571429 1 1 0 +2502326480 0.347826086957 8 8 0.318181818182 +2525744318 0.272727272727 5 5 0.190476190476 +2592330556 1 19 17 1 +2610290479 0.545454545455 12 12 0.52380952381 +2669374863 0.409090909091 9 9 0.380952380952 +2705709344 0.772727272727 17 15 0.761904761905 +2712615025 0.590909090909 13 13 0.571428571429 +2778168728 0.391304347826 9 9 0.363636363636 +2818832252 0.217391304348 5 5 0.181818181818 +2830981072 0.954545454545 21 21 0.952380952381 +2844041986 0.272727272727 5 5 0.190476190476 +2861376515 0.363636363636 8 8 0.333333333333 +2861911482 0.214285714286 3 3 0.153846153846 +2939920218 0.363636363636 8 7 0.333333333333 +3023531799 0.04347826087 1 1 0 +3105312559 0.684210526316 13 11 0.666666666667 +3126475872 0.521739130435 12 12 0.5 +3188005828 0.909090909091 20 18 0.904761904762 +3198969145 0.826086956522 19 19 0.818181818182 +3275293996 0.5 11 11 0.47619047619 +3276123488 0.272727272727 6 6 0.238095238095 +3314983189 0.727272727273 15 14 0.666666666667 +3342719438 0.285714285714 4 4 0.230769230769 +3373581039 0.5 7 7 0.461538461538 +3398507249 0.5 11 10 0.47619047619 +3455216719 0.818181818182 18 16 0.809523809524 +3457053821 0.428571428571 6 6 0.384615384615 +3473924576 0.842105263158 16 14 0.833333333333 +3521368277 0.869565217391 20 20 0.863636363636 +3542840110 0.181818181818 4 4 0.142857142857 +3566741189 1 23 23 1 +3570297463 0.260869565217 6 6 0.227272727273 +3577318119 0.894736842105 17 15 0.888888888889 +3593959807 0.173913043478 4 4 0.136363636364 +3625286410 1 22 22 1 +3717551163 0.318181818182 7 6 0.285714285714 +3759340273 0.947368421053 18 16 0.944444444444 +3766999078 0.909090909091 20 20 0.904761904762 +3862393166 0.315789473684 6 6 0.277777777778 +3959216334 0.263157894737 5 5 0.222222222222 +3998790955 0.421052631579 7 7 0.333333333333 +4015442341 0.863636363636 19 19 0.857142857143 +4061635107 1 22 20 1 +4076864659 0.454545454545 10 10 0.428571428571 +4144173353 0.181818181818 4 4 0.142857142857 +4216440507 0.045454545455 1 1 0 +4229654142 0.818181818182 18 18 0.809523809524 +4268716378 0.142857142857 2 2 0.076923076923 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt index cac0e17f4a88..84a4dc7e518b 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt @@ -18,3 +18,104 @@ query TIIIIIIIITRRT select * from aggregate_test_100_by_sql order by c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13; +---- +a 1 -85 -15154 1171968280 1919439543497968449 77 52286 774637006 12101411955859039553 0.12285209 0.686439196277 0keZ5G8BffGwgF2RwQD59TFzMStxCB +a 1 -56 8692 2106705285 -7811675384226570375 231 15573 1454057357 677091006469429514 0.42794758 0.273993852924 JN0VclewmjwYlSl8386MlWv5rEhWCz +a 1 -25 15295 383352709 4980135132406487265 231 102 3276123488 12763583666216333412 0.53796273 0.17592486906 XemNcT1xp61xcM1Qz3wZ1VECCnq06O +a 1 -5 12636 794623392 2909750622865366631 15 24022 2669374863 4776679784701509574 0.29877836 0.253725340799 waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs +a 1 83 -14704 2143473091 -4387559599038777245 37 829 4015442341 4602675983996931623 0.89542526 0.956759554125 ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU +a 2 -48 -18025 439738328 -313657814587041987 222 13763 3717551163 9135746610908713318 0.055064857 0.980019341044 ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8 +a 2 -43 13080 370975815 5881039805148485053 2 20120 2939920218 906367167997372130 0.42733806 0.163011105157 m6jD0LBIQWaMfenwRCTANI9eOdyyto +a 2 45 15673 -1899175111 398282800995316041 99 2555 145294611 8554426087132697832 0.17333257 0.640526242956 b3b9esRhTzFEawbs6XhpKnD9ojutHB +a 3 -72 -11122 -2141451704 -2578916903971263854 83 30296 1995343206 17452974532402389080 0.94209343 0.323175061008 e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG +a 3 -12 -9168 1489733240 -1569376002217735076 206 33821 3959216334 16060348691054629425 0.9488028 0.929388350248 oLZ21P2JEDooxV1pU31cIxQHEeeoLu +a 3 13 12613 1299719633 2020498574254265315 191 17835 3998790955 14881411008939145569 0.041445434 0.881316749782 Amn2K87Db5Es3dFQO9cw9cvpAM6h35 +a 3 13 32064 912707948 3826618523497875379 42 21463 2214035726 10771380284714693539 0.6133468 0.732510667866 i6RQVXKUh7MzuGMDaNclUYnFUAireU +a 3 14 28162 397430452 -452851601758273256 57 14722 431948861 8164671015278284913 0.40199697 0.072604759609 TtDKUZxzVxsq758G6AWPSYuZgVgbcl +a 3 17 -22796 1337043149 -1282905594104562444 167 2809 754775609 732272194388185106 0.3884129 0.65867112904 VDhtJkYjAYPykCgOU9x3v7v3t4SO1a +a 4 -101 11640 1993193190 2992662416070659899 230 40566 466439833 16778113360088370541 0.3991115 0.574210838215 NEhyk8uIx4kEULJGa8qIyFjjBcP2G6 +a 4 -54 -2376 434021400 5502271306323260832 113 15777 2502326480 7966148640299601101 0.5720931 0.305853751513 KJFcmTVjdkCMv94wYCtfHMFhzyRsmH +a 4 -38 20744 762932956 308913475857409919 7 45465 1787652631 878137512938218976 0.7459874 0.021825780392 ydkwycaISlYSlEq3TlkS2m15I2pcp8 +a 4 65 -28462 -1813935549 7602389238442209730 18 363 1865307672 11378396836996498283 0.09130204 0.559324981528 WHmjWk2AY4c6m7DA4GitUx6nmb1yYS +a 5 -101 -12484 -842693467 -6140627905445351305 57 57885 2496054700 2243924747182709810 0.59520596 0.949139743286 QJYm7YRA3YetcBHI5wkMZeLXVmfuNy +a 5 -31 -12907 586844478 -4862189775214031241 170 28086 1013876852 11005002152861474932 0.35319167 0.055736622134 MeSTAXq8gVxVjbEjgkvU9YLte0X9uE +a 5 36 -16974 623103518 6834444206535996609 71 29458 141047417 17448660630302620693 0.17100024 0.044290730921 OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh +b 1 12 7652 -1448995523 -5332734971209541785 136 49283 4076864659 15449267433866484283 0.6214579 0.05636955102 akiiY5N0I44CMwEnBL6RTBk7BRkxEj +b 1 29 -18218 994303988 5983957848665088916 204 9489 3275293996 14857091259186476033 0.53840446 0.179090351188 AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz +b 1 54 -18410 1413111008 -7145106120930085900 249 5382 1842680163 17818611040257178339 0.8881188 0.248997943147 6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ +b 2 -60 -21739 -1908480893 -8897292622858103761 59 50009 2525744318 1719090662556698549 0.52930677 0.560333188635 l7uwDoTepWwnAP0ufqtHJS3CRi7RfP +b 2 31 23127 -800561771 -8706387435232961848 153 27034 1098639440 3343692635488765507 0.35692692 0.559020554835 okOkcWflkNXIy4R8LzmySyY1EC3sYd +b 2 63 21456 -2138770630 -2380041687053733364 181 57594 2705709344 13144161537396946288 0.09683716 0.305136408881 nYVJnVicpGRqKZibHyBAmtmzBXAFfT +b 2 68 15874 49866617 1179733259727844435 121 23948 3455216719 3898128009708892708 0.6306253 0.918581397074 802bgTGl6Bk5TlkPYYTxp5JkKyaYUA +b 3 -101 -13217 -346989627 5456800329302529236 26 54276 243203849 17929716297117857676 0.05422181 0.094656351238 MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ +b 3 17 14457 670497898 -2390782464845307388 255 24770 1538863055 12662506238151717757 0.34077626 0.76143041007 6x93sxYioWuq5c9Kkk8oTAAORM7cH0 +b 4 -117 19316 2051224722 -5534418579506232438 133 52046 3023531799 13684453606722360110 0.62608826 0.850672105305 mhjME0zBHbrK6NMkytMTQzOssOa1gF +b 4 -111 -1967 -4229382 1892872227362838079 67 9832 1243785310 8382489916947120498 0.06563997 0.152498292972 Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH +b 4 -59 25286 1423957796 2646602445954944051 0 61069 3570297463 15100310750150419896 0.49619365 0.04893135682 fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG +b 4 17 -28070 -673237643 1904316899655860234 188 27744 933879086 3732692885824435932 0.41860116 0.403422831978 JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ +b 4 47 20690 -1009656194 -2027442591571700798 200 7781 326151275 2881913079548128905 0.57360977 0.214523264739 52mKlRE3aHCBZtjECq6sY9OqVf8Dze +b 5 -82 22080 1824882165 7373730676428214987 208 34331 3342719438 3330177516592499461 0.82634634 0.409753835253 Ig1QcuKsjHXkproePdERo2w0mYzIqd +b 5 -44 15788 -629486480 5822642169425315613 13 11872 3457053821 2413406423648025909 0.44318348 0.328693746871 ALuRhobVWbnQTTWZdSOk0iVe8oYFhW +b 5 -5 24896 1955646088 2430204191283109071 118 43655 2424630722 11429640193932435507 0.87989986 0.732805004129 JafwVLSVk5AVoXFuzclesQ000EE2k1 +b 5 62 16337 41423756 -2274773899098124524 121 34206 2307004493 10575647935385523483 0.23794776 0.175426158671 qnPOOmslCJaT45buUisMRnM0rc77EK +b 5 68 21576 1188285940 5717755781990389024 224 27600 974297360 9865419128970328044 0.80895734 0.7973920073 ioEncce3mPOXD2hWhpZpCPWGATG6GU +c 1 -24 -24085 -1882293856 7385529783747709716 41 48048 520189543 2402288956117186783 0.39761502 0.360076636233 Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u +c 1 41 -4667 -644225469 7049620391314639084 196 48099 2125812933 15419512479294091215 0.5780736 0.925503134643 mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS +c 1 70 27752 1325868318 1241882478563331892 63 61637 473294098 4976799313755010034 0.13801557 0.508176556344 Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn +c 1 103 -22186 431378678 1346564663822463162 146 12393 3766999078 10901819591635583995 0.064453244 0.77849189835 2T3wSlHdEmASmO0xcXHnndkKEt6bz8 +c 2 -117 -30187 -1222533990 -191957437217035800 136 47061 2293105904 12659011877190539078 0.2047385 0.970671228336 pLk3i59bZwd5KBZrI1FiweYTd5hteG +c 2 -107 -2904 -1011669561 782342092880993439 18 29527 1157161427 4403623840168496677 0.31988364 0.369363046006 QYlaIAnJA6r8rlAb6f59wcxvcPcWFf +c 2 -106 -1114 -1927628110 1080308211931669384 177 20421 141680161 7464432081248293405 0.56749094 0.56535284223 Vp3gmWunM5A7wOC9YW2JroFqTWjvTi +c 2 -60 -16312 -1808210365 -3368300253197863813 71 39635 2844041986 7045482583778080653 0.805363 0.642569411521 BJqx5WokrmrrezZA0dUbleMYkG5U2O +c 2 -29 25305 -537142430 -7683452043175617798 150 31648 598822671 11759014161799384683 0.8315913 0.946325164889 9UbObCsVkmYpJGcGrgfK90qOnwb2Lj +c 2 1 18109 2033001162 -6513304855495910254 25 43062 1491205016 5863949479783605708 0.110830784 0.929409733247 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW +c 2 29 -3855 1354539333 4742062657200940467 81 53815 3398507249 562977550464243101 0.7124534 0.991517828651 Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0 +c 3 -2 -18655 -2141999138 -3154042970870838072 251 34970 3862393166 13062025193350212516 0.034291923 0.769775338342 IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr +c 3 22 13741 -2098805236 8604102724776612452 45 2516 1362369177 196777795886465166 0.94669616 0.049492446547 6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE +c 3 73 -9565 -382483011 1765659477910680019 186 1535 1088543984 2906943497598597237 0.680652 0.600947554473 Ow5PGpfTm4dXCfTDsXAOTatXRoAydR +c 3 97 29106 -903316089 2874859437662206732 207 42171 3473924576 8188072741116415408 0.32792538 0.266717779508 HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g +c 4 -90 -2935 1579876740 6733733506744649678 254 12876 3593959807 4094315663314091142 0.5708688 0.560306236816 Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV +c 4 -79 5281 -237425046 373011991904079451 121 55620 2818832252 2464584078983135763 0.49774808 0.923787797819 t6fQUjJejPcjc04wHvHTPe55S65B4V +c 4 3 -30508 659422734 -6455460736227846736 133 59663 2306130875 8622584762448622224 0.16999894 0.427312331893 EcCuckwsF3gV1Ecgmh5v4KM8g1ozif +c 4 123 16620 852509237 -3087630526856906991 196 33715 3566741189 4546434653720168472 0.07606989 0.81971586508 8LIh0b6jmDGm87BmIyjdxNIpX4ugjD +c 5 -94 -15880 2025611582 -3348824099853919681 5 40622 4268716378 12849419495718510869 0.34163946 0.483087855944 RilTlL1tKkPOUFuzmLydHAVZwv1OGl +c 5 118 19208 -134213907 -2120241105523909127 86 57751 1229567292 16493024289408725403 0.5536642 0.97235803965 TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX +d 1 -99 5613 1213926989 -8863698443222021480 19 18736 4216440507 14933742247195536130 0.6067944 0.336395906593 aDxBtor7Icd9C5hnTvvw5NrIre740e +d 1 -98 13630 -1991133944 1184110014998006843 220 2986 225513085 9634106610243643486 0.89651865 0.164088254508 y7C453hRWd4E7ImjNDWlpexB8nUqjh +d 1 -72 25590 1188089983 3090286296481837049 241 832 3542840110 5885937420286765261 0.41980565 0.215354023438 wwXqSGKLyBQyPkonlzBNYUJTCo4LRS +d 1 -8 27138 -1383162419 7682021027078563072 36 64517 2861376515 9904216782086286050 0.80954456 0.946309824388 AFGCj7OWlEB5QfniEFgonMq90Tq5uH +d 1 38 18384 -335410409 -1632237090406591229 26 57510 2712615025 1842662804748246269 0.6064476 0.640449509335 4HX6feIvmNXBN7XGqgO4YVBkhu8GDI +d 1 57 28781 -1143802338 2662536767954229885 202 62167 879082834 4338034436871150616 0.7618384 0.429505217308 VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4 +d 1 125 31106 -1176490478 -4306856842351827308 90 17910 3625286410 17869394731126786457 0.8882508 0.763123907005 dVdvo6nUD5FgCgsbOZLds28RyGTpnx +d 2 93 -12642 2053379412 6468763445799074329 147 50842 1000948272 5536487915963301239 0.4279275 0.285344285787 lqhzgLsXZ8JhtpeeUWWNbMz8PHI705 +d 2 113 3917 -108973366 -7220140168410319165 197 24380 63044568 4225581724448081782 0.11867094 0.294415861805 90gAtmGEeIqUTbo1ZrxCvWtsseukXC +d 2 122 10130 -168758331 -3179091803916845592 30 794 4061635107 15695681119022625322 0.69592506 0.974836050902 OPwBqCEK5PWTjWaiOyL45u2NLTaDWv +d 3 -76 8809 141218956 -9110406195556445909 58 5494 1824517658 12046662515387914426 0.8557294 0.666842389741 Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK +d 3 77 15091 -1302295658 8795481303066536947 154 35477 2093538928 17419098323248948387 0.11952883 0.703563528317 O66j6PaYuZhEUtqV6fuU7TyjM2WxC5 +d 3 123 29533 240273900 1176001466590906949 117 30972 2592330556 12883447461717956514 0.39075065 0.38870280984 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO +d 4 5 -7688 702611616 6239356364381313700 4 39363 3126475872 35363005357834672 0.3766935 0.061029375346 H5j5ZHy1FGesOAHjkQEDYCucbpKWRu +d 4 55 -1471 1902023838 1252101628560265705 157 3691 811650497 1524771507450695976 0.2968701 0.543759554042 f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX +d 4 102 -24558 1991172974 -7823479531661596016 14 36599 1534194097 2240998421986827216 0.028003037 0.88248794476 0og6hSkhbX8AC1ktFS4kounvTzy8Vo +d 5 -59 2045 -2117946883 1170799768349713170 189 63353 1365198901 2501626630745849169 0.75173044 0.186288592659 F7NSTjWvQJyBburN7CXRUlbgp2dIrA +d 5 -40 22614 706441268 -7542719935673075327 155 14337 3373581039 11720144131976083864 0.69632107 0.311471253986 C2GT5KVyOPZpgKVl110TyZO0NcJ434 +e 1 36 -21481 -928766616 -3471238138418013024 150 52569 2610290479 7788847578701297242 0.2578469 0.767002178615 gpo8K5qtYePve6jyPt6xgJx4YOVjms +e 1 71 -5479 -1339586153 -3920238763788954243 123 53012 4229654142 10297218950720052365 0.73473036 0.577349821706 cBGc0kSm32ylBDnxogG727C0uhZEYZ +e 1 120 10837 -1331533190 6342019705133850847 245 3975 2830981072 16439861276703750332 0.6623719 0.996540038759 LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW +e 2 -61 -2888 -1660426473 2553892468492435401 126 35429 4144173353 939909697866979632 0.4405142 0.923188989694 BPtQMxnuSPpxMExYV9YkDa6cAN7GP3 +e 2 49 24495 -587831330 9178511478067509438 129 12757 1289293657 10948666249269100825 0.5610077 0.59911381151 bgK1r6v3BCTh0aejJUhkA1Hn6idXGp +e 2 52 -12056 -1090239422 9011500141803970147 238 4168 2013662838 12565360638488684051 0.6694766 0.391444365692 xipQ93429ksjNcXPX5326VSg1xJZcW +e 2 52 23388 715235348 605432070100399212 165 56980 3314983189 7386391799827871203 0.46076488 0.98080963127 jQimhdepw3GKmioWUlVSWeBVRKFkY3 +e 2 97 18167 1593800404 -9112448817105133638 163 45185 3188005828 2792105417953811674 0.38175434 0.409421835359 ukOiFGGFnQJDHFgZxHMpvhD3zybF0M +e 3 -95 13611 2030965207 927403809957470678 119 59134 559847112 10966649192992996919 0.5301289 0.047343434291 gTpyQnEODMcpsPnJMZC66gh33i3m0b +e 3 71 194 1436496767 -5639533800082367925 158 44507 3105312559 3998472996619161534 0.930117 0.610893830753 pTeu0WMjBRTaNRT15rLCuEh3tBJVc5 +e 3 104 -25136 1738331255 300633854973581194 139 20807 3577318119 13079037564113702254 0.40154034 0.776436099031 DuJNG8tufSqW0ZstHqWj3aGvFLMg4A +e 3 112 -6823 -421042466 8535335158538929274 129 32712 3759340273 9916295859593918600 0.6424343 0.631656529655 BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE +e 4 -56 -31500 1544188174 3096047390018154410 220 417 557517119 2774306934041974261 0.15459597 0.191132935833 IZTkHMLvIKuiLjhDjYMmIHxh166we4 +e 4 -53 13788 2064155045 -691093532952651300 243 35106 2778168728 9463973906560740422 0.34515214 0.271591905165 0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm +e 4 30 -16110 61035129 -3356533792537910152 159 299 28774375 13526465947516666293 0.6999775 0.039683470858 cq4WSAIFwx3wwTUS5bp1wCe71R6U5I +e 4 73 -22501 1282464673 2541794052864382235 67 21119 538589788 9575476605699527641 0.48515016 0.296036538665 4JznSdBajNWhu4hRQwjV1FjTTxY68i +e 4 74 -12612 -1885422396 1702850374057819332 130 3583 3198969145 10767179755613315144 0.5518061 0.561450375462 QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv +e 4 96 -30336 427197269 7506304308750926996 95 48483 3521368277 5437030162957481122 0.58104324 0.420731253319 3BEOHQsMEFZ58VcNTOJYShTBpAPzbt +e 4 97 -13181 2047637360 6176835796788944083 158 53000 2042457019 9726016502640071617 0.7085086 0.123575399884 oHJMNvWuunsIMIWFnYG31RCfkOo2V7 +e 5 -86 32514 -467659022 -8012578250188146150 254 2684 2861911482 2126626171973341689 0.12559289 0.014793053078 gxfHWUF8XgY2KdFxigxvNEXe2V2XMl +e 5 64 -26526 1689098844 8950618259486183091 224 45253 662099130 16127995415060805595 0.2897315 0.575945048386 56MZa5O1hVtX4c5sbnCfxuX5kDChqI diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt index d1436f167443..c47b0cd9fe6b 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt +++ b/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt @@ -15,15 +15,10 @@ # specific language governing permissions and limitations # under the License. -# values without casting -# postgres -# 1 2.0 -3 2 -# 10 20.0 -30 4 -# datafusion: -# 1 2 -3 2 -# 10 20 -30 4 - query IRII SELECT * FROM -(VALUES (1,2.0::real,-3,1+1),(10,20.0::real,-30,2+2)) +(VALUES (1,2.0,-3,1+1),(10,20.0,-30,2+2)) AS tbl(int_col, float_col, negative_col, summation); +---- +1 2 -3 2 +10 20 -30 4 diff --git a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs index 513ba8caa84e..7d5c9be20fca 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs @@ -5,6 +5,8 @@ use sqlparser::ast::DataType::Dec; use rust_decimal::prelude::*; use bigdecimal::BigDecimal; +pub const NULL_STR: &str = "NULL"; + pub fn bool_to_str(value: bool) -> String { if value { "true".to_string() @@ -66,5 +68,5 @@ pub fn decimal_to_str(value: Decimal) -> String { } pub fn big_decimal_to_str(value: BigDecimal) -> String { - value.round(20).normalized().to_string() + value.round(12).normalized().to_string() } diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs index 4acdcae7639e..317548b47fcb 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs @@ -34,11 +34,12 @@ mod normalize; pub struct DataFusion { ctx: SessionContext, file_name: String, + postgres_compatible: bool } impl DataFusion { - pub fn new(ctx: SessionContext, file_name: String) -> Self { - Self { ctx, file_name } + pub fn new(ctx: SessionContext, file_name: String, postgres_compatible: bool) -> Self { + Self { ctx, file_name, postgres_compatible } } } @@ -48,7 +49,7 @@ impl sqllogictest::AsyncDB for DataFusion { async fn run(&mut self, sql: &str) -> Result { println!("[{}] Running query: \"{}\"", self.file_name, sql); - let result = run_query(&self.ctx, sql).await?; + let result = run_query(&self.ctx, sql, self.postgres_compatible).await?; Ok(result) } @@ -67,7 +68,7 @@ impl sqllogictest::AsyncDB for DataFusion { } } -async fn run_query(ctx: &SessionContext, sql: impl Into) -> Result { +async fn run_query(ctx: &SessionContext, sql: impl Into, postgres_compatible: bool) -> Result { let sql = sql.into(); // Check if the sql is `insert` if let Ok(mut statements) = DFParser::parse_sql(&sql) { @@ -81,6 +82,6 @@ async fn run_query(ctx: &SessionContext, sql: impl Into) -> Result = df.collect().await?; - let formatted_batches = normalize::convert_batches(results)?; + let formatted_batches = normalize::convert_batches(results, postgres_compatible)?; Ok(formatted_batches) } diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs index 7e68abc89acc..2a0a9d610682 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs @@ -16,6 +16,7 @@ // under the License. use arrow::{array, array::ArrayRef, datatypes::DataType, record_batch::RecordBatch}; +use arrow::error::ArrowError; use sqllogictest::{ColumnType, DBOutput}; use datafusion::error::DataFusionError; @@ -26,7 +27,7 @@ use super::error::{DFSqlLogicTestError, Result}; /// /// Assumes empty record batches are a successful statement completion /// -pub fn convert_batches(batches: Vec) -> Result { +pub fn convert_batches(batches: Vec, postgres_compatible: bool) -> Result { if batches.is_empty() { // DataFusion doesn't report number of rows complete return Ok(DBOutput::StatementComplete(0)); @@ -50,20 +51,20 @@ pub fn convert_batches(batches: Vec) -> Result { ), ))); } - rows.append(&mut convert_batch(batch)?); + rows.append(&mut convert_batch(batch, postgres_compatible)?); } Ok(DBOutput::Rows { types, rows }) } /// Convert a single batch to a `Vec>` for comparison -fn convert_batch(batch: RecordBatch) -> Result>> { +fn convert_batch(batch: RecordBatch, postgres_compatible: bool) -> Result>> { (0..batch.num_rows()) .map(|row| { batch .columns() .iter() - .map(|col| cell_to_string(col, row)) + .map(|col| cell_to_string(col, row, postgres_compatible)) .collect::>>() }) .collect() @@ -100,25 +101,37 @@ macro_rules! get_string_value { /// /// Floating numbers are rounded to have a consistent representation with the Postgres runner. /// -pub fn cell_to_string(col: &ArrayRef, row: usize) -> Result { - f64::max; +pub fn cell_to_string(col: &ArrayRef, row: usize, postgres_compatible: bool) -> Result { if !col.is_valid(row) { // represent any null value with the string "NULL" - Ok("NULL".to_string()) + Ok(NULL_STR.to_string()) } else { - match col.data_type() { - DataType::Boolean => Ok(bool_to_str(get_row_value!(array::BooleanArray, col, row))), - DataType::Float16 => Ok(f16_to_str(get_row_value!(array::Float16Array, col, row))), - DataType::Float32 => Ok(f32_to_str(get_row_value!(array::Float32Array, col, row))), - DataType::Float64 => Ok(f64_to_str(get_row_value!(array::Float64Array, col, row))), - DataType::Decimal128(_, scale) => { - let value = get_row_value!(array::Decimal128Array, col, row); - let decimal_scale = u32::try_from((*scale).max(0)).unwrap(); - Ok(i128_to_str(value, decimal_scale)) - } - DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(array::LargeStringArray, col, row))), - DataType::Utf8 => Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))), - _ => arrow::util::display::array_value_to_string(col, row) - }.map_err(DFSqlLogicTestError::Arrow) + if postgres_compatible { + postgres_compatible_cell_to_string(col, row) + } else { + match col.data_type() { + DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(array::LargeStringArray, col, row))), + DataType::Utf8 => Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))), + _ => arrow::util::display::array_value_to_string(col, row) + }.map_err(DFSqlLogicTestError::Arrow) + } } } + +/// Convert values to text representation that are the same as in Postgres client implementation. +fn postgres_compatible_cell_to_string(col: &ArrayRef, row: usize) -> Result { + match col.data_type() { + DataType::Boolean => Ok(bool_to_str(get_row_value!(array::BooleanArray, col, row))), + DataType::Float16 => Ok(f16_to_str(get_row_value!(array::Float16Array, col, row))), + DataType::Float32 => Ok(f32_to_str(get_row_value!(array::Float32Array, col, row))), + DataType::Float64 => Ok(f64_to_str(get_row_value!(array::Float64Array, col, row))), + DataType::Decimal128(_, scale) => { + let value = get_row_value!(array::Decimal128Array, col, row); + let decimal_scale = u32::try_from((*scale).max(0)).unwrap(); + Ok(i128_to_str(value, decimal_scale)) + } + DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(array::LargeStringArray, col, row))), + DataType::Utf8 => Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))), + _ => arrow::util::display::array_value_to_string(col, row) + }.map_err(DFSqlLogicTestError::Arrow) +} diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs index 344effc3ef24..93063c57c983 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -100,20 +100,21 @@ macro_rules! make_string { let value:Option<$t> = $row.get($idx); match value { Some(value) => value.to_string(), - None => "NULL".to_string() + None => NULL_STR.to_string() } }}; ($row:ident, $idx:ident, $t:ty, $convert:ident) => {{ let value: Option<$t> = $row.get($idx); match value { Some(value) => $convert(value).to_string(), - None => "NULL".to_string() + None => NULL_STR.to_string() } }}; } fn cell_to_string(row: &Row, column: &Column, idx: usize) -> String { match column.type_().clone() { + Type::CHAR => make_string!(row, idx, i8), Type::INT2 => make_string!(row, idx, i16), Type::INT4 => make_string!(row, idx, i32), Type::INT8 => make_string!(row, idx, i64), diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index c20102a7acf5..b8691020d2be 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -74,7 +74,7 @@ pub async fn main() -> Result<(), Box> { async fn run_test_file(path: &PathBuf, file_name: String) -> Result<(), Box> { println!("Running: {}", path.display()); let ctx = context_for_test_file(&file_name).await; - let mut runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); + let mut runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, false)); runner.run_file_async(path).await?; Ok(()) } @@ -96,20 +96,16 @@ async fn run_postgres_test_file( PG_USER, PG_PASSWORD, ) - .await?; - let mut postgres_runner = sqllogictest::Runner::new(postgres_client); + .await?; + let postgres_runner = sqllogictest::Runner::new(postgres_client); - // let temp_dir = tempdir()?; - // let copy_path = temp_dir.path().join(&file_name); + update_test_file(&path, postgres_runner, " ", default_validator).await?; - // copy(path, ©_path)?; - // update_test_file(&path, postgres_runner, " ", default_validator).await?; + let ctx = SessionContext::new(); + setup::register_aggregate_csv_by_sql(&ctx).await; + let mut df_runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, true)); - // let ctx = SessionContext::new(); - // setup::register_aggregate_csv_by_sql(&ctx).await; - // let mut df_runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); - - postgres_runner.run_file_async(path).await?; + df_runner.run_file_async(path).await?; Ok(()) } @@ -122,7 +118,7 @@ async fn run_complete_file( info!("Using complete mode to complete: {}", path.display()); let ctx = context_for_test_file(&file_name).await; - let runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name)); + let runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, true)); let col_separator = " "; let validator = default_validator; diff --git a/datafusion/core/tests/sqllogictests/src/setup.rs b/datafusion/core/tests/sqllogictests/src/setup.rs index 1c82e28e96dc..af62932577d0 100644 --- a/datafusion/core/tests/sqllogictests/src/setup.rs +++ b/datafusion/core/tests/sqllogictests/src/setup.rs @@ -126,8 +126,8 @@ pub async fn register_aggregate_csv_by_sql(ctx: &SessionContext) { c6 BIGINT NOT NULL, c7 SMALLINT NOT NULL, c8 INT NOT NULL, - c9 INT UNSIGNED NOT NULL, - c10 BIGINT UNSIGNED NOT NULL, + c9 BIGINT UNSIGNED NOT NULL, + c10 VARCHAR NOT NULL, c11 FLOAT NOT NULL, c12 DOUBLE NOT NULL, c13 VARCHAR NOT NULL From 1a78bc612dbf091cf3ba8cee3c0b2149d02e5225 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 21:14:07 +0100 Subject: [PATCH 09/19] Run Postgres separately from DataFusion. Merge slt files --- datafusion/core/tests/sqllogictests/README.md | 2 +- .../postgres/test_files/character_length.slt | 21 - .../partitioned_window_built_in_functions.slt | 132 -- .../test_files/self_join_with_alias.slt | 125 -- .../test_files/simple_aggregation.slt | 28 - .../postgres/test_files/simple_except.slt | 31 - .../postgres/test_files/simple_group_by.slt | 34 - .../postgres/test_files/simple_intersect.slt | 30 - .../test_files/simple_intersect_all.slt | 70 - .../test_files/simple_math_expressions.slt | 26 - .../test_files/simple_ordered_row.slt | 129 -- .../test_files/simple_row_past_future.slt | 127 -- .../postgres/test_files/simple_select.slt | 21 - .../postgres/test_files/simple_sort.slt | 125 -- .../test_files/simple_sort_nulls_order.slt | 125 -- .../postgres/test_files/simple_union_all.slt | 22 - .../simple_window_built_in_functions.slt | 132 -- .../simple_window_full_aggregation.slt | 128 -- .../test_files/simple_window_groups.slt | 174 -- .../simple_window_lead_built_in_functions.slt | 129 -- .../simple_window_ordered_aggregation.slt | 129 -- .../simple_window_partition_aggregation.slt | 129 -- ...ple_window_partition_order_aggregation.slt | 129 -- .../test_files/simple_window_range.slt | 132 -- ...imple_window_ranked_built_in_functions.slt | 127 -- .../postgres/test_files/values_list.slt | 24 - .../sqllogictests/src/engines/conversion.rs | 2 - .../src/engines/datafusion/mod.rs | 10 +- .../src/engines/datafusion/normalize.rs | 26 +- .../sqllogictests/src/engines/postgres/mod.rs | 30 +- .../core/tests/sqllogictests/src/main.rs | 101 +- .../sqllogictests/test_files/aggregate.slt | 4 +- .../pg_compat_simple.slt} | 395 +++++ .../pg_compat_types.slt} | 18 + .../pg_compat_union.slt} | 93 ++ .../test_files/pg_compat_window.slt | 1433 +++++++++++++++++ 36 files changed, 2024 insertions(+), 2369 deletions(-) delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt delete mode 100644 datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt rename datafusion/core/tests/sqllogictests/{postgres/test_files/test_data.slt => test_files/pg_compat_simple.slt} (63%) rename datafusion/core/tests/sqllogictests/{postgres/test_files/type_representation.slt => test_files/pg_compat_types.slt} (63%) rename datafusion/core/tests/sqllogictests/{postgres/test_files/simple_except_all.slt => test_files/pg_compat_union.slt} (59%) create mode 100644 datafusion/core/tests/sqllogictests/test_files/pg_compat_window.slt diff --git a/datafusion/core/tests/sqllogictests/README.md b/datafusion/core/tests/sqllogictests/README.md index f853ad258731..f46ff13724be 100644 --- a/datafusion/core/tests/sqllogictests/README.md +++ b/datafusion/core/tests/sqllogictests/README.md @@ -49,7 +49,7 @@ cargo test -p datafusion --test sqllogictests -- information In this mode, `sqllogictests` runs the statements and queries in a `.slt` file, comparing outputs of postgres and datafusion. ``` -cargo test -p datafusion --test sqllogictests -- --postgres +PG_COMPAT=true cargo test -p datafusion --test sqllogictests ``` #### Updating tests: Completion Mode diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt deleted file mode 100644 index e3846b4aca20..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/character_length.slt +++ /dev/null @@ -1,21 +0,0 @@ -# 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. - -query I -select length('ä'); ----- -2 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt deleted file mode 100644 index 4bd488e8906d..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/partitioned_window_built_in_functions.slt +++ /dev/null @@ -1,132 +0,0 @@ -# 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. - -query IIIIIIIIII -SELECT - c9, - row_number() OVER (PARTITION BY c2 ORDER BY c9) row_num, - lead(c9) OVER (PARTITION BY c2 ORDER BY c9) lead_c9, - lag(c9) OVER (PARTITION BY c2 ORDER BY c9) lag_c9, - first_value(c9) OVER (PARTITION BY c2 ORDER BY c9) first_c9, - first_value(c9) OVER (PARTITION BY c2 ORDER BY c9 DESC) first_c9_desc, - last_value(c9) OVER (PARTITION BY c2 ORDER BY c9) last_c9, - last_value(c9) OVER (PARTITION BY c2 ORDER BY c9 DESC) last_c9_desc, - nth_value(c9, 2) OVER (PARTITION BY c2 ORDER BY c9) second_c9, - nth_value(c9, 2) OVER (PARTITION BY c2 ORDER BY c9 DESC) second_c9_desc -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- -28774375 1 326151275 NULL 28774375 3593959807 28774375 28774375 NULL 3570297463 -63044568 1 141680161 NULL 63044568 4144173353 63044568 63044568 NULL 4061635107 -141047417 1 662099130 NULL 141047417 4268716378 141047417 141047417 NULL 3457053821 -141680161 2 145294611 63044568 63044568 4144173353 141680161 141680161 141680161 4061635107 -145294611 3 598822671 141680161 63044568 4144173353 145294611 145294611 141680161 4061635107 -225513085 1 473294098 NULL 225513085 4229654142 225513085 225513085 NULL 4216440507 -243203849 1 431948861 NULL 243203849 3998790955 243203849 243203849 NULL 3959216334 -326151275 2 466439833 28774375 28774375 3593959807 326151275 326151275 326151275 3570297463 -431948861 2 559847112 243203849 243203849 3998790955 431948861 431948861 431948861 3959216334 -466439833 3 538589788 326151275 28774375 3593959807 466439833 466439833 326151275 3570297463 -473294098 2 520189543 225513085 225513085 4229654142 473294098 473294098 473294098 4216440507 -520189543 3 774637006 473294098 225513085 4229654142 520189543 520189543 473294098 4216440507 -538589788 4 557517119 466439833 28774375 3593959807 538589788 538589788 326151275 3570297463 -557517119 5 811650497 538589788 28774375 3593959807 557517119 557517119 326151275 3570297463 -559847112 3 754775609 431948861 243203849 3998790955 559847112 559847112 431948861 3959216334 -598822671 4 1000948272 145294611 63044568 4144173353 598822671 598822671 141680161 4061635107 -662099130 2 974297360 141047417 141047417 4268716378 662099130 662099130 662099130 3457053821 -754775609 4 1088543984 559847112 243203849 3998790955 754775609 754775609 431948861 3959216334 -774637006 4 879082834 520189543 225513085 4229654142 774637006 774637006 473294098 4216440507 -811650497 6 933879086 557517119 28774375 3593959807 811650497 811650497 326151275 3570297463 -879082834 5 1454057357 774637006 225513085 4229654142 879082834 879082834 473294098 4216440507 -933879086 7 1243785310 811650497 28774375 3593959807 933879086 933879086 326151275 3570297463 -974297360 3 1013876852 662099130 141047417 4268716378 974297360 974297360 662099130 3457053821 -1000948272 5 1098639440 598822671 63044568 4144173353 1000948272 1000948272 141680161 4061635107 -1013876852 4 1229567292 974297360 141047417 4268716378 1013876852 1013876852 662099130 3457053821 -1088543984 5 1362369177 754775609 243203849 3998790955 1088543984 1088543984 431948861 3959216334 -1098639440 6 1157161427 1000948272 63044568 4144173353 1098639440 1098639440 141680161 4061635107 -1157161427 7 1289293657 1098639440 63044568 4144173353 1157161427 1157161427 141680161 4061635107 -1229567292 5 1365198901 1013876852 141047417 4268716378 1229567292 1229567292 662099130 3457053821 -1243785310 8 1534194097 933879086 28774375 3593959807 1243785310 1243785310 326151275 3570297463 -1289293657 8 1491205016 1157161427 63044568 4144173353 1289293657 1289293657 141680161 4061635107 -1362369177 6 1538863055 1088543984 243203849 3998790955 1362369177 1362369177 431948861 3959216334 -1365198901 6 2307004493 1229567292 141047417 4268716378 1365198901 1365198901 662099130 3457053821 -1454057357 6 1842680163 879082834 225513085 4229654142 1454057357 1454057357 473294098 4216440507 -1491205016 9 2013662838 1289293657 63044568 4144173353 1491205016 1491205016 141680161 4061635107 -1534194097 9 1787652631 1243785310 28774375 3593959807 1534194097 1534194097 326151275 3570297463 -1538863055 7 1824517658 1362369177 243203849 3998790955 1538863055 1538863055 431948861 3959216334 -1787652631 10 1865307672 1534194097 28774375 3593959807 1787652631 1787652631 326151275 3570297463 -1824517658 8 1995343206 1538863055 243203849 3998790955 1824517658 1824517658 431948861 3959216334 -1842680163 7 2125812933 1454057357 225513085 4229654142 1842680163 1842680163 473294098 4216440507 -1865307672 11 2042457019 1787652631 28774375 3593959807 1865307672 1865307672 326151275 3570297463 -1995343206 9 2093538928 1824517658 243203849 3998790955 1995343206 1995343206 431948861 3959216334 -2013662838 10 2293105904 1491205016 63044568 4144173353 2013662838 2013662838 141680161 4061635107 -2042457019 12 2306130875 1865307672 28774375 3593959807 2042457019 2042457019 326151275 3570297463 -2093538928 10 2214035726 1995343206 243203849 3998790955 2093538928 2093538928 431948861 3959216334 -2125812933 8 2610290479 1842680163 225513085 4229654142 2125812933 2125812933 473294098 4216440507 -2214035726 11 2592330556 2093538928 243203849 3998790955 2214035726 2214035726 431948861 3959216334 -2293105904 11 2525744318 2013662838 63044568 4144173353 2293105904 2293105904 141680161 4061635107 -2306130875 13 2502326480 2042457019 28774375 3593959807 2306130875 2306130875 326151275 3570297463 -2307004493 7 2424630722 1365198901 141047417 4268716378 2307004493 2307004493 662099130 3457053821 -2424630722 8 2496054700 2307004493 141047417 4268716378 2424630722 2424630722 662099130 3457053821 -2496054700 9 2861911482 2424630722 141047417 4268716378 2496054700 2496054700 662099130 3457053821 -2502326480 14 2778168728 2306130875 28774375 3593959807 2502326480 2502326480 326151275 3570297463 -2525744318 12 2705709344 2293105904 63044568 4144173353 2525744318 2525744318 141680161 4061635107 -2592330556 12 3105312559 2214035726 243203849 3998790955 2592330556 2592330556 431948861 3959216334 -2610290479 9 2669374863 2125812933 225513085 4229654142 2610290479 2610290479 473294098 4216440507 -2669374863 10 2712615025 2610290479 225513085 4229654142 2669374863 2669374863 473294098 4216440507 -2705709344 13 2844041986 2525744318 63044568 4144173353 2705709344 2705709344 141680161 4061635107 -2712615025 11 2830981072 2669374863 225513085 4229654142 2712615025 2712615025 473294098 4216440507 -2778168728 15 2818832252 2502326480 28774375 3593959807 2778168728 2778168728 326151275 3570297463 -2818832252 16 3023531799 2778168728 28774375 3593959807 2818832252 2818832252 326151275 3570297463 -2830981072 12 2861376515 2712615025 225513085 4229654142 2830981072 2830981072 473294098 4216440507 -2844041986 14 2939920218 2705709344 63044568 4144173353 2844041986 2844041986 141680161 4061635107 -2861376515 13 3275293996 2830981072 225513085 4229654142 2861376515 2861376515 473294098 4216440507 -2861911482 10 3342719438 2496054700 141047417 4268716378 2861911482 2861911482 662099130 3457053821 -2939920218 15 3188005828 2844041986 63044568 4144173353 2939920218 2939920218 141680161 4061635107 -3023531799 17 3126475872 2818832252 28774375 3593959807 3023531799 3023531799 326151275 3570297463 -3105312559 13 3473924576 2592330556 243203849 3998790955 3105312559 3105312559 431948861 3959216334 -3126475872 18 3198969145 3023531799 28774375 3593959807 3126475872 3126475872 326151275 3570297463 -3188005828 16 3314983189 2939920218 63044568 4144173353 3188005828 3188005828 141680161 4061635107 -3198969145 19 3521368277 3126475872 28774375 3593959807 3198969145 3198969145 326151275 3570297463 -3275293996 14 3276123488 2861376515 225513085 4229654142 3275293996 3275293996 473294098 4216440507 -3276123488 15 3542840110 3275293996 225513085 4229654142 3276123488 3276123488 473294098 4216440507 -3314983189 17 3398507249 3188005828 63044568 4144173353 3314983189 3314983189 141680161 4061635107 -3342719438 11 3373581039 2861911482 141047417 4268716378 3342719438 3342719438 662099130 3457053821 -3373581039 12 3457053821 3342719438 141047417 4268716378 3373581039 3373581039 662099130 3457053821 -3398507249 18 3455216719 3314983189 63044568 4144173353 3398507249 3398507249 141680161 4061635107 -3455216719 19 3717551163 3398507249 63044568 4144173353 3455216719 3455216719 141680161 4061635107 -3457053821 13 4268716378 3373581039 141047417 4268716378 3457053821 3457053821 662099130 3457053821 -3473924576 14 3577318119 3105312559 243203849 3998790955 3473924576 3473924576 431948861 3959216334 -3521368277 20 3566741189 3198969145 28774375 3593959807 3521368277 3521368277 326151275 3570297463 -3542840110 16 3625286410 3276123488 225513085 4229654142 3542840110 3542840110 473294098 4216440507 -3566741189 21 3570297463 3521368277 28774375 3593959807 3566741189 3566741189 326151275 3570297463 -3570297463 22 3593959807 3566741189 28774375 3593959807 3570297463 3570297463 326151275 3570297463 -3577318119 15 3759340273 3473924576 243203849 3998790955 3577318119 3577318119 431948861 3959216334 -3593959807 23 NULL 3570297463 28774375 3593959807 3593959807 3593959807 326151275 NULL -3625286410 17 3766999078 3542840110 225513085 4229654142 3625286410 3625286410 473294098 4216440507 -3717551163 20 4061635107 3455216719 63044568 4144173353 3717551163 3717551163 141680161 4061635107 -3759340273 16 3862393166 3577318119 243203849 3998790955 3759340273 3759340273 431948861 3959216334 -3766999078 18 4015442341 3625286410 225513085 4229654142 3766999078 3766999078 473294098 4216440507 -3862393166 17 3959216334 3759340273 243203849 3998790955 3862393166 3862393166 431948861 3959216334 -3959216334 18 3998790955 3862393166 243203849 3998790955 3959216334 3959216334 431948861 3959216334 -3998790955 19 NULL 3959216334 243203849 3998790955 3998790955 3998790955 431948861 NULL -4015442341 19 4076864659 3766999078 225513085 4229654142 4015442341 4015442341 473294098 4216440507 -4061635107 21 4144173353 3717551163 63044568 4144173353 4061635107 4061635107 141680161 4061635107 -4076864659 20 4216440507 4015442341 225513085 4229654142 4076864659 4076864659 473294098 4216440507 -4144173353 22 NULL 4061635107 63044568 4144173353 4144173353 4144173353 141680161 NULL -4216440507 21 4229654142 4076864659 225513085 4229654142 4216440507 4216440507 473294098 4216440507 -4229654142 22 NULL 4216440507 225513085 4229654142 4229654142 4229654142 473294098 NULL -4268716378 14 NULL 3457053821 141047417 4268716378 4268716378 4268716378 662099130 NULL diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt deleted file mode 100644 index d7b3adf1d1b4..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/self_join_with_alias.slt +++ /dev/null @@ -1,125 +0,0 @@ -# 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. - -query I -SELECT - t1.c9 result -FROM aggregate_test_100_by_sql t1 -INNER JOIN aggregate_test_100_by_sql t2 -ON t1.c9 = t2.c9 -ORDER BY result; ----- -28774375 -63044568 -141047417 -141680161 -145294611 -225513085 -243203849 -326151275 -431948861 -466439833 -473294098 -520189543 -538589788 -557517119 -559847112 -598822671 -662099130 -754775609 -774637006 -811650497 -879082834 -933879086 -974297360 -1000948272 -1013876852 -1088543984 -1098639440 -1157161427 -1229567292 -1243785310 -1289293657 -1362369177 -1365198901 -1454057357 -1491205016 -1534194097 -1538863055 -1787652631 -1824517658 -1842680163 -1865307672 -1995343206 -2013662838 -2042457019 -2093538928 -2125812933 -2214035726 -2293105904 -2306130875 -2307004493 -2424630722 -2496054700 -2502326480 -2525744318 -2592330556 -2610290479 -2669374863 -2705709344 -2712615025 -2778168728 -2818832252 -2830981072 -2844041986 -2861376515 -2861911482 -2939920218 -3023531799 -3105312559 -3126475872 -3188005828 -3198969145 -3275293996 -3276123488 -3314983189 -3342719438 -3373581039 -3398507249 -3455216719 -3457053821 -3473924576 -3521368277 -3542840110 -3566741189 -3570297463 -3577318119 -3593959807 -3625286410 -3717551163 -3759340273 -3766999078 -3862393166 -3959216334 -3998790955 -4015442341 -4061635107 -4076864659 -4144173353 -4216440507 -4229654142 -4268716378 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt deleted file mode 100644 index b10ccdebc325..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_aggregation.slt +++ /dev/null @@ -1,28 +0,0 @@ -# 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. - -query IIRIII -SELECT - count(*) AS count_all, - count(c3) AS count_c3, - avg(c3) AS avg, - sum(c3) AS sum, - max(c3) AS max, - min(c3) AS min -FROM aggregate_test_100_by_sql; ----- -100 100 7.81 781 125 -117 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt deleted file mode 100644 index d2abeabc3b7c..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except.slt +++ /dev/null @@ -1,31 +0,0 @@ -# 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. - -query I -SELECT * FROM ( - SELECT c2 - FROM aggregate_test_100_by_sql t1 - EXCEPT - SELECT c2 - FROM aggregate_test_100_by_sql t2 - WHERE c2 IN (3, 4) -) s -ORDER BY c2 ----- -1 -2 -5 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt deleted file mode 100644 index c77c0c6b598b..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_group_by.slt +++ /dev/null @@ -1,34 +0,0 @@ -# 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. - -query IIRIII -select - c2, - sum(c3) sum_c3, - avg(c3) avg_c3, - max(c3) max_c3, - min(c3) min_c3, - count(c3) count_c3 -from aggregate_test_100_by_sql -group by c2 -order by c2; ----- -1 367 16.681818181818 125 -99 22 -2 184 8.363636363636 122 -117 22 -3 395 20.789473684211 123 -101 19 -4 29 1.260869565217 123 -117 23 -5 -194 -13.857142857143 118 -101 14 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt deleted file mode 100644 index 9f16b1170559..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect.slt +++ /dev/null @@ -1,30 +0,0 @@ -# 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. - -query I -SELECT * FROM ( - SELECT c2 - FROM aggregate_test_100_by_sql t1 - INTERSECT - SELECT c2 - FROM aggregate_test_100_by_sql t2 - WHERE c2 IN (3, 4) -) s -ORDER BY c2 ----- -3 -4 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt deleted file mode 100644 index 7b807f3316f5..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_intersect_all.slt +++ /dev/null @@ -1,70 +0,0 @@ -# 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. - -query I -SELECT * FROM ( - SELECT c2 - FROM aggregate_test_100_by_sql t1 - INTERSECT ALL - SELECT c2 - FROM aggregate_test_100_by_sql t2 - WHERE c2 IN (3, 4) -) s -ORDER BY c2 ----- -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt deleted file mode 100644 index c61c5303a85c..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_math_expressions.slt +++ /dev/null @@ -1,26 +0,0 @@ -# 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. - -query RRRRR -SELECT - abs(-1.1) as abs, - exp(2.0) as exp, - sin(3.0) as sin, - cos(4.0) as cos, - tan(5.0) as tan; ----- -1.1 7.389056098931 0.14112000806 -0.653643620864 -3.380515006247 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt deleted file mode 100644 index 2070f4becfbb..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_ordered_row.slt +++ /dev/null @@ -1,129 +0,0 @@ -# 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. - -query IIIIIII -SELECT -SUM(c5) OVER(ORDER BY c13 ROWS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation2, -SUM(c2) OVER(PARTITION BY c5 ORDER BY c13 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation10, -SUM(c2) OVER(PARTITION BY c1 ORDER BY c13 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation14, -SUM(c5) OVER(ORDER BY c5 ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING) as summation5, -SUM(c5) OVER(ORDER BY c5 ROWS BETWEEN UNBOUNDED PRECEDING AND 2 FOLLOWING) as summation6, -SUM(c2) OVER(PARTITION BY c5, c7, c9 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation20, -SUM(c2) OVER(PARTITION BY c5 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation21 -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- --4942047943 4 63 65888489655 -49496272718 4 4 -926757956 2 44 65239119005 -49988667320 2 2 -1732087197 5 60 63348565756 -44072309439 5 5 --3150892396 2 56 22284849433 -18365391649 2 2 --2580856019 2 60 26501601552 -22133107901 2 2 --335727035 1 44 20146078803 -16466216538 1 1 -1814066719 3 62 63285534470 -49613916090 3 3 -2053694183 4 62 52482905660 -42707727919 4 4 -3621641894 3 60 65599174579 -47485937795 3 3 --400780807 4 60 26398188956 1363051884 4 4 -7402117831 1 56 49945227444 -26269037388 1 1 --494733298 1 56 30420363606 -25755253815 1 1 -795974017 4 63 52321603367 -28960619870 4 4 -1026366728 4 63 40718554341 -15787873259 4 4 -2286728521 3 63 22540519030 5443690406 3 3 --1126902361 2 56 60886848761 -48311607997 2 2 -3039607922 5 63 36368366538 -10535560995 5 5 -452227974 3 60 48731300455 -24855926380 3 3 -5227296299 1 60 56253092820 -34082599483 1 1 -69074581 4 44 31650501220 -4686718095 4 4 --1471170754 1 44 48781585534 -39865989020 1 1 -2660538843 4 62 57667039791 -46297932749 4 4 -1419803598 5 62 54487875635 -31586207821 5 5 -2419395622 2 44 14499576077 13719154870 2 2 -2481391591 5 60 63779944434 -44742807337 5 5 --459020887 3 56 62748392040 -49376491044 3 3 --624495791 2 62 56738273175 -45668446269 2 2 --2096656853 2 56 51306415182 -41804411830 2 2 -1272929184 5 56 64903708596 -50030091076 5 5 -32805265 4 62 65476544051 -49938800703 4 4 --4061661128 2 63 60213611118 -47890565531 2 2 -3706903676 3 56 18004627099 -14557735645 3 3 -540986341 5 44 15862627961 -12630107535 5 5 -6758184069 1 60 10418937555 15862627961 1 1 -2026749584 2 56 20549346056 7494915128 2 2 -5467570199 4 44 28223071121 -667913323 4 4 -2067671449 3 62 62474806028 -42663256555 3 3 --1130350427 4 60 59934937400 -39537955622 4 4 --2003065005 3 44 65892719037 -49125296903 3 3 -5408019493 1 62 46149116149 -21995471817 1 1 --3164970139 4 60 32328844499 -27415680288 4 4 --2694469368 3 60 15862627961 -8540168355 3 3 --658921663 2 63 50083881192 -40875645214 2 2 -2805599223 4 63 18556152866 9548294540 4 4 -1553855901 3 44 44727303772 -36620277699 3 3 -1692583850 1 56 58570355880 -46885764079 1 1 -2735533457 3 60 57810649168 -36458975406 3 3 -2950771606 2 56 46110466191 -37764080037 2 2 -4826625882 4 56 62914544356 -43369697823 4 4 --782600284 5 62 65645302382 -49877765574 5 5 -5648017295 5 62 29961402376 -2693524905 5 5 --2767729102 5 60 55728616981 -45024220800 5 5 -5149003448 4 60 64604572155 -46025333589 4 4 -2961127755 2 62 24402796316 -20250814045 2 2 -5898948877 3 44 65851295281 -48741944194 3 3 -3960521203 1 63 53626707998 -43550421386 1 1 -3778827061 1 60 59232325784 -38625247674 1 1 -1686841798 2 62 15862627961 -10638973591 2 2 -2045904111 1 44 63753193492 -49782674421 1 1 -3236123325 4 63 12466574915 15862627961 4 4 -1611761891 4 56 64174235958 -49916888328 4 4 -1661243641 1 63 43278308249 -35443787221 1 1 --1804099697 2 56 34228019610 -28864675811 2 2 --1806255458 1 44 39809671411 -32918957573 1 1 -2971205313 5 63 61531074230 -48694091008 5 5 -3282334404 2 60 65801428664 -48344513742 2 2 -1922873587 4 62 16530541284 11612449585 4 4 -944558002 3 63 43486204682 -18961550403 3 3 --2057472121 4 44 61887961550 -41948021207 4 4 -3274034209 2 63 37858099778 -12360443160 2 2 --1924817872 4 63 28492735496 -23947043450 4 4 --1526835643 1 62 57047716212 -35270885423 1 1 --4360794332 1 60 65740393535 -47917316473 1 1 -440089321 2 63 60605435298 -40390464859 2 2 --349482531 5 62 33244301624 -6677891069 5 5 --1444906781 5 44 61264858032 -41185088251 5 5 -124105851 2 56 47448835782 -23431968584 2 2 -1507069678 2 62 65779516289 -49736546618 2 2 --1359045062 5 62 59413049347 -47422906509 5 5 --6342944350 3 56 54716947420 -44350983157 3 3 -2754612412 4 63 65358900679 -47051916395 4 4 -2926012685 1 44 55400583583 -32868672494 1 1 --634904850 4 56 58525884516 -37630943686 4 4 -2039004659 4 62 44823247831 -20505738577 4 4 -1022726318 3 63 34824178364 -8633537157 3 3 -3963879356 4 56 39294596545 -14098774415 4 4 --5184324536 1 44 47450052344 -38854319459 1 1 -2632160834 2 60 64207141703 -45402230071 2 2 --2188934048 3 63 62160560710 -49041080635 3 3 -4261991101 1 56 64987924864 -46612178067 1 1 --2680809293 3 56 15862627961 -6422221472 3 3 --46187270 3 60 42131665349 -17381673663 3 3 --255767708 3 60 51133513384 -27623576721 3 3 -3129721465 1 60 8367712833 15862627961 1 1 -2499782052 2 44 64556718969 -50025861694 2 2 --1609671980 1 62 37995735862 -31587424383 1 1 --1595655683 2 63 36113442006 -30247838230 2 2 --1524432418 1 44 53493571647 -30286488188 1 1 --5214552988 1 63 41617881776 -34221253231 1 1 --1718403224 5 56 24496165118 3396053046 5 5 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt deleted file mode 100644 index f566b02ad65a..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_row_past_future.slt +++ /dev/null @@ -1,127 +0,0 @@ -# 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. - -query IIIII -SELECT - SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) as summation1, - SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 2 FOLLOWING AND 3 FOLLOWING) as summation2, - SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 2 FOLLOWING AND UNBOUNDED FOLLOWING) as summation3, - SUM(c2) OVER(ORDER BY c5 RANGE BETWEEN 2 FOLLOWING AND UNBOUNDED FOLLOWING) as summation4, - SUM(c2) OVER(ORDER BY c5 RANGE BETWEEN 1 PRECEDING AND 1 PRECEDING) as summation5 -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- -2 5 159 162 NULL -5 7 173 177 NULL -5 7 125 129 NULL -1 6 264 266 NULL -2 5 258 262 NULL -3 4 266 268 NULL -3 6 190 191 NULL -2 8 229 230 NULL -1 5 146 150 NULL -4 5 21 26 NULL -3 3 79 82 NULL -4 4 253 257 NULL -1 4 83 86 NULL -3 7 58 62 NULL -5 8 16 18 NULL -2 6 200 205 NULL -2 9 48 51 NULL -1 5 77 79 NULL -1 6 96 97 NULL -5 8 34 39 NULL -1 6 236 238 NULL -2 7 214 215 NULL -1 7 90 91 NULL -4 2 2 6 NULL -2 7 129 134 NULL -3 5 191 194 NULL -5 6 215 219 NULL -2 4 230 234 NULL -2 9 177 179 NULL -2 6 168 173 NULL -5 8 205 207 NULL -5 4 268 269 NULL -2 3 269 272 NULL -4 NULL NULL 1 NULL -3 6 12 16 NULL -5 8 26 30 NULL -4 7 118 122 NULL -2 7 106 107 NULL -4 3 156 159 NULL -2 6 72 76 NULL -1 3 251 253 NULL -3 8 277 279 NULL -1 5 234 236 NULL -2 6 8 12 NULL -1 2 240 242 NULL -4 4 209 214 NULL -4 2 98 99 NULL -3 3 239 240 NULL -5 9 122 125 NULL -4 7 166 168 NULL -4 9 30 34 NULL -3 5 219 221 NULL -1 10 139 141 NULL -2 5 262 264 NULL -3 4 154 156 NULL -4 7 226 229 NULL -4 4 102 106 NULL -3 4 272 277 NULL -3 7 186 190 NULL -2 1 1 2 NULL -1 7 184 186 NULL -1 3 242 245 NULL -4 2 249 251 NULL -1 4 246 247 NULL -2 6 197 200 NULL -3 7 153 154 NULL -4 5 6 8 NULL -4 8 66 69 NULL -3 6 113 118 NULL -4 8 51 56 NULL -2 6 257 258 NULL -3 6 97 98 NULL -2 5 150 153 NULL -5 5 107 111 NULL -3 9 39 43 NULL -4 5 111 113 NULL -3 7 76 77 NULL -5 6 162 166 NULL -1 7 207 209 NULL -1 6 221 226 NULL -3 6 145 146 NULL -1 5 91 96 NULL -1 2 99 102 NULL -1 7 69 72 NULL -5 9 43 48 NULL -4 8 56 58 NULL -2 4 238 239 NULL -4 9 134 139 NULL -5 4 194 197 NULL -4 7 141 145 NULL -NULL 7 279 282 NULL -3 6 62 66 NULL -4 5 82 83 NULL -1 NULL NULL NULL NULL -4 6 179 184 NULL -2 2 247 248 NULL -2 2 248 249 NULL -5 4 86 90 NULL -1 5 245 246 NULL -4 6 18 21 NULL diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt deleted file mode 100644 index 1e55f0c2cda6..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_select.slt +++ /dev/null @@ -1,21 +0,0 @@ -# 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. - -query I -SELECT 1 as num; ----- -1 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt deleted file mode 100644 index 50b2c13f3bec..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort.slt +++ /dev/null @@ -1,125 +0,0 @@ -# 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. - -query IIT -SELECT - c2, - c3, - c10 -FROM aggregate_test_100_by_sql -ORDER BY c2 ASC, c3 DESC, c10; ----- -1 125 17869394731126786457 -1 120 16439861276703750332 -1 103 10901819591635583995 -1 83 4602675983996931623 -1 71 10297218950720052365 -1 70 4976799313755010034 -1 57 4338034436871150616 -1 54 17818611040257178339 -1 41 15419512479294091215 -1 38 1842662804748246269 -1 36 7788847578701297242 -1 29 14857091259186476033 -1 12 15449267433866484283 -1 -5 4776679784701509574 -1 -8 9904216782086286050 -1 -24 2402288956117186783 -1 -25 12763583666216333412 -1 -56 677091006469429514 -1 -72 5885937420286765261 -1 -85 12101411955859039553 -1 -98 9634106610243643486 -1 -99 14933742247195536130 -2 122 15695681119022625322 -2 113 4225581724448081782 -2 97 2792105417953811674 -2 93 5536487915963301239 -2 68 3898128009708892708 -2 63 13144161537396946288 -2 52 12565360638488684051 -2 52 7386391799827871203 -2 49 10948666249269100825 -2 45 8554426087132697832 -2 31 3343692635488765507 -2 29 562977550464243101 -2 1 5863949479783605708 -2 -29 11759014161799384683 -2 -43 906367167997372130 -2 -48 9135746610908713318 -2 -60 1719090662556698549 -2 -60 7045482583778080653 -2 -61 939909697866979632 -2 -106 7464432081248293405 -2 -107 4403623840168496677 -2 -117 12659011877190539078 -3 123 12883447461717956514 -3 112 9916295859593918600 -3 104 13079037564113702254 -3 97 8188072741116415408 -3 77 17419098323248948387 -3 73 2906943497598597237 -3 71 3998472996619161534 -3 22 196777795886465166 -3 17 12662506238151717757 -3 17 732272194388185106 -3 14 8164671015278284913 -3 13 10771380284714693539 -3 13 14881411008939145569 -3 -2 13062025193350212516 -3 -12 16060348691054629425 -3 -72 17452974532402389080 -3 -76 12046662515387914426 -3 -95 10966649192992996919 -3 -101 17929716297117857676 -4 123 4546434653720168472 -4 102 2240998421986827216 -4 97 9726016502640071617 -4 96 5437030162957481122 -4 74 10767179755613315144 -4 73 9575476605699527641 -4 65 11378396836996498283 -4 55 1524771507450695976 -4 47 2881913079548128905 -4 30 13526465947516666293 -4 17 3732692885824435932 -4 5 35363005357834672 -4 3 8622584762448622224 -4 -38 878137512938218976 -4 -53 9463973906560740422 -4 -54 7966148640299601101 -4 -56 2774306934041974261 -4 -59 15100310750150419896 -4 -79 2464584078983135763 -4 -90 4094315663314091142 -4 -101 16778113360088370541 -4 -111 8382489916947120498 -4 -117 13684453606722360110 -5 118 16493024289408725403 -5 68 9865419128970328044 -5 64 16127995415060805595 -5 62 10575647935385523483 -5 36 17448660630302620693 -5 -5 11429640193932435507 -5 -31 11005002152861474932 -5 -40 11720144131976083864 -5 -44 2413406423648025909 -5 -59 2501626630745849169 -5 -82 3330177516592499461 -5 -86 2126626171973341689 -5 -94 12849419495718510869 -5 -101 2243924747182709810 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt deleted file mode 100644 index 6ed5ba5c9803..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_sort_nulls_order.slt +++ /dev/null @@ -1,125 +0,0 @@ -# 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. - -query IIT -SELECT - c5, - c4, - c10 -FROM aggregate_test_100_by_sql -ORDER BY c5 ASC, c4 DESC, c10; ----- --2141999138 -18655 13062025193350212516 --2141451704 -11122 17452974532402389080 --2138770630 21456 13144161537396946288 --2117946883 2045 2501626630745849169 --2098805236 13741 196777795886465166 --1991133944 13630 9634106610243643486 --1927628110 -1114 7464432081248293405 --1908480893 -21739 1719090662556698549 --1899175111 15673 8554426087132697832 --1885422396 -12612 10767179755613315144 --1882293856 -24085 2402288956117186783 --1813935549 -28462 11378396836996498283 --1808210365 -16312 7045482583778080653 --1660426473 -2888 939909697866979632 --1448995523 7652 15449267433866484283 --1383162419 27138 9904216782086286050 --1339586153 -5479 10297218950720052365 --1331533190 10837 16439861276703750332 --1302295658 15091 17419098323248948387 --1222533990 -30187 12659011877190539078 --1176490478 31106 17869394731126786457 --1143802338 28781 4338034436871150616 --1090239422 -12056 12565360638488684051 --1011669561 -2904 4403623840168496677 --1009656194 20690 2881913079548128905 --928766616 -21481 7788847578701297242 --903316089 29106 8188072741116415408 --842693467 -12484 2243924747182709810 --800561771 23127 3343692635488765507 --673237643 -28070 3732692885824435932 --644225469 -4667 15419512479294091215 --629486480 15788 2413406423648025909 --587831330 24495 10948666249269100825 --537142430 25305 11759014161799384683 --467659022 32514 2126626171973341689 --421042466 -6823 9916295859593918600 --382483011 -9565 2906943497598597237 --346989627 -13217 17929716297117857676 --335410409 18384 1842662804748246269 --237425046 5281 2464584078983135763 --168758331 10130 15695681119022625322 --134213907 19208 16493024289408725403 --108973366 3917 4225581724448081782 --4229382 -1967 8382489916947120498 -41423756 16337 10575647935385523483 -49866617 15874 3898128009708892708 -61035129 -16110 13526465947516666293 -141218956 8809 12046662515387914426 -240273900 29533 12883447461717956514 -370975815 13080 906367167997372130 -383352709 15295 12763583666216333412 -397430452 28162 8164671015278284913 -427197269 -30336 5437030162957481122 -431378678 -22186 10901819591635583995 -434021400 -2376 7966148640299601101 -439738328 -18025 9135746610908713318 -586844478 -12907 11005002152861474932 -623103518 -16974 17448660630302620693 -659422734 -30508 8622584762448622224 -670497898 14457 12662506238151717757 -702611616 -7688 35363005357834672 -706441268 22614 11720144131976083864 -715235348 23388 7386391799827871203 -762932956 20744 878137512938218976 -794623392 12636 4776679784701509574 -852509237 16620 4546434653720168472 -912707948 32064 10771380284714693539 -994303988 -18218 14857091259186476033 -1171968280 -15154 12101411955859039553 -1188089983 25590 5885937420286765261 -1188285940 21576 9865419128970328044 -1213926989 5613 14933742247195536130 -1282464673 -22501 9575476605699527641 -1299719633 12613 14881411008939145569 -1325868318 27752 4976799313755010034 -1337043149 -22796 732272194388185106 -1354539333 -3855 562977550464243101 -1413111008 -18410 17818611040257178339 -1423957796 25286 15100310750150419896 -1436496767 194 3998472996619161534 -1489733240 -9168 16060348691054629425 -1544188174 -31500 2774306934041974261 -1579876740 -2935 4094315663314091142 -1593800404 18167 2792105417953811674 -1689098844 -26526 16127995415060805595 -1738331255 -25136 13079037564113702254 -1824882165 22080 3330177516592499461 -1902023838 -1471 1524771507450695976 -1955646088 24896 11429640193932435507 -1991172974 -24558 2240998421986827216 -1993193190 11640 16778113360088370541 -2025611582 -15880 12849419495718510869 -2030965207 13611 10966649192992996919 -2033001162 18109 5863949479783605708 -2047637360 -13181 9726016502640071617 -2051224722 19316 13684453606722360110 -2053379412 -12642 5536487915963301239 -2064155045 13788 9463973906560740422 -2106705285 8692 677091006469429514 -2143473091 -14704 4602675983996931623 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt deleted file mode 100644 index 8ab7be5105b9..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_union_all.slt +++ /dev/null @@ -1,22 +0,0 @@ -# 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. - -query I -SELECT 1 num UNION ALL SELECT 2 num ORDER BY num; ----- -1 -2 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt deleted file mode 100644 index 8abefe4ea30d..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_built_in_functions.slt +++ /dev/null @@ -1,132 +0,0 @@ -# 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. - -query IIIIIIIIII -SELECT - c9, - row_number() OVER (ORDER BY c9) row_num, - lead(c9) OVER (ORDER BY c9) lead_c9, - lag(c9) OVER (ORDER BY c9) lag_c9, - first_value(c9) OVER (ORDER BY c9) first_c9, - first_value(c9) OVER (ORDER BY c9 DESC) first_c9_desc, - last_value(c9) OVER (ORDER BY c9) last_c9, - last_value(c9) OVER (ORDER BY c9 DESC) last_c9_desc, - nth_value(c9, 2) OVER (ORDER BY c9) second_c9, - nth_value(c9, 2) OVER (ORDER BY c9 DESC) second_c9_desc -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- -28774375 1 63044568 NULL 28774375 4268716378 28774375 28774375 NULL 4229654142 -63044568 2 141047417 28774375 28774375 4268716378 63044568 63044568 63044568 4229654142 -141047417 3 141680161 63044568 28774375 4268716378 141047417 141047417 63044568 4229654142 -141680161 4 145294611 141047417 28774375 4268716378 141680161 141680161 63044568 4229654142 -145294611 5 225513085 141680161 28774375 4268716378 145294611 145294611 63044568 4229654142 -225513085 6 243203849 145294611 28774375 4268716378 225513085 225513085 63044568 4229654142 -243203849 7 326151275 225513085 28774375 4268716378 243203849 243203849 63044568 4229654142 -326151275 8 431948861 243203849 28774375 4268716378 326151275 326151275 63044568 4229654142 -431948861 9 466439833 326151275 28774375 4268716378 431948861 431948861 63044568 4229654142 -466439833 10 473294098 431948861 28774375 4268716378 466439833 466439833 63044568 4229654142 -473294098 11 520189543 466439833 28774375 4268716378 473294098 473294098 63044568 4229654142 -520189543 12 538589788 473294098 28774375 4268716378 520189543 520189543 63044568 4229654142 -538589788 13 557517119 520189543 28774375 4268716378 538589788 538589788 63044568 4229654142 -557517119 14 559847112 538589788 28774375 4268716378 557517119 557517119 63044568 4229654142 -559847112 15 598822671 557517119 28774375 4268716378 559847112 559847112 63044568 4229654142 -598822671 16 662099130 559847112 28774375 4268716378 598822671 598822671 63044568 4229654142 -662099130 17 754775609 598822671 28774375 4268716378 662099130 662099130 63044568 4229654142 -754775609 18 774637006 662099130 28774375 4268716378 754775609 754775609 63044568 4229654142 -774637006 19 811650497 754775609 28774375 4268716378 774637006 774637006 63044568 4229654142 -811650497 20 879082834 774637006 28774375 4268716378 811650497 811650497 63044568 4229654142 -879082834 21 933879086 811650497 28774375 4268716378 879082834 879082834 63044568 4229654142 -933879086 22 974297360 879082834 28774375 4268716378 933879086 933879086 63044568 4229654142 -974297360 23 1000948272 933879086 28774375 4268716378 974297360 974297360 63044568 4229654142 -1000948272 24 1013876852 974297360 28774375 4268716378 1000948272 1000948272 63044568 4229654142 -1013876852 25 1088543984 1000948272 28774375 4268716378 1013876852 1013876852 63044568 4229654142 -1088543984 26 1098639440 1013876852 28774375 4268716378 1088543984 1088543984 63044568 4229654142 -1098639440 27 1157161427 1088543984 28774375 4268716378 1098639440 1098639440 63044568 4229654142 -1157161427 28 1229567292 1098639440 28774375 4268716378 1157161427 1157161427 63044568 4229654142 -1229567292 29 1243785310 1157161427 28774375 4268716378 1229567292 1229567292 63044568 4229654142 -1243785310 30 1289293657 1229567292 28774375 4268716378 1243785310 1243785310 63044568 4229654142 -1289293657 31 1362369177 1243785310 28774375 4268716378 1289293657 1289293657 63044568 4229654142 -1362369177 32 1365198901 1289293657 28774375 4268716378 1362369177 1362369177 63044568 4229654142 -1365198901 33 1454057357 1362369177 28774375 4268716378 1365198901 1365198901 63044568 4229654142 -1454057357 34 1491205016 1365198901 28774375 4268716378 1454057357 1454057357 63044568 4229654142 -1491205016 35 1534194097 1454057357 28774375 4268716378 1491205016 1491205016 63044568 4229654142 -1534194097 36 1538863055 1491205016 28774375 4268716378 1534194097 1534194097 63044568 4229654142 -1538863055 37 1787652631 1534194097 28774375 4268716378 1538863055 1538863055 63044568 4229654142 -1787652631 38 1824517658 1538863055 28774375 4268716378 1787652631 1787652631 63044568 4229654142 -1824517658 39 1842680163 1787652631 28774375 4268716378 1824517658 1824517658 63044568 4229654142 -1842680163 40 1865307672 1824517658 28774375 4268716378 1842680163 1842680163 63044568 4229654142 -1865307672 41 1995343206 1842680163 28774375 4268716378 1865307672 1865307672 63044568 4229654142 -1995343206 42 2013662838 1865307672 28774375 4268716378 1995343206 1995343206 63044568 4229654142 -2013662838 43 2042457019 1995343206 28774375 4268716378 2013662838 2013662838 63044568 4229654142 -2042457019 44 2093538928 2013662838 28774375 4268716378 2042457019 2042457019 63044568 4229654142 -2093538928 45 2125812933 2042457019 28774375 4268716378 2093538928 2093538928 63044568 4229654142 -2125812933 46 2214035726 2093538928 28774375 4268716378 2125812933 2125812933 63044568 4229654142 -2214035726 47 2293105904 2125812933 28774375 4268716378 2214035726 2214035726 63044568 4229654142 -2293105904 48 2306130875 2214035726 28774375 4268716378 2293105904 2293105904 63044568 4229654142 -2306130875 49 2307004493 2293105904 28774375 4268716378 2306130875 2306130875 63044568 4229654142 -2307004493 50 2424630722 2306130875 28774375 4268716378 2307004493 2307004493 63044568 4229654142 -2424630722 51 2496054700 2307004493 28774375 4268716378 2424630722 2424630722 63044568 4229654142 -2496054700 52 2502326480 2424630722 28774375 4268716378 2496054700 2496054700 63044568 4229654142 -2502326480 53 2525744318 2496054700 28774375 4268716378 2502326480 2502326480 63044568 4229654142 -2525744318 54 2592330556 2502326480 28774375 4268716378 2525744318 2525744318 63044568 4229654142 -2592330556 55 2610290479 2525744318 28774375 4268716378 2592330556 2592330556 63044568 4229654142 -2610290479 56 2669374863 2592330556 28774375 4268716378 2610290479 2610290479 63044568 4229654142 -2669374863 57 2705709344 2610290479 28774375 4268716378 2669374863 2669374863 63044568 4229654142 -2705709344 58 2712615025 2669374863 28774375 4268716378 2705709344 2705709344 63044568 4229654142 -2712615025 59 2778168728 2705709344 28774375 4268716378 2712615025 2712615025 63044568 4229654142 -2778168728 60 2818832252 2712615025 28774375 4268716378 2778168728 2778168728 63044568 4229654142 -2818832252 61 2830981072 2778168728 28774375 4268716378 2818832252 2818832252 63044568 4229654142 -2830981072 62 2844041986 2818832252 28774375 4268716378 2830981072 2830981072 63044568 4229654142 -2844041986 63 2861376515 2830981072 28774375 4268716378 2844041986 2844041986 63044568 4229654142 -2861376515 64 2861911482 2844041986 28774375 4268716378 2861376515 2861376515 63044568 4229654142 -2861911482 65 2939920218 2861376515 28774375 4268716378 2861911482 2861911482 63044568 4229654142 -2939920218 66 3023531799 2861911482 28774375 4268716378 2939920218 2939920218 63044568 4229654142 -3023531799 67 3105312559 2939920218 28774375 4268716378 3023531799 3023531799 63044568 4229654142 -3105312559 68 3126475872 3023531799 28774375 4268716378 3105312559 3105312559 63044568 4229654142 -3126475872 69 3188005828 3105312559 28774375 4268716378 3126475872 3126475872 63044568 4229654142 -3188005828 70 3198969145 3126475872 28774375 4268716378 3188005828 3188005828 63044568 4229654142 -3198969145 71 3275293996 3188005828 28774375 4268716378 3198969145 3198969145 63044568 4229654142 -3275293996 72 3276123488 3198969145 28774375 4268716378 3275293996 3275293996 63044568 4229654142 -3276123488 73 3314983189 3275293996 28774375 4268716378 3276123488 3276123488 63044568 4229654142 -3314983189 74 3342719438 3276123488 28774375 4268716378 3314983189 3314983189 63044568 4229654142 -3342719438 75 3373581039 3314983189 28774375 4268716378 3342719438 3342719438 63044568 4229654142 -3373581039 76 3398507249 3342719438 28774375 4268716378 3373581039 3373581039 63044568 4229654142 -3398507249 77 3455216719 3373581039 28774375 4268716378 3398507249 3398507249 63044568 4229654142 -3455216719 78 3457053821 3398507249 28774375 4268716378 3455216719 3455216719 63044568 4229654142 -3457053821 79 3473924576 3455216719 28774375 4268716378 3457053821 3457053821 63044568 4229654142 -3473924576 80 3521368277 3457053821 28774375 4268716378 3473924576 3473924576 63044568 4229654142 -3521368277 81 3542840110 3473924576 28774375 4268716378 3521368277 3521368277 63044568 4229654142 -3542840110 82 3566741189 3521368277 28774375 4268716378 3542840110 3542840110 63044568 4229654142 -3566741189 83 3570297463 3542840110 28774375 4268716378 3566741189 3566741189 63044568 4229654142 -3570297463 84 3577318119 3566741189 28774375 4268716378 3570297463 3570297463 63044568 4229654142 -3577318119 85 3593959807 3570297463 28774375 4268716378 3577318119 3577318119 63044568 4229654142 -3593959807 86 3625286410 3577318119 28774375 4268716378 3593959807 3593959807 63044568 4229654142 -3625286410 87 3717551163 3593959807 28774375 4268716378 3625286410 3625286410 63044568 4229654142 -3717551163 88 3759340273 3625286410 28774375 4268716378 3717551163 3717551163 63044568 4229654142 -3759340273 89 3766999078 3717551163 28774375 4268716378 3759340273 3759340273 63044568 4229654142 -3766999078 90 3862393166 3759340273 28774375 4268716378 3766999078 3766999078 63044568 4229654142 -3862393166 91 3959216334 3766999078 28774375 4268716378 3862393166 3862393166 63044568 4229654142 -3959216334 92 3998790955 3862393166 28774375 4268716378 3959216334 3959216334 63044568 4229654142 -3998790955 93 4015442341 3959216334 28774375 4268716378 3998790955 3998790955 63044568 4229654142 -4015442341 94 4061635107 3998790955 28774375 4268716378 4015442341 4015442341 63044568 4229654142 -4061635107 95 4076864659 4015442341 28774375 4268716378 4061635107 4061635107 63044568 4229654142 -4076864659 96 4144173353 4061635107 28774375 4268716378 4076864659 4076864659 63044568 4229654142 -4144173353 97 4216440507 4076864659 28774375 4268716378 4144173353 4144173353 63044568 4229654142 -4216440507 98 4229654142 4144173353 28774375 4268716378 4216440507 4216440507 63044568 4229654142 -4229654142 99 4268716378 4216440507 28774375 4268716378 4229654142 4229654142 63044568 4229654142 -4268716378 100 NULL 4229654142 28774375 4268716378 4268716378 4268716378 63044568 NULL diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt deleted file mode 100644 index 5ec31226fc99..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_full_aggregation.slt +++ /dev/null @@ -1,128 +0,0 @@ -# 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. - -query IIRIII -SELECT - row_number() OVER () AS row_number, - count(c3) OVER () AS count_c3, - avg(c3) OVER () AS avg, - sum(c3) OVER () AS sum, - max(c3) OVER () AS max, - min(c3) OVER () AS min -FROM aggregate_test_100_by_sql -ORDER BY row_number; ----- -1 100 7.81 781 125 -117 -2 100 7.81 781 125 -117 -3 100 7.81 781 125 -117 -4 100 7.81 781 125 -117 -5 100 7.81 781 125 -117 -6 100 7.81 781 125 -117 -7 100 7.81 781 125 -117 -8 100 7.81 781 125 -117 -9 100 7.81 781 125 -117 -10 100 7.81 781 125 -117 -11 100 7.81 781 125 -117 -12 100 7.81 781 125 -117 -13 100 7.81 781 125 -117 -14 100 7.81 781 125 -117 -15 100 7.81 781 125 -117 -16 100 7.81 781 125 -117 -17 100 7.81 781 125 -117 -18 100 7.81 781 125 -117 -19 100 7.81 781 125 -117 -20 100 7.81 781 125 -117 -21 100 7.81 781 125 -117 -22 100 7.81 781 125 -117 -23 100 7.81 781 125 -117 -24 100 7.81 781 125 -117 -25 100 7.81 781 125 -117 -26 100 7.81 781 125 -117 -27 100 7.81 781 125 -117 -28 100 7.81 781 125 -117 -29 100 7.81 781 125 -117 -30 100 7.81 781 125 -117 -31 100 7.81 781 125 -117 -32 100 7.81 781 125 -117 -33 100 7.81 781 125 -117 -34 100 7.81 781 125 -117 -35 100 7.81 781 125 -117 -36 100 7.81 781 125 -117 -37 100 7.81 781 125 -117 -38 100 7.81 781 125 -117 -39 100 7.81 781 125 -117 -40 100 7.81 781 125 -117 -41 100 7.81 781 125 -117 -42 100 7.81 781 125 -117 -43 100 7.81 781 125 -117 -44 100 7.81 781 125 -117 -45 100 7.81 781 125 -117 -46 100 7.81 781 125 -117 -47 100 7.81 781 125 -117 -48 100 7.81 781 125 -117 -49 100 7.81 781 125 -117 -50 100 7.81 781 125 -117 -51 100 7.81 781 125 -117 -52 100 7.81 781 125 -117 -53 100 7.81 781 125 -117 -54 100 7.81 781 125 -117 -55 100 7.81 781 125 -117 -56 100 7.81 781 125 -117 -57 100 7.81 781 125 -117 -58 100 7.81 781 125 -117 -59 100 7.81 781 125 -117 -60 100 7.81 781 125 -117 -61 100 7.81 781 125 -117 -62 100 7.81 781 125 -117 -63 100 7.81 781 125 -117 -64 100 7.81 781 125 -117 -65 100 7.81 781 125 -117 -66 100 7.81 781 125 -117 -67 100 7.81 781 125 -117 -68 100 7.81 781 125 -117 -69 100 7.81 781 125 -117 -70 100 7.81 781 125 -117 -71 100 7.81 781 125 -117 -72 100 7.81 781 125 -117 -73 100 7.81 781 125 -117 -74 100 7.81 781 125 -117 -75 100 7.81 781 125 -117 -76 100 7.81 781 125 -117 -77 100 7.81 781 125 -117 -78 100 7.81 781 125 -117 -79 100 7.81 781 125 -117 -80 100 7.81 781 125 -117 -81 100 7.81 781 125 -117 -82 100 7.81 781 125 -117 -83 100 7.81 781 125 -117 -84 100 7.81 781 125 -117 -85 100 7.81 781 125 -117 -86 100 7.81 781 125 -117 -87 100 7.81 781 125 -117 -88 100 7.81 781 125 -117 -89 100 7.81 781 125 -117 -90 100 7.81 781 125 -117 -91 100 7.81 781 125 -117 -92 100 7.81 781 125 -117 -93 100 7.81 781 125 -117 -94 100 7.81 781 125 -117 -95 100 7.81 781 125 -117 -96 100 7.81 781 125 -117 -97 100 7.81 781 125 -117 -98 100 7.81 781 125 -117 -99 100 7.81 781 125 -117 -100 100 7.81 781 125 -117 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt deleted file mode 100644 index afa722791255..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_groups.slt +++ /dev/null @@ -1,174 +0,0 @@ -# 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. - -query IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII -SELECT - SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation1, - SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation2, - SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation3, - SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation4, - SUM(c3) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation5, - SUM(c5) OVER(ORDER BY c3 DESC GROUPS 2 PRECEDING) as summation6, - SUM(c5) OVER(ORDER BY c3 DESC GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation7, - SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation8, - SUM(c4) OVER(ORDER BY c4 DESC GROUPS UNBOUNDED PRECEDING) as summation9, - SUM(c5) OVER(ORDER BY c4 DESC GROUPS CURRENT ROW) as summation10, - SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation11, - SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation12, - SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation13, - SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation21, - SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation22, - SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation23, - SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation24, - SUM(c3) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation25, - SUM(c5) OVER(PARTITION BY c4 ORDER BY c3 GROUPS 2 PRECEDING) as summation26, - SUM(c5) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation27, - SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation28, - SUM(c4) OVER(PARTITION BY c4 ORDER BY c4 GROUPS UNBOUNDED PRECEDING) as summation29, - SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS CURRENT ROW) as summation30, - SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation31, - SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation32, - SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation33, - SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation41, - SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation42, - SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation43, - SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation44, - SUM(c3) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation45, - SUM(c5) OVER(ORDER BY c5, c3 GROUPS 2 PRECEDING) as summation46, - SUM(c5) OVER(ORDER BY c5, c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation47, - SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation48, - SUM(c4) OVER(ORDER BY c5, c4 GROUPS UNBOUNDED PRECEDING) as summation49, - SUM(c5) OVER(ORDER BY c5, c4 GROUPS CURRENT ROW) as summation50, - SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation51, - SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation52, - SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation53, - SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation61, - SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation62, - SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation63, - SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation64, - SUM(c3) OVER(ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation65, - SUM(c5) OVER(ORDER BY c3 GROUPS 2 PRECEDING) as summation66, - SUM(c5) OVER(ORDER BY c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation67, - SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation68, - SUM(c4) OVER(ORDER BY c4 GROUPS UNBOUNDED PRECEDING) as summation69, - SUM(c5) OVER(ORDER BY c4 GROUPS CURRENT ROW) as summation70, - SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation71, - SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation72, - SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation73 -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- --35127 -20071 1171968280 -44741 -60 -1045189740 1645376618 15862627961 728662 61035129 2252131671 4277743253 2191096542 -16110 NULL NULL NULL NULL 61035129 61035129 61035129 -16110 61035129 61035129 61035129 NULL 22943 14370 41423756 51422 -76 152325502 813503800 15862627961 145307 61035129 65801428664 65851295281 65740393535 -37724 -22668 623103518 3056 -94 311073214 -1380600149 15862627961 -512775 61035129 13671531419 11863321054 13610496290 -37269 20967 1213926989 -54145 -59 -1574720463 1639694101 15862627961 951392 -108973366 5255341318 5017916272 5364314684 3917 NULL NULL NULL NULL -108973366 -108973366 -108973366 3917 -108973366 -108973366 -108973366 NULL 36569 15411 -168758331 30244 -111 -411945604 -21912375 15862627961 131173 -108973366 65779516289 65645302382 65888489655 -31020 -47322 1436496767 40175 -79 1208315423 -1743478794 15862627961 -715478 -108973366 10498313277 8380366394 10607286643 -14062 11006 61035129 -15056 -48 -1285298976 1303653581 15862627961 695376 623103518 3999306907 2191096542 3376203389 -16974 NULL NULL NULL NULL 623103518 623103518 623103518 -16974 623103518 623103518 623103518 NULL -80790 -20401 439738328 -23739 3 1649686324 2655635766 15862627961 137382 623103518 61887961550 62474806028 61264858032 -35127 -38183 994303988 29390 -60 -1045189740 -3184474087 15862627961 -480353 623103518 12486424572 12926162900 11863321054 -1164 19243 -2117946883 -15742 55 89808975 -2114836321 15862627961 952517 -1927628110 6045764800 7482261567 7973392910 -1114 NULL NULL NULL NULL -1927628110 -1927628110 -1927628110 -1114 -1927628110 -1927628110 -1927628110 NULL 6563 15786 -2098805236 -18678 -60 -6017567290 -7620706510 15862627961 19981 -1927628110 28492735496 26501601552 30420363606 -30917 -12838 -4229382 5182 71 -2943527053 -1901324969 15862627961 -721634 -1927628110 7889235051 9791258889 9816863161 -67523 35827 49866617 -24738 -25 -3496662635 -3184474087 15862627961 740879 -1899175111 7846553398 7217066918 9745728509 15673 NULL NULL NULL NULL -1899175111 -1899175111 -1899175111 15673 -1899175111 -1899175111 -1899175111 NULL -6162 12516 -1927628110 -65159 74 -5735284114 -7480826912 15862627961 13915 -1899175111 32328844499 30420363606 34228019610 11625 -20071 -1302295658 56517 -44 -2878810989 -3871666709 15862627961 -493209 -1899175111 6116899452 6500252161 8016074563 -14039 -18815 2064155045 -9562 -95 2065442845 -1901324969 15862627961 826881 -1991133944 10028823751 7930018515 12019957695 13630 NULL NULL NULL NULL -1991133944 -1991133944 -1991133944 13630 -1991133944 -1991133944 -1991133944 NULL 49758 23501 -2117946883 -7180 -106 -6207886063 -7726418058 15862627961 21095 -1991133944 26501601552 24402796316 28492735496 17679 -15175 370975815 -5204 22 26303141 3645319585 15862627961 -581254 -1991133944 3842670266 5873635473 5833804210 -17679 27241 586844478 -5985 83 26303141 -2140016957 15862627961 790510 -346989627 7246194997 9293832357 7593184624 -13217 NULL NULL NULL NULL -346989627 -346989627 -346989627 -13217 -346989627 -346989627 -346989627 NULL 21293 25691 -421042466 33795 38 -1150515104 -1088583413 15862627961 74253 -346989627 64556718969 64174235958 64903708596 -14433 -4871 1171968280 32854 97 -2135787575 2057268348 15862627961 -571730 -346989627 8269443337 10412916428 8616432964 -53780 -7078 -2138770630 29390 -117 -1972491598 -3888467183 15862627961 567403 -1009656194 12359612306 13122545262 13369268500 20690 NULL NULL NULL NULL -1009656194 -1009656194 -1009656194 20690 -1009656194 -1009656194 -1009656194 NULL 13030 16725 -1090239422 -4859 36 -3111565177 -3684432366 15862627961 20225 -1009656194 55728616981 54716947420 56738273175 74575 13717 -134213907 17417 -38 -3553056774 -559380590 15862627961 -314716 -1009656194 2493359461 4544584183 3503015655 -28098 -8332 -903316089 44641 70 -367071380 1863474126 15862627961 211266 397430452 18400914040 17257111702 18003483588 28162 NULL NULL NULL NULL 397430452 397430452 397430452 28162 397430452 397430452 397430452 NULL 55734 42613 370975815 -54898 96 1151758976 1690027799 15862627961 240186 397430452 64604572155 64987924864 64207141703 36394 -36 -1383162419 -44741 57 1160862510 1981771941 15862627961 48893 397430452 -2140855627 -814987309 -2538286079 -17679 27241 794623392 -5985 120 26303141 -2140016957 15862627961 890461 1993193190 7523673648 8823393281 5530480458 11640 NULL NULL NULL NULL 1993193190 1993193190 1993193190 11640 1993193190 1993193190 1993193190 NULL -5373 23425 1955646088 15840 -94 5940012252 8082771141 15862627961 214888 1993193190 20549346056 22540519030 18556152866 -14433 -4871 -168758331 32854 13 -2135787575 2057268348 15862627961 -646824 1993193190 10332147503 9000614313 8338954313 -15239 -44678 -1143802338 -17538 -8 2322760594 2439184170 15862627961 239018 1325868318 18003483588 18400914040 16677615270 27752 NULL NULL NULL NULL 1325868318 1325868318 1325868318 27752 1325868318 1325868318 1325868318 NULL 681 -16888 1282464673 -45061 17 3908052624 5430561808 15862627961 278980 1325868318 46149116149 47448835782 44823247831 4929 -54988 1188089983 -49963 14 750085326 437338198 15862627961 20731 1325868318 -814987309 -2198149728 -2140855627 -46712 64670 1282464673 27693 102 -1775723035 -1449239099 15862627961 487280 -1882293856 2457410212 3794453361 4339704068 -24085 NULL NULL NULL NULL -1882293856 -1882293856 -1882293856 -24085 -1882293856 -1882293856 -1882293856 NULL -71225 -6066 -1899175111 -47662 65 -5666891363 -7164866243 15862627961 -22782 -1882293856 36113442006 34228019610 37995735862 -5560 12398 1738331255 55502 17 -2036083577 974546445 15862627961 -279368 -1882293856 11522923893 13514096867 13405217749 --49576 387 -1908480893 59917 17 -2287736392 3560913151 15862627961 534161 1282464673 5076918034 5508296712 3794453361 -22501 NULL NULL NULL NULL 1282464673 1282464673 1282464673 -22501 1282464673 1282464673 1282464673 NULL 42891 47166 1188285940 17569 13 3684677602 5245095773 15862627961 238615 1282464673 48731300455 49945227444 47448835782 15239 65202 -1882293856 -12225 103 2322760594 -144263301 15862627961 -324665 1282464673 12068174600 13405217749 10785709927 --2090 -4237 427197269 -13608 NULL 6149069904 -2420213359 15862627961 231997 1544188174 1544188174 2203610908 NULL -31500 NULL NULL NULL NULL 1544188174 1544188174 1544188174 -31500 1544188174 1544188174 1544188174 NULL -18123 25480 1436496767 -11294 -90 4470418181 6406964162 15862627961 218731 1544188174 36368366538 37858099778 34824178364 -38792 -40939 NULL -6613 3 -759786886 6588808232 15862627961 -31500 1544188174 15862627961 15862627961 14318439787 -40940 29579 -2098805236 5182 -43 5636453529 2057268348 15862627961 840492 2030965207 12019957695 10028823751 9988992488 13611 NULL NULL NULL NULL 2030965207 2030965207 2030965207 13611 2030965207 2030965207 2030965207 NULL 2922 -12918 1993193190 24244 1 6049769979 8162828451 15862627961 212619 2030965207 16530541284 18556152866 14499576077 2913 -8448 794623392 13699 -98 1253758252 5168794507 15862627961 -594884 2030965207 5873635473 6244611288 3842670266 --5560 -33253 -1383162419 30451 -59 -2036083577 1519076272 15862627961 317051 -537142430 16872687706 18060777689 17409830136 25305 NULL NULL NULL NULL -537142430 -537142430 -537142430 25305 -537142430 -537142430 -537142430 NULL 93435 11121 -629486480 16126 -86 -1754460240 -1808326929 15862627961 71344 -537142430 62748392040 62160560710 63285534470 71051 43358 1955646088 -17958 -72 812635004 -546350337 15862627961 -59749 -537142430 -1547202175 -123244379 -1010059745 -31670 65202 1991172974 66574 17 1113315852 -1552050368 15862627961 411060 1689098844 610199839 2348531094 -1078899005 -26526 NULL NULL NULL NULL 1689098844 1689098844 1689098844 -26526 1689098844 1689098844 1689098844 NULL -67930 -34435 1579876740 -4527 104 4862775988 7154336102 15862627961 207437 1689098844 31650501220 33244301624 29961402376 11586 45118 -1813935549 36740 104 -408248030 2439184170 15862627961 -205589 1689098844 16941526966 16268289323 15252428122 --32689 -38183 431378678 80491 -24 1584341489 2495165914 15862627961 511365 1337043149 3794453361 5076918034 2457410212 -22796 NULL NULL NULL NULL 1337043149 1337043149 1337043149 -22796 1337043149 1337043149 1337043149 NULL -8787 -9888 1299719633 3021 29 3962631100 5528651286 15862627961 256184 1337043149 44823247831 46149116149 43486204682 57823 52329 1991172974 -24442 73 3944161437 1645376618 15862627961 -302164 1337043149 13405217749 11522923893 12068174600 -53530 14090 -346989627 13699 -94 2759425399 4309797580 15862627961 760652 1171968280 5449711533 7593184624 4277743253 -15154 NULL NULL NULL NULL 1171968280 1171968280 1171968280 -15154 1171968280 1171968280 1171968280 NULL 40902 48684 912707948 52779 -72 3078980216 4762271192 15862627961 208337 1171968280 53493571647 54487875635 52321603367 20625 -18815 61035129 36170 83 2284185998 2900644355 15862627961 -543809 1171968280 11584884708 13610496290 10412916428 -46693 37793 1436496767 17417 -111 799645256 2352299442 15862627961 951046 1902023838 7973392910 6045764800 6071369072 -1471 NULL NULL NULL NULL 1902023838 1902023838 1902023838 -1471 1902023838 1902023838 1902023838 NULL -6157 -51662 1738331255 11978 -5 5465237258 7842036090 15862627961 202910 1902023838 26398188956 28223071121 24496165118 44727 35827 434021400 66574 -106 2940130772 -1339125374 15862627961 -720520 1902023838 9791258889 9787029507 7889235051 -38577 -5070 240273900 -8549 14 -3241149212 1796328434 15862627961 183104 -1143802338 17257111702 16353795613 18400914040 28781 NULL NULL NULL NULL -1143802338 -1143802338 -1143802338 28781 -1143802338 -1143802338 -1143802338 NULL 32735 -15096 -1222533990 5730 52 -3542826806 -4255367515 15862627961 14495 -1143802338 52482905660 51306415182 53626707998 36569 -7078 1325868318 11267 97 2171332508 -1552050368 15862627961 77674 -1143802338 -2538286079 -2140855627 -1394483741 --32689 -38183 1738331255 80491 65 1584341489 2495165914 15862627961 382990 -673237643 -1078899005 610199839 -405661362 -28070 NULL NULL NULL NULL -673237643 -673237643 -673237643 -28070 -673237643 -673237643 -673237643 NULL 7012 16622 -842693467 35616 41 -2316492881 -2534780922 15862627961 10423 -673237643 60213611118 59413049347 60886848761 57823 52329 -1222533990 -24442 64 3944161437 1645376618 15862627961 -179063 -673237643 16268289323 14454353774 16941526966 --611 -37351 706441268 -33532 63 2660931489 -1025454778 15862627961 504513 1188285940 12172060572 13996942737 10983774632 21576 NULL NULL NULL NULL 1188285940 1188285940 1188285940 21576 1188285940 1188285940 1188285940 NULL 19407 -33372 1171968280 -4275 -99 3548344203 4984397235 15862627961 255503 1188285940 51133513384 52321603367 49945227444 31670 -5070 762932956 -9599 -82 1113315852 3560913151 15862627961 -250940 1188285940 4878853329 2740082699 3690567389 --48148 9534 -842693467 -12225 -31 5218698356 1009134449 15862627961 829815 2053379412 11934056247 10048633851 9880676835 -12642 NULL NULL NULL NULL 2053379412 2053379412 2053379412 -12642 2053379412 2053379412 2053379412 NULL 25390 4928 2047637360 7776 -53 6152241494 8367712833 15862627961 224221 2053379412 8367712833 10418937555 6314333421 -55203 2479 2047637360 -20802 74 2894556845 7209871330 15862627961 -610460 2053379412 5981951126 6568795604 3928571714 -24352 -8790 -1885422396 56438 97 433054757 2427194517 15862627961 816908 586844478 9880676835 11934056247 9293832357 -12907 NULL NULL NULL NULL 586844478 586844478 586844478 -12907 586844478 586844478 586844478 NULL -72468 -24562 434021400 -33025 36 1460604206 2539868628 15862627961 154356 586844478 62474806028 62914544356 61887961550 68836 35694 -346989627 16515 93 2056218702 -1449239099 15862627961 -597818 586844478 6568795604 8616432964 5981951126 --49576 387 702611616 59917 -72 -2287736392 3560913151 15862627961 890731 -382483011 5591766247 7081499487 5974249258 -9565 NULL NULL NULL NULL -382483011 -382483011 -382483011 -9565 -382483011 -382483011 -382483011 NULL 28214 57819 -467659022 10448 -101 -1271184499 -1302308093 15862627961 87470 -382483011 64174235958 63753193492 64556718969 15239 65202 -1090239422 -12225 -12 2322760594 -144263301 15862627961 -668299 -382483011 9888378703 7746926999 10270861714 --17721 13717 -587831330 -24442 -40 -1441635278 -489488557 15862627961 438243 -800561771 13902822234 14618057582 14703384005 23127 NULL NULL NULL NULL -800561771 -800561771 -800561771 23127 -800561771 -800561771 -800561771 NULL -9802 7625 -903316089 -16949 17 -2546571327 -2747511363 15862627961 38493 -800561771 59413049347 58570355880 60213611118 -39770 -8332 1824882165 -24738 52 1609316679 -2085860747 15862627961 -183119 -800561771 1159243956 1865685224 1959805727 --14433 -8448 434021400 -12838 -90 -2135787575 -187208211 15862627961 940911 -1011669561 7302003527 5641577054 8313673088 -2904 NULL NULL NULL NULL -1011669561 -1011669561 -1011669561 -2904 -1011669561 -1011669561 -1011669561 NULL 65617 59887 -1143802338 28315 47 -3245711321 -3853408460 15862627961 -465 -1011669561 54716947420 53626707998 55728616981 -16856 -10871 1354539333 -9562 -61 -187208211 -921860586 15862627961 -711818 -1011669561 7548954873 9128831613 8560624434 -90245 56283 -1009656194 -28042 38 -1634505428 1074101516 15862627961 605927 -134213907 11318043778 13369268500 11452257685 19208 NULL NULL NULL NULL -134213907 -134213907 -134213907 19208 -134213907 -134213907 -134213907 NULL 56920 23665 -237425046 18287 113 -540397284 -205992899 15862627961 127256 -134213907 65645302382 65476544051 65779516289 2003 -31959 1593800404 67120 -117 -664229739 -541722291 15862627961 -354722 -134213907 4410370276 4074959867 4544584183 --30917 -15175 -1927628110 -10871 -54 -2943527053 824461350 15862627961 949079 -4229382 6071369072 7973392910 6075598454 -1967 NULL NULL NULL NULL -4229382 -4229382 -4229382 -1967 -4229382 -4229382 -4229382 NULL 47625 29338 -134213907 16101 62 -247416655 148096120 15862627961 129206 -4229382 65888489655 65779516289 65892719037 -15742 NULL -1660426473 -18079 55 824461350 -2140016957 15862627961 -719049 -4229382 9787029507 10221050907 9791258889 -36636 -19881 1423957796 31696 52 450275604 -4140888104 15862627961 391728 -587831330 14030226252 15985872340 14618057582 24495 NULL NULL NULL NULL -587831330 -587831330 -587831330 24495 -587831330 -587831330 -587831330 NULL 32851 -32737 -644225469 50996 -29 -1861543279 -2013675248 15862627961 46039 -587831330 62160560710 61531074230 62748392040 67523 11006 -800561771 -8549 -5 -3496662635 2352299442 15862627961 -135236 -587831330 1244570379 1959805727 1832401709 --37724 7017 670497898 36430 -98 311073214 1845356201 15862627961 813251 -2098805236 7930018515 9994173560 10028823751 13741 NULL NULL NULL NULL -2098805236 -2098805236 -2098805236 13741 -2098805236 -2098805236 -2098805236 NULL 39750 10334 -2138770630 -9223 -98 -6355522749 -7926048183 15862627961 7465 -2098805236 24402796316 22284849433 26501601552 28098 72839 2030965207 -15056 -53 -367071380 -489488557 15862627961 -567513 -2098805236 5833804210 3842670266 7932609446 --22116 11412 -237425046 -26471 71 3390925772 -7024468539 15862627961 953437 -2117946883 5364314684 5255341318 7482261567 2045 NULL NULL NULL NULL -2117946883 -2117946883 -2117946883 2045 -2117946883 -2117946883 -2117946883 NULL 7465 -29777 -2141451704 26257 22 -6398169217 -8135514173 15862627961 -6276 -2117946883 22284849433 20146078803 24402796316 -21948 11580 -1927628110 -11396 113 -6071106818 5455080817 15862627961 -719395 -2117946883 8380366394 9816863161 10498313277 --2090 -4237 -168758331 -13608 12 6149069904 -2420213359 15862627961 928929 2106705285 6889553023 7030771979 4782847738 8692 NULL NULL NULL NULL 2106705285 2106705285 2106705285 8692 2106705285 2106705285 2106705285 NULL 14450 6674 2053379412 -14704 83 6224239742 4250178376 15862627961 246701 2106705285 4250178376 6314333421 2143473091 -38792 -40939 1213926989 -6613 -76 -759786886 6588808232 15862627961 -688240 2106705285 11079780223 9630784700 8973074938 --31090 -36 -335410409 46015 123 3395035512 1258109085 15862627961 660587 2033001162 10193867690 11787668094 8160866528 18109 NULL NULL NULL NULL 2033001162 2033001162 2033001162 18109 2033001162 2033001162 2033001162 NULL 14299 -4240 2025611582 -6507 97 6089577951 8185242656 15862627961 230728 2033001162 14499576077 16530541284 12466574915 33616 64670 41423756 -30544 97 2641271504 1946039989 15862627961 -410481 2033001162 7701761433 8554270670 5668760271 --44611 -31959 1337043149 -8886 104 4160882907 7209871330 15862627961 462722 1991172974 4339704068 2457410212 2348531094 -24558 NULL NULL NULL NULL 1991172974 1991172974 1991172974 -24558 1991172974 1991172974 1991172974 NULL 32587 20609 1902023838 9371 -101 5848842900 8040942953 15862627961 203248 1991172974 22540519030 24496165118 20549346056 -55630 -42978 1689098844 -54145 -24 5156491918 3739840441 15862627961 -255283 1991172974 13514096867 15252428122 11522923893 --32689 -38183 383352709 80491 -53 1584341489 2495165914 15862627961 785722 670497898 10664671458 9362375800 9994173560 14457 NULL NULL NULL NULL 670497898 670497898 670497898 14457 670497898 670497898 670497898 NULL -53620 -29881 623103518 38314 5 1953024150 2794786130 15862627961 121331 670497898 60605435298 61264858032 59934937400 57823 52329 -2098805236 -24442 77 3944161437 1645376618 15862627961 -539268 670497898 5868454401 7932609446 5197956503 -71051 40600 1188285940 51482 47 812635004 1210863559 15862627961 546713 762932956 13122545262 10983774632 12359612306 20744 NULL NULL NULL NULL 762932956 762932956 762932956 20744 762932956 762932956 762932956 NULL 71694 14926 706441268 61320 -5 2184609572 3322773533 15862627961 180389 762932956 57810649168 58525884516 57047716212 59319 28868 2051224722 27693 63 1840350039 1195987713 15862627961 -293972 762932956 3503015655 2493359461 2740082699 --12381 -40939 -1331533190 12207 -56 -2472569238 2900644355 15862627961 920237 141218956 7030771979 6862013648 6889553023 8809 NULL NULL NULL NULL 141218956 141218956 141218956 8809 141218956 141218956 141218956 NULL 54443 32211 49866617 57908 123 252120702 1135821380 15862627961 154116 141218956 65740393535 65801428664 65599174579 35484 6926 -1448995523 -26471 122 1728676075 -6189260496 15862627961 -679431 141218956 8973074938 11079780223 8831855982 -36569 45118 439738328 56517 -2 2171332508 -559380590 15862627961 640723 1413111008 1942161073 2936465061 529050065 -18410 NULL NULL NULL NULL 1413111008 1413111008 1413111008 -18410 1413111008 1413111008 1413111008 NULL 7977 4956 1337043149 16312 -59 4104693490 5763298811 15862627961 233919 1413111008 42131665349 43486204682 40718554341 36636 45185 -928766616 43647 29 450275604 2212756264 15862627961 -427136 1413111008 15333577896 13191578758 13920466888 -4929 22467 1689098844 11267 -117 750085326 -2222183579 15862627961 354528 -1813935549 -405661362 -1078899005 1408274187 -28462 NULL NULL NULL NULL -1813935549 -1813935549 -1813935549 -28462 -1813935549 -1813935549 -1813935549 NULL -65798 3061 -1885422396 -11548 -60 -5581651801 -6731567910 15862627961 -51244 -1813935549 37995735862 36113442006 39809671411 20255 37793 427197269 59917 17 -2263607335 846995940 15862627961 -150993 -1813935549 14454353774 13231819784 16268289323 -9669 -10720 1489733240 36170 52 -6330479452 775314354 15862627961 879609 -2141451704 5974249258 5591766247 8115700962 -11122 NULL NULL NULL NULL -2141451704 -2141451704 -2141451704 -11122 -2141451704 -2141451704 -2141451704 NULL -8321 NULL NULL 37242 63 -4283450842 -8496974453 15862627961 -29777 -2141451704 18004627099 15862627961 20146078803 47750 27361 -842693467 -13608 73 -1049567811 -7024468539 15862627961 -658734 -2141451704 7746926999 6656687577 9888378703 -44727 27310 -382483011 60858 -101 2940130772 -3871666709 15862627961 867553 -1090239422 8115700962 5974249258 9205940384 -12056 NULL NULL NULL NULL -1090239422 -1090239422 -1090239422 -12056 -1090239422 -1090239422 -1090239422 NULL 14740 919 -1176490478 -3695 -107 -3410532238 -4040331793 15862627961 2439 -1090239422 53626707998 52482905660 54716947420 53780 36363 -1885422396 8900 -72 -1972491598 1796328434 15862627961 -647612 -1090239422 6656687577 5813994110 7746926999 --68124 -47322 2053379412 -57682 -101 5160673327 7362171447 15862627961 803727 2047637360 9293832357 9880676835 7246194997 -13181 NULL NULL NULL NULL 2047637360 2047637360 2047637360 -13181 2047637360 2047637360 2047637360 NULL 21975 -2269 2030965207 20462 -117 6111603729 8216396539 15862627961 217547 2047637360 12466574915 14499576077 10418937555 -48148 -27346 2143473091 -71880 -31 5218698356 6899004582 15862627961 -584911 2047637360 8616432964 8269443337 6568795604 --55203 -42978 -1899175111 -49963 17 2894556845 -2190825778 15862627961 771265 -1302295658 9362375800 9745728509 10664671458 15091 NULL NULL NULL NULL -1302295658 -1302295658 -1302295658 15091 -1302295658 -1302295658 -1302295658 NULL 17400 21659 -1339586153 29700 -117 -3973415001 -4845122464 15862627961 -15205 -1302295658 48781585534 47450052344 50083881192 -49576 -37351 2064155045 -57682 -25 -2287736392 3321754114 15862627961 -524177 -1302295658 5197956503 5868454401 6500252161 -74575 45185 1579876740 3056 71 -3553056774 -2085860747 15862627961 929454 -644225469 5379257015 6733796348 6023482484 -4667 NULL NULL NULL NULL -644225469 -644225469 -644225469 -4667 -644225469 -644225469 -644225469 NULL -6306 10643 -800561771 65588 -44 -2118024883 -2398685709 15862627961 5756 -644225469 60886848761 60213611118 61531074230 14062 -15328 -421042466 60858 29 -1285298976 -4140888104 15862627961 -702124 -644225469 9839145477 8499559324 10483370946 -57823 -22668 NULL -30544 125 3944161437 2125466408 15862627961 64578 912707948 16330286983 15862627961 15417579035 32064 NULL NULL NULL NULL 912707948 912707948 912707948 32064 912707948 912707948 912707948 NULL 63846 33380 794623392 -7782 29 2559840577 4267070199 15862627961 241709 912707948 55400583583 56253092820 54487875635 42295 -38196 240273900 5494 -86 1466043674 1845356201 15862627961 199483 912707948 445048926 -731441552 -467659022 --16856 -4018 -673237643 NULL 96 -187208211 828690732 15862627961 324341 -1222533990 1408274187 -405661362 2630808177 -30187 NULL NULL NULL NULL -1222533990 -1222533990 -1222533990 -30187 -1222533990 -1222533990 -1222533990 NULL 21368 5358 -1331533190 47831 125 -3856362838 -4633066228 15862627961 -45392 -1222533990 50083881192 48781585534 51306415182 -12838 NULL 659422734 -5985 65 828690732 -2114836321 15862627961 -122531 -1222533990 13231819784 13659017053 14454353774 -32242 52329 -1222533990 36986 -56 -86961173 3300694238 15862627961 263497 659422734 2203610908 2630808177 1544188174 -30508 NULL NULL NULL NULL 659422734 659422734 659422734 -30508 659422734 659422734 659422734 NULL -63957 -30932 586844478 29383 17 1869370730 2738973516 15862627961 106874 659422734 61264858032 61887961550 60605435298 -1210 18877 NULL 44641 96 550424758 2125466408 15862627961 -62008 659422734 14318439787 15862627961 13659017053 -11586 -54988 2033001162 8900 68 -408248030 2212756264 15862627961 693544 41423756 7308357291 8160866528 7266933535 16337 NULL NULL NULL NULL 41423756 41423756 41423756 16337 41423756 41423756 41423756 NULL 53369 23125 -108973366 8573 68 -71778992 293544458 15862627961 145543 41423756 65892719037 65888489655 65851295281 46693 -19881 -629486480 -33532 123 799645256 -2222183579 15862627961 -445210 41423756 8595694426 8645561043 8554270670 -33616 -12399 -537142430 -6115 49 2641271504 974546445 15862627961 367233 1955646088 15985872340 17409830136 14030226252 24896 NULL NULL NULL NULL 1955646088 1955646088 1955646088 24896 1955646088 1955646088 1955646088 NULL -4189 -3056 1824882165 -28798 102 5682552091 7965623834 15862627961 227806 1955646088 24496165118 26398188956 22540519030 12762 -33253 715235348 -31054 -59 2856840301 3300694238 15862627961 -110340 1955646088 1832401709 1244570379 -123244379 -17679 27241 -2141451704 -5985 74 26303141 -2140016957 15862627961 855069 -842693467 9205940384 8115700962 10048633851 -12484 NULL NULL NULL NULL -842693467 -842693467 -842693467 -12484 -842693467 -842693467 -842693467 NULL 38958 -791 -928766616 -9610 31 -2674776172 -2960718350 15862627961 15366 -842693467 58570355880 57667039791 59413049347 -14433 -4871 2053379412 32854 52 -2135787575 2057268348 15862627961 -635556 -842693467 5813994110 3928571714 6656687577 --13633 -2237 1902023838 -33528 -61 2937914773 -325765486 15862627961 946703 434021400 6075598454 6071369072 5641577054 -2376 NULL NULL NULL NULL 434021400 434021400 434021400 -2376 434021400 434021400 434021400 NULL -44761 -2174 427197269 -47906 -48 1292597347 2083707724 15862627961 185288 434021400 63348565756 63779944434 62914544356 -22116 -10720 -1011669561 11551 -111 3390925772 2308428293 15862627961 -717082 434021400 10221050907 8560624434 9787029507 --38792 -25184 -2141999138 20389 103 -759786886 -6189260496 15862627961 578848 -1908480893 3599815819 2671049203 5508296712 -21739 NULL NULL NULL NULL -1908480893 -1908480893 -1908480893 -21739 -1908480893 -1908480893 -1908480893 NULL 20191 27371 -1991133944 -21024 45 -5827242947 -7575372256 15862627961 -1758 -1908480893 30420363606 28492735496 32328844499 9669 23277 1282464673 2147 36 -6330479452 -325765486 15862627961 -368590 -1908480893 10354331249 10785709927 12262812142 -87389 NULL 912707948 40175 97 -83707341 -541722291 15862627961 125217 240273900 16594069513 15417579035 16353795613 29533 NULL NULL NULL NULL 240273900 240273900 240273900 29533 240273900 240273900 240273900 NULL 51186 -236 61035129 56537 -43 442527985 1392032876 15862627961 183649 240273900 65599174579 65740393535 65358900679 117434 30045 -1143802338 31106 125 -407508384 -83707341 15862627961 136313 240273900 -491167652 -1394483741 -731441552 -14062 11006 1413111008 -15056 -60 -1285298976 1303653581 15862627961 600587 -928766616 2671049203 529050065 3599815819 -21481 NULL NULL NULL NULL -928766616 -928766616 -928766616 -21481 -928766616 -928766616 -928766616 NULL 13355 -14960 -1011669561 39749 97 -2950092371 -3475337943 15862627961 -1256 -928766616 56738273175 55728616981 57667039791 -35127 -38183 431378678 29390 -2 -1045189740 -3184474087 15862627961 -390071 -928766616 12262812142 10354331249 13191578758 -33616 -12399 2030965207 -6115 13 2641271504 974546445 15862627961 866208 794623392 9618016673 9988992488 8823393281 12636 NULL NULL NULL NULL 794623392 794623392 794623392 12636 794623392 794623392 794623392 NULL 96002 46002 715235348 30466 123 2272791696 3554144565 15862627961 193025 794623392 57047716212 57810649168 56253092820 12762 -33253 1993193190 -31054 -43 2856840301 3300694238 15862627961 -621575 794623392 7039234680 8338954313 6244611288 -20255 8988 1824882165 43647 -38 -2263607335 -1339125374 15862627961 525969 -2138770630 10983774632 12172060572 13122545262 21456 NULL NULL NULL NULL -2138770630 -2138770630 -2138770630 21456 -2138770630 -2138770630 -2138770630 NULL -6276 -18655 -2141999138 29416 -59 -6422221472 -8346656693 15862627961 -8321 -2138770630 20146078803 18004627099 22284849433 38577 27310 -1009656194 -17538 68 -3241149212 -1025454778 15862627961 -272516 -2138770630 2740082699 3503015655 4878853329 -11625 36363 2051224722 -31438 97 -2878810989 -1380600149 15862627961 624311 -335410409 11452257685 11318043778 11787668094 18384 NULL NULL NULL NULL -335410409 -335410409 -335410409 18384 -335410409 -335410409 -335410409 NULL -5940 -16388 -382483011 34619 -79 -1064883047 -875807693 15862627961 92637 -335410409 64903708596 64556718969 65239119005 -17721 7017 2033001162 31696 118 -1441635278 -3888467183 15862627961 -373930 -335410409 4074959867 5668760271 4410370276 -22255 28868 -1302295658 2147 22 1874406893 5455080817 15862627961 799510 2064155045 9994173560 10664671458 7930018515 13788 NULL NULL NULL NULL 2064155045 2064155045 2064155045 13788 2064155045 2064155045 2064155045 NULL 15973 6135 2051224722 -6012 -56 6168759179 6314333421 15862627961 238009 2064155045 6314333421 8367712833 4250178376 -2090 4523 -1991133944 10843 17 6149069904 2245382708 15862627961 -553725 2064155045 7932609446 5833804210 5868454401 -47750 11580 -1448995523 39440 113 -1049567811 2291766377 15862627961 947475 -237425046 5017916272 6231843261 5255341318 5281 NULL NULL NULL NULL -237425046 -237425046 -237425046 5281 -237425046 -237425046 -237425046 NULL 11013 -22782 -346989627 33255 122 -919825082 -649370650 15862627961 97918 -237425046 65239119005 64903708596 65476544051 53530 17360 -2117946883 20389 -99 2759425399 -2709994284 15862627961 -710197 -237425046 10607286643 10498313277 10844711689 -117434 77259 1299719633 16302 122 -407508384 -1995762929 15862627961 901298 -1331533190 5530480458 7523673648 6862013648 10837 NULL NULL NULL NULL -1331533190 -1331533190 -1331533190 10837 -1331533190 -1331533190 -1331533190 NULL 55239 34790 -1383162419 16010 77 -4054281762 -5032853316 15862627961 -30296 -1331533190 47450052344 46110466191 48781585534 37269 -2906 141218956 87389 -101 -1574720463 -1583998862 15862627961 -658464 -1331533190 9000614313 8831855982 10332147503 --38792 -25184 2025611582 20389 36 -759786886 -6189260496 15862627961 712350 -1808210365 2191096542 2252131671 3999306907 -16312 NULL NULL NULL NULL -1808210365 -1808210365 -1808210365 -16312 -1808210365 -1808210365 -1808210365 NULL -84359 -36697 -1882293856 31902 -61 -5504439770 -6300794780 15862627961 -67556 -1808210365 39809671411 37995735862 41617881776 9669 23277 439738328 2147 30 -6330479452 -325765486 15862627961 -496665 -1808210365 11863321054 12486424572 13671531419 -54956 -546 397430452 -17958 -72 -774892077 -1392370326 15862627961 266156 -1383162419 16677615270 18003483588 18060777689 27138 NULL NULL NULL NULL -1383162419 -1383162419 -1383162419 27138 -1383162419 -1383162419 -1383162419 NULL 10111 -19200 -1660426473 20449 71 -4492584415 -5356577420 15862627961 -35654 -1383162419 44727303772 43278308249 46110466191 46712 -8790 -537142430 36986 70 -1775723035 1258109085 15862627961 -7021 -1383162419 -2198149728 -1010059745 -814987309 -41786 27361 NULL -5204 13 2529191423 5168794507 15862627961 32514 -467659022 15862627961 15862627961 16330286983 32514 NULL NULL NULL NULL -467659022 -467659022 -467659022 32514 -467659022 -467659022 -467659022 NULL 91279 40283 -587831330 -29605 112 -1592632782 -1618174126 15862627961 103858 -467659022 63285534470 62748392040 63753193492 12156 -2269 -1176490478 12207 NULL 3137829300 2291766377 15862627961 231997 -467659022 -467659022 445048926 NULL -59319 7837 -1991133944 11551 -5 1840350039 2245382708 15862627961 853572 370975815 9988992488 12019957695 9618016673 13080 NULL NULL NULL NULL 370975815 370975815 370975815 13080 370975815 370975815 370975815 NULL 50607 -7301 141218956 13121 -25 752468671 1578956245 15862627961 196729 370975815 65358900679 65599174579 64987924864 47245 -4237 1299719633 30451 -95 181227663 2427194517 15862627961 -608495 370975815 6244611288 7039234680 5873635473 --16856 -4018 762932956 NULL 118 -187208211 828690732 15862627961 586719 2051224722 13369268500 12359612306 11318043778 19316 NULL NULL NULL NULL 2051224722 2051224722 2051224722 19316 2051224722 2051224722 2051224722 NULL 25213 31720 2033001162 9838 93 6131863244 8275464464 15862627961 236863 2051224722 10418937555 12466574915 8367712833 -12838 NULL -335410409 -5985 47 828690732 -2114836321 15862627961 -335406 2051224722 4544584183 4410370276 2493359461 --7120 2479 -108973366 36740 -106 -888530120 846995940 15862627961 953631 1436496767 7482261567 5364314684 6045764800 194 NULL NULL NULL NULL 1436496767 1436496767 1436496767 194 1436496767 1436496767 1436496767 NULL -5953 -22265 1413111008 -43603 -12 4273565571 6050294921 15862627961 259399 1436496767 39294596545 40718554341 37858099778 -611 8988 1902023838 -29587 -59 2660931489 -2190825778 15862627961 -721440 1436496767 9816863161 7889235051 8380366394 -42295 72839 -1339586153 -31054 -12 1466043674 1253036374 15862627961 909464 702611616 7784111103 7363068637 7081499487 -7688 NULL NULL NULL NULL 702611616 702611616 702611616 -7688 702611616 702611616 702611616 NULL -18099 -47482 659422734 66746 -40 2032532248 2887221188 15862627961 113643 702611616 59934937400 60605435298 59232325784 -31090 -546 -382483011 80491 112 3395035512 1863474126 15862627961 -685155 702611616 8781128474 10270861714 8078516858 --68124 -47322 -134213907 -57682 1 5160673327 7362171447 15862627961 642478 1593800404 11787668094 11452257685 10193867690 18167 NULL NULL NULL NULL 1593800404 1593800404 1593800404 18167 1593800404 1593800404 1593800404 NULL -51962 -40668 1544188174 -29582 64 4717865318 6846112668 15862627961 233963 1593800404 33244301624 34824178364 31650501220 -48148 -27346 852509237 -71880 38 5218698356 6899004582 15862627961 -392314 1593800404 5668760271 7701761433 4074959867 --56933 -27346 -1090239422 -9599 93 -1044244963 437338198 15862627961 842457 -1885422396 10048633851 9205940384 11934056247 -12612 NULL NULL NULL NULL -1885422396 -1885422396 -1885422396 -12612 -1885422396 -1885422396 -1885422396 NULL -43877 -22853 -1908480893 -68859 -24 -5693078400 -7389862166 15862627961 1303 -1885422396 34228019610 32328844499 36113442006 -7120 22467 586844478 -12255 -101 -888530120 1009134449 15862627961 -623072 -1885422396 3928571714 5981951126 5813994110 --39770 -15328 623103518 5494 54 1609316679 1981771941 15862627961 659133 994303988 2936465061 3376203389 1942161073 -18218 NULL NULL NULL NULL 994303988 994303988 994303988 -18218 994303988 994303988 994303988 NULL 27948 29256 852509237 32012 -85 2759521173 4542648191 15862627961 223491 994303988 54487875635 55400583583 53493571647 -32689 -8247 -2141999138 -31438 -48 1584341489 1303653581 15862627961 -445354 994303988 13920466888 15333577896 12926162900 -34485 17970 -629486480 33142 77 -9207907 1195987713 15862627961 756174 383352709 9745728509 7846553398 9362375800 15295 NULL NULL NULL NULL 383352709 383352709 383352709 15295 383352709 383352709 383352709 NULL 94879 38342 240273900 -24360 14 994602424 1639359108 15862627961 212024 383352709 64987924864 65358900679 64604572155 24352 7837 670497898 -6115 45 433054757 -1392370326 15862627961 -508882 383352709 6500252161 5197956503 6116899452 -44727 27310 1955646088 60858 31 2940130772 -3871666709 15862627961 415116 715235348 14618057582 14030226252 13902822234 23388 NULL NULL NULL NULL 715235348 715235348 715235348 23388 715235348 715235348 715235348 NULL 73515 6769 702611616 50000 -38 2124288232 3125300933 15862627961 159645 715235348 58525884516 59232325784 57810649168 53780 36363 706441268 8900 49 -1972491598 1796328434 15862627961 -159731 715235348 1959805727 1159243956 1244570379 -35484 23277 -800561771 14425 68 1728676075 4109068163 15862627961 482937 1824882165 13996942737 14703384005 12172060572 22080 NULL NULL NULL NULL 1824882165 1824882165 1824882165 22080 1824882165 1824882165 1824882165 NULL -12886 -8359 1689098844 -1133 55 5252312264 7673725065 15862627961 204381 1824882165 28223071121 29961402376 26398188956 41786 29579 -2138770630 28558 -40 2529191423 775314354 15862627961 -228860 1824882165 3690567389 4878853329 1865685224 -68836 12398 715235348 10843 -82 2056218702 887668931 15862627961 460857 706441268 14703384005 13902822234 13996942737 22614 NULL NULL NULL NULL 706441268 706441268 706441268 22614 706441268 706441268 706441268 NULL 22263 -16051 670497898 56768 52 2079550782 2979232964 15862627961 136257 706441268 59232325784 59934937400 58525884516 54201 -2237 1188285940 33142 31 447930603 1519076272 15862627961 -206246 706441268 1865685224 3690567389 1159243956 --39770 -15328 -1011669561 5494 41 1609316679 1981771941 15862627961 934121 1354539333 6733796348 8313673088 5379257015 -3855 NULL NULL NULL NULL 1354539333 1354539333 1354539333 -3855 1354539333 1354539333 1354539333 NULL -4696 40365 1325868318 7070 54 4017450800 5628104904 15862627961 252329 1354539333 43486204682 44823247831 42131665349 -32689 -8247 -1339586153 -31438 -90 1584341489 1303653581 15862627961 -705979 1354539333 10483370946 9839145477 9128831613 --611 -37351 852509237 -33532 -44 2660931489 -1025454778 15862627961 709418 49866617 7266933535 7308357291 7217066918 15874 NULL NULL NULL NULL 49866617 49866617 49866617 15874 49866617 49866617 49866617 NULL 18051 1950 -4229382 22232 30 87060991 492394602 15862627961 161417 49866617 65851295281 65892719037 65801428664 31670 -5070 -1899175111 -9599 62 1113315852 3560913151 15862627961 -461547 49866617 8645561043 8016074563 8595694426 -54201 43358 41423756 -6613 45 447930603 2308428293 15862627961 725206 -629486480 7217066918 7266933535 7846553398 15788 NULL NULL NULL NULL -629486480 -629486480 -629486480 15788 -629486480 -629486480 -629486480 NULL 30673 -4943 -673237643 82314 49 -1946949592 -2222119262 15862627961 21544 -629486480 61531074230 60886848761 62160560710 22255 11412 383352709 56438 68 1874406893 1210863559 15862627961 -477421 -629486480 8016074563 6116899452 8645561043 --68124 -47322 -1176490478 -57682 57 5160673327 7362171447 15862627961 154323 -903316089 16353795613 16594069513 17257111702 29106 NULL NULL NULL NULL -903316089 -903316089 -903316089 29106 -903316089 -903316089 -903316089 NULL 12927 17786 -1009656194 -17427 -101 -2841738899 -3219808970 15862627961 27850 -903316089 57667039791 56738273175 58570355880 -48148 -27346 397430452 -71880 123 5218698356 6899004582 15862627961 106780 -903316089 -1394483741 -2538286079 -491167652 --55630 -46744 -1813935549 -12255 3 5156491918 3321754114 15862627961 294005 427197269 2630808177 1408274187 2203610908 -30336 NULL NULL NULL NULL 427197269 427197269 427197269 -30336 427197269 427197269 427197269 NULL 4015 28375 383352709 -42587 103 1207980430 1732335675 15862627961 209850 427197269 64207141703 64604572155 63779944434 -8499 387 1544188174 -12652 -117 4624049772 5587870596 15862627961 -92344 427197269 13659017053 14318439787 13231819784 -9669 -10720 1325868318 36170 -29 -6330479452 775314354 15862627961 291746 1188089983 18060777689 16677615270 16872687706 25590 NULL NULL NULL NULL 1188089983 1188089983 1188089983 25590 1188089983 1188089983 1188089983 NULL 45858 13846 994303988 4688 68 3354362251 4872767585 15862627961 233927 1188089983 52321603367 53493571647 51133513384 47750 27361 1423957796 -13608 -8 -1049567811 -7024468539 15862627961 -34159 1188089983 -1010059745 -1547202175 -2198149728 -87389 NULL 1593800404 40175 62 -83707341 -541722291 15862627961 677207 852509237 8160866528 10193867690 7308357291 16620 NULL NULL NULL NULL 852509237 852509237 852509237 16620 852509237 852509237 852509237 NULL 105452 44132 762932956 -1308 13 2410065585 3931489453 15862627961 209645 852509237 56253092820 57047716212 55400583583 117434 30045 49866617 31106 1 -407508384 -83707341 15862627961 -428590 852509237 8554270670 8595694426 7701761433 --22116 11412 1188089983 -26471 -5 3390925772 -7024468539 15862627961 342337 1423957796 17409830136 16872687706 15985872340 25286 NULL NULL NULL NULL 1423957796 1423957796 1423957796 25286 1423957796 1423957796 1423957796 NULL -19581 -26651 1354539333 -40474 71 4191608137 5894375977 15862627961 259205 1423957796 40718554341 42131665349 39294596545 -21948 11580 -587831330 -11396 -29 -6071106818 5455080817 15862627961 -85054 1423957796 -123244379 1832401709 -1547202175 --31020 23125 -1882293856 -12652 64 1208315423 6899004582 15862627961 437586 1738331255 2348531094 4339704068 610199839 -25136 NULL NULL NULL NULL 1738331255 1738331255 1738331255 -25136 1738331255 1738331255 1738331255 NULL -14350 15232 1593800404 45505 -82 5021230503 7420883346 15862627961 182301 1738331255 29961402376 31650501220 28223071121 -44611 9534 -673237643 16302 102 4160882907 1074101516 15862627961 -230725 1738331255 15252428122 16941526966 13514096867 -20625 6926 -1660426473 11361 29 2284185998 3645319585 15862627961 937976 1579876740 8313673088 7302003527 6733796348 -2935 NULL NULL NULL NULL 1579876740 1579876740 1579876740 -2935 1579876740 1579876740 1579876740 NULL -25242 -8974 1489733240 -33495 97 4613798154 6601107243 15862627961 215796 1579876740 34824178364 36368366538 33244301624 40940 27241 -644225469 39440 -107 5636453529 4109068163 15862627961 -708914 1579876740 9128831613 10483370946 7548954873 -77259 NULL -467659022 67120 123 -1176490478 -1583998862 15862627961 95684 -1176490478 15417579035 16330286983 16594069513 31106 NULL NULL NULL NULL -1176490478 -1176490478 -1176490478 31106 -1176490478 -1176490478 -1176490478 NULL 55628 25928 -1302295658 13821 57 -3701320126 -4422201799 15862627961 -14286 -1176490478 51306415182 50083881192 52482905660 98226 20967 -903316089 NULL 13 -252465672 -1176490478 15862627961 167419 -1176490478 -731441552 -491167652 445048926 -47245 35694 -1808210365 -11396 29 181227663 6588808232 15862627961 677351 439738328 3376203389 3999306907 2936465061 -18025 NULL NULL NULL NULL 439738328 439738328 439738328 -18025 439738328 439738328 439738328 NULL -85830 -52522 431378678 -60389 -31 1305138406 2309109058 15862627961 167263 439738328 62914544356 63348565756 62474806028 -13633 -25184 1413111008 51482 36 2937914773 887668931 15862627961 -463379 439738328 12926162900 13920466888 12486424572 -2003 30045 -644225469 -71880 5 -664229739 3739840441 15862627961 917152 -421042466 7363068637 6023482484 7784111103 -6823 NULL NULL NULL NULL -421042466 -421042466 -421042466 -6823 -421042466 -421042466 -421042466 NULL 65926 49800 -537142430 -4398 73 -1425843918 -1485925513 15862627961 97035 -421042466 63753193492 63285534470 64174235958 -74786 -46744 1489733240 33962 71 1748667467 -1995762929 15862627961 -691978 -421042466 8078516858 8781128474 8499559324 --74786 -2906 -928766616 -20802 73 1748667467 5587870596 15862627961 556662 431378678 5508296712 3599815819 5076918034 -22186 NULL NULL NULL NULL 431378678 431378678 431378678 -22186 431378678 431378678 431378678 NULL -11441 43457 397430452 -33308 -54 1256006399 1891982884 15862627961 187664 431378678 63779944434 64207141703 63348565756 -68124 3756 1337043149 -28042 -60 5160673327 1639694101 15862627961 -346851 431378678 10785709927 12068174600 10354331249 --1210 -38196 994303988 55502 36 550424758 714841163 15862627961 622068 -2141999138 529050065 1942161073 2671049203 -18655 NULL NULL NULL NULL -2141999138 -2141999138 -2141999138 -18655 -2141999138 -2141999138 -2141999138 NULL -29777 NULL NULL 12379 -72 -2141999138 -8540168355 15862627961 -18655 -2141999138 15862627961 15862627961 18004627099 54956 17970 -1908480893 -20087 54 -774892077 1253036374 15862627961 -408726 -2141999138 13191578758 12262812142 15333577896 -12762 18877 -421042466 16515 73 2856840301 -546350337 15862627961 900296 1489733240 7081499487 7784111103 5591766247 -9168 NULL NULL NULL NULL 1489733240 1489733240 1489733240 -9168 1489733240 1489733240 1489733240 NULL -33598 6876 1423957796 -16268 -56 4350187803 6207598558 15862627961 250231 1489733240 37858099778 39294596545 36368366538 34485 40600 -2141451704 46015 5 -9207907 714841163 15862627961 -677467 1489733240 10270861714 9888378703 8781128474 -57823 -22668 370975815 -30544 -101 3944161437 2125466408 15862627961 878821 1299719633 8823393281 9618016673 7523673648 12613 NULL NULL NULL NULL 1299719633 1299719633 1299719633 12613 1299719633 1299719633 1299719633 NULL 45053 27189 1213926989 1101 70 3796111295 5317170433 15862627961 251228 1299719633 47448835782 48731300455 46149116149 42295 -38196 -1331533190 5494 -5 1466043674 1845356201 15862627961 -634211 1299719633 8338954313 10332147503 7039234680 --8499 3756 2047637360 -29587 -85 4624049772 -144263301 15862627961 775806 2143473091 7593184624 7246194997 5449711533 -14704 NULL NULL NULL NULL 2143473091 2143473091 2143473091 -14704 2143473091 2143473091 2143473091 NULL -4866 1146 2064155045 NULL NULL 6314333421 2143473091 15862627961 231997 2143473091 2143473091 4250178376 NULL -56933 -44678 2025611582 -8886 -101 -1044244963 7362171447 15862627961 -558513 2143473091 10412916428 11584884708 8269443337 -98226 31106 1993193190 33962 -76 -252465672 -1743478794 15862627961 911428 -168758331 6862013648 5530480458 7030771979 10130 NULL NULL NULL NULL -168758331 -168758331 -168758331 10130 -168758331 -168758331 -168758331 NULL 39786 5167 -335410409 21158 118 -741593786 -416174986 15862627961 108048 -168758331 65476544051 65239119005 65645302382 90245 23125 2106705285 77259 120 -1634505428 -252465672 15862627961 -669301 -168758331 8831855982 8973074938 9000614313 -36394 -8247 141218956 -20087 -99 1160862510 1946039989 15862627961 936581 -1448995523 4782847738 6889553023 6231843261 7652 NULL NULL NULL NULL -1448995523 -1448995523 -1448995523 7652 -1448995523 -1448995523 -1448995523 NULL -12872 -44774 -1808210365 32496 -8 -4917632361 -5503277285 15862627961 -62792 -1448995523 43278308249 41617881776 44727303772 32242 -12399 -237425046 36430 -56 -86961173 2495165914 15862627961 -696932 -1448995523 9630784700 10844711689 11079780223 --21948 4523 -4229382 28558 -107 -6071106818 -2709994284 15862627961 943815 -1660426473 5641577054 6075598454 7302003527 -2888 NULL NULL NULL NULL -1660426473 -1660426473 -1660426473 -2888 -1660426473 -1660426473 -1660426473 NULL -64095 -52547 -1813935549 29311 12 -5282572387 -5832170568 15862627961 -70444 -1660426473 41617881776 39809671411 43278308249 -12381 14090 1579876740 -33528 -54 -2472569238 -2420213359 15862627961 -714706 -1660426473 8560624434 7548954873 10221050907 -2913 -2269 2106705285 -18079 -79 1253758252 -921860586 15862627961 942194 1213926989 6231843261 4782847738 5017916272 5613 NULL NULL NULL NULL 1213926989 1213926989 1213926989 5613 1213926989 1213926989 1213926989 NULL 15124 10436 1188089983 17864 73 3590302912 5121979613 15862627961 261116 1213926989 49945227444 51133513384 48731300455 1164 -4018 -108973366 11361 12 89808975 3279369834 15862627961 -704584 1213926989 10844711689 10607286643 9630784700 --7120 2479 1354539333 36740 112 -888530120 846995940 15862627961 923975 -1339586153 6023482484 5379257015 7363068637 -5479 NULL NULL NULL NULL -1339586153 -1339586153 -1339586153 -5479 -1339586153 -1339586153 -1339586153 NULL 37260 4764 -1448995523 -4259 120 -4171744095 -5195948991 15862627961 -41133 -1339586153 46110466191 44727303772 47450052344 -611 8988 702611616 -29587 41 2660931489 -2190825778 15862627961 -697457 -1339586153 8499559324 8078516858 9839145477 -12156 17360 2143473091 32854 30 3137829300 3279369834 15862627961 744772 2025611582 4277743253 5449711533 2252131671 -15880 NULL NULL NULL NULL 2025611582 2025611582 2025611582 -15880 2025611582 2025611582 2025611582 NULL 9709 338 1991172974 18539 -95 6009977746 8137215311 15862627961 199008 2025611582 18556152866 20549346056 16530541284 14039 19243 -1808210365 14425 -85 2065442845 4309797580 15862627961 -528655 2025611582 13610496290 13671531419 11584884708 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt deleted file mode 100644 index b0c7ec96fba0..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_lead_built_in_functions.slt +++ /dev/null @@ -1,129 +0,0 @@ -# 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. - -query IIIIIII -SELECT - c8, - LEAD(c8) OVER () next_c8, - LEAD(c8, 10, 10) OVER() next_10_c8, - LEAD(c8, 100, 10) OVER() next_out_of_bounds_c8, - LAG(c8) OVER() prev_c8, - LAG(c8, -2, 0) OVER() AS prev_2_c8, - LAG(c8, -200, 10) OVER() AS prev_out_of_bounds_c8 -FROM aggregate_test_100_by_sql -ORDER BY c8; ----- -102 33715 48099 10 31648 28086 10 -299 NULL 10 10 7781 0 10 -363 17910 40566 10 48048 27744 10 -417 18736 53000 10 45185 29458 10 -794 44507 49283 10 3583 40622 10 -829 33821 11872 10 61069 59663 10 -832 53012 2684 10 40622 48483 10 -1535 34970 48048 10 50842 2516 10 -2516 57594 17910 10 34970 36599 10 -2555 24770 34970 10 28086 53000 10 -2684 47061 57751 10 12876 14722 10 -2809 56980 3691 10 64517 27600 10 -2986 35477 28086 10 12757 45185 10 -3583 794 24022 10 35429 44507 10 -3691 50009 35429 10 63353 5494 10 -3975 59134 10 10 39363 30972 10 -4168 24022 829 10 15573 49283 10 -5382 12393 31648 10 24380 12757 10 -5494 21119 794 10 50009 52046 10 -7781 299 10 10 30972 0 10 -9489 52286 32712 10 14337 34331 10 -9832 20807 12393 10 34331 17835 10 -11872 39363 10 10 57885 3975 10 -12393 12757 102 10 5382 2986 10 -12757 2986 33715 10 12393 35477 10 -12876 2684 29527 10 45253 47061 10 -13763 15573 53815 10 48483 4168 10 -14337 9489 15777 10 43062 52286 10 -14722 53815 54276 10 47061 61069 10 -15573 4168 61069 10 13763 24022 10 -15777 32712 18736 10 62167 24380 10 -17835 57510 2986 10 20807 45465 10 -17910 27744 34206 10 363 20421 10 -18736 29458 39635 10 417 35106 10 -20120 57885 10 10 54276 11872 10 -20421 63353 23948 10 27744 3691 10 -20807 17835 12757 10 9832 57510 10 -21119 52046 44507 10 5494 40566 10 -21463 48099 56980 10 43655 50842 10 -23948 61637 13763 10 55620 35429 10 -24022 49283 33821 10 4168 45253 10 -24380 5382 35106 10 32712 12393 10 -24770 53000 2516 10 2555 39635 10 -27034 48048 21119 10 27600 363 10 -27600 27034 5494 10 56980 48048 10 -27744 20421 55620 10 17910 63353 10 -28086 2555 1535 10 33715 24770 10 -29458 35106 52569 10 18736 31648 10 -29527 57751 30972 10 30296 42171 10 -30296 29527 59134 10 59663 57751 10 -30972 7781 10 10 59134 299 10 -31648 102 21463 10 35106 33715 10 -32712 24380 29458 10 15777 5382 10 -33715 28086 50842 10 102 2555 10 -33821 59663 39363 10 829 30296 10 -34206 55620 53012 10 40566 23948 10 -34331 9832 5382 10 52286 20807 10 -34970 2516 363 10 1535 57594 10 -35106 31648 43655 10 29458 102 10 -35429 3583 4168 10 61637 794 10 -35477 45185 2555 10 2986 417 10 -36599 64517 20421 10 57594 2809 10 -39363 3975 10 10 11872 59134 10 -39635 52569 36599 10 53000 43655 10 -40566 34206 832 10 52046 55620 10 -40622 832 12876 10 44507 53012 10 -42171 54276 299 10 57751 20120 10 -43062 14337 62167 10 NULL 9489 10 -43655 21463 2809 10 52569 48099 10 -44507 40622 45253 10 794 832 10 -45185 417 24770 10 35477 18736 10 -45253 12876 30296 10 49283 2684 10 -45465 62167 45185 10 57510 15777 10 -47061 14722 42171 10 2684 53815 10 -48048 363 52046 10 27034 17910 10 -48099 50842 27600 10 21463 1535 10 -48483 13763 14722 10 53012 15573 10 -49283 45253 59663 10 24022 12876 10 -50009 5494 3583 10 3691 21119 10 -50842 1535 27034 10 48099 34970 10 -52046 40566 40622 10 21119 34206 10 -52286 34331 24380 10 9489 9832 10 -52569 43655 64517 10 39635 21463 10 -53000 39635 57594 10 24770 52569 10 -53012 48483 47061 10 832 13763 10 -53815 61069 20120 10 14722 829 10 -54276 20120 10 10 42171 57885 10 -55620 23948 48483 10 34206 61637 10 -56980 27600 50009 10 2809 27034 10 -57510 45465 35477 10 17835 62167 10 -57594 36599 27744 10 2516 64517 10 -57751 42171 7781 10 29527 54276 10 -57885 11872 10 10 20120 39363 10 -59134 30972 10 10 3975 7781 10 -59663 30296 3975 10 33821 29527 10 -61069 829 57885 10 53815 33821 10 -61637 35429 15573 10 23948 3583 10 -62167 15777 417 10 45465 32712 10 -63353 3691 61637 10 20421 50009 10 -64517 2809 63353 10 36599 56980 10 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt deleted file mode 100644 index a47d1fc0363f..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ordered_aggregation.slt +++ /dev/null @@ -1,129 +0,0 @@ -# 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. - -query IIIRIII -SELECT - c9, - row_number() OVER (ORDER BY c2, c9) AS row_number, - count(c3) OVER (ORDER BY c9) AS count_c3, - avg(c3) OVER (ORDER BY c2) AS avg_c3_by_c2, - sum(c3) OVER (ORDER BY c2) AS sum_c3_by_c2, - max(c3) OVER (ORDER BY c2) AS max_c3_by_c2, - min(c3) OVER (ORDER BY c2) AS min_c3_by_c2 -FROM aggregate_test_100_by_sql -ORDER BY row_number; ----- -225513085 1 6 16.681818181818 367 125 -99 -473294098 2 11 16.681818181818 367 125 -99 -520189543 3 12 16.681818181818 367 125 -99 -774637006 4 19 16.681818181818 367 125 -99 -879082834 5 21 16.681818181818 367 125 -99 -1454057357 6 34 16.681818181818 367 125 -99 -1842680163 7 40 16.681818181818 367 125 -99 -2125812933 8 46 16.681818181818 367 125 -99 -2610290479 9 56 16.681818181818 367 125 -99 -2669374863 10 57 16.681818181818 367 125 -99 -2712615025 11 59 16.681818181818 367 125 -99 -2830981072 12 62 16.681818181818 367 125 -99 -2861376515 13 64 16.681818181818 367 125 -99 -3275293996 14 72 16.681818181818 367 125 -99 -3276123488 15 73 16.681818181818 367 125 -99 -3542840110 16 82 16.681818181818 367 125 -99 -3625286410 17 87 16.681818181818 367 125 -99 -3766999078 18 90 16.681818181818 367 125 -99 -4015442341 19 94 16.681818181818 367 125 -99 -4076864659 20 96 16.681818181818 367 125 -99 -4216440507 21 98 16.681818181818 367 125 -99 -4229654142 22 99 16.681818181818 367 125 -99 -63044568 23 2 12.522727272727 551 125 -117 -141680161 24 4 12.522727272727 551 125 -117 -145294611 25 5 12.522727272727 551 125 -117 -598822671 26 16 12.522727272727 551 125 -117 -1000948272 27 24 12.522727272727 551 125 -117 -1098639440 28 27 12.522727272727 551 125 -117 -1157161427 29 28 12.522727272727 551 125 -117 -1289293657 30 31 12.522727272727 551 125 -117 -1491205016 31 35 12.522727272727 551 125 -117 -2013662838 32 43 12.522727272727 551 125 -117 -2293105904 33 48 12.522727272727 551 125 -117 -2525744318 34 54 12.522727272727 551 125 -117 -2705709344 35 58 12.522727272727 551 125 -117 -2844041986 36 63 12.522727272727 551 125 -117 -2939920218 37 66 12.522727272727 551 125 -117 -3188005828 38 70 12.522727272727 551 125 -117 -3314983189 39 74 12.522727272727 551 125 -117 -3398507249 40 77 12.522727272727 551 125 -117 -3455216719 41 78 12.522727272727 551 125 -117 -3717551163 42 88 12.522727272727 551 125 -117 -4061635107 43 95 12.522727272727 551 125 -117 -4144173353 44 97 12.522727272727 551 125 -117 -243203849 45 7 15.015873015873 946 125 -117 -431948861 46 9 15.015873015873 946 125 -117 -559847112 47 15 15.015873015873 946 125 -117 -754775609 48 18 15.015873015873 946 125 -117 -1088543984 49 26 15.015873015873 946 125 -117 -1362369177 50 32 15.015873015873 946 125 -117 -1538863055 51 37 15.015873015873 946 125 -117 -1824517658 52 39 15.015873015873 946 125 -117 -1995343206 53 42 15.015873015873 946 125 -117 -2093538928 54 45 15.015873015873 946 125 -117 -2214035726 55 47 15.015873015873 946 125 -117 -2592330556 56 55 15.015873015873 946 125 -117 -3105312559 57 68 15.015873015873 946 125 -117 -3473924576 58 80 15.015873015873 946 125 -117 -3577318119 59 85 15.015873015873 946 125 -117 -3759340273 60 89 15.015873015873 946 125 -117 -3862393166 61 91 15.015873015873 946 125 -117 -3959216334 62 92 15.015873015873 946 125 -117 -3998790955 63 93 15.015873015873 946 125 -117 -28774375 64 1 11.337209302326 975 125 -117 -326151275 65 8 11.337209302326 975 125 -117 -466439833 66 10 11.337209302326 975 125 -117 -538589788 67 13 11.337209302326 975 125 -117 -557517119 68 14 11.337209302326 975 125 -117 -811650497 69 20 11.337209302326 975 125 -117 -933879086 70 22 11.337209302326 975 125 -117 -1243785310 71 30 11.337209302326 975 125 -117 -1534194097 72 36 11.337209302326 975 125 -117 -1787652631 73 38 11.337209302326 975 125 -117 -1865307672 74 41 11.337209302326 975 125 -117 -2042457019 75 44 11.337209302326 975 125 -117 -2306130875 76 49 11.337209302326 975 125 -117 -2502326480 77 53 11.337209302326 975 125 -117 -2778168728 78 60 11.337209302326 975 125 -117 -2818832252 79 61 11.337209302326 975 125 -117 -3023531799 80 67 11.337209302326 975 125 -117 -3126475872 81 69 11.337209302326 975 125 -117 -3198969145 82 71 11.337209302326 975 125 -117 -3521368277 83 81 11.337209302326 975 125 -117 -3566741189 84 83 11.337209302326 975 125 -117 -3570297463 85 84 11.337209302326 975 125 -117 -3593959807 86 86 11.337209302326 975 125 -117 -141047417 87 3 7.81 781 125 -117 -662099130 88 17 7.81 781 125 -117 -974297360 89 23 7.81 781 125 -117 -1013876852 90 25 7.81 781 125 -117 -1229567292 91 29 7.81 781 125 -117 -1365198901 92 33 7.81 781 125 -117 -2307004493 93 50 7.81 781 125 -117 -2424630722 94 51 7.81 781 125 -117 -2496054700 95 52 7.81 781 125 -117 -2861911482 96 65 7.81 781 125 -117 -3342719438 97 75 7.81 781 125 -117 -3373581039 98 76 7.81 781 125 -117 -3457053821 99 79 7.81 781 125 -117 -4268716378 100 100 7.81 781 125 -117 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt deleted file mode 100644 index 3851387ec964..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_aggregation.slt +++ /dev/null @@ -1,129 +0,0 @@ -# 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. - -query IIIRIII -SELECT - c9, - row_number() OVER (PARTITION BY c2, c9) AS row_number, - count(c3) OVER (PARTITION BY c2) AS count_c3, - avg(c3) OVER (PARTITION BY c2) AS avg_c3_by_c2, - sum(c3) OVER (PARTITION BY c2) AS sum_c3_by_c2, - max(c3) OVER (PARTITION BY c2) AS max_c3_by_c2, - min(c3) OVER (PARTITION BY c2) AS min_c3_by_c2 -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- -28774375 1 23 1.260869565217 29 123 -117 -63044568 1 22 8.363636363636 184 122 -117 -141047417 1 14 -13.857142857143 -194 118 -101 -141680161 1 22 8.363636363636 184 122 -117 -145294611 1 22 8.363636363636 184 122 -117 -225513085 1 22 16.681818181818 367 125 -99 -243203849 1 19 20.789473684211 395 123 -101 -326151275 1 23 1.260869565217 29 123 -117 -431948861 1 19 20.789473684211 395 123 -101 -466439833 1 23 1.260869565217 29 123 -117 -473294098 1 22 16.681818181818 367 125 -99 -520189543 1 22 16.681818181818 367 125 -99 -538589788 1 23 1.260869565217 29 123 -117 -557517119 1 23 1.260869565217 29 123 -117 -559847112 1 19 20.789473684211 395 123 -101 -598822671 1 22 8.363636363636 184 122 -117 -662099130 1 14 -13.857142857143 -194 118 -101 -754775609 1 19 20.789473684211 395 123 -101 -774637006 1 22 16.681818181818 367 125 -99 -811650497 1 23 1.260869565217 29 123 -117 -879082834 1 22 16.681818181818 367 125 -99 -933879086 1 23 1.260869565217 29 123 -117 -974297360 1 14 -13.857142857143 -194 118 -101 -1000948272 1 22 8.363636363636 184 122 -117 -1013876852 1 14 -13.857142857143 -194 118 -101 -1088543984 1 19 20.789473684211 395 123 -101 -1098639440 1 22 8.363636363636 184 122 -117 -1157161427 1 22 8.363636363636 184 122 -117 -1229567292 1 14 -13.857142857143 -194 118 -101 -1243785310 1 23 1.260869565217 29 123 -117 -1289293657 1 22 8.363636363636 184 122 -117 -1362369177 1 19 20.789473684211 395 123 -101 -1365198901 1 14 -13.857142857143 -194 118 -101 -1454057357 1 22 16.681818181818 367 125 -99 -1491205016 1 22 8.363636363636 184 122 -117 -1534194097 1 23 1.260869565217 29 123 -117 -1538863055 1 19 20.789473684211 395 123 -101 -1787652631 1 23 1.260869565217 29 123 -117 -1824517658 1 19 20.789473684211 395 123 -101 -1842680163 1 22 16.681818181818 367 125 -99 -1865307672 1 23 1.260869565217 29 123 -117 -1995343206 1 19 20.789473684211 395 123 -101 -2013662838 1 22 8.363636363636 184 122 -117 -2042457019 1 23 1.260869565217 29 123 -117 -2093538928 1 19 20.789473684211 395 123 -101 -2125812933 1 22 16.681818181818 367 125 -99 -2214035726 1 19 20.789473684211 395 123 -101 -2293105904 1 22 8.363636363636 184 122 -117 -2306130875 1 23 1.260869565217 29 123 -117 -2307004493 1 14 -13.857142857143 -194 118 -101 -2424630722 1 14 -13.857142857143 -194 118 -101 -2496054700 1 14 -13.857142857143 -194 118 -101 -2502326480 1 23 1.260869565217 29 123 -117 -2525744318 1 22 8.363636363636 184 122 -117 -2592330556 1 19 20.789473684211 395 123 -101 -2610290479 1 22 16.681818181818 367 125 -99 -2669374863 1 22 16.681818181818 367 125 -99 -2705709344 1 22 8.363636363636 184 122 -117 -2712615025 1 22 16.681818181818 367 125 -99 -2778168728 1 23 1.260869565217 29 123 -117 -2818832252 1 23 1.260869565217 29 123 -117 -2830981072 1 22 16.681818181818 367 125 -99 -2844041986 1 22 8.363636363636 184 122 -117 -2861376515 1 22 16.681818181818 367 125 -99 -2861911482 1 14 -13.857142857143 -194 118 -101 -2939920218 1 22 8.363636363636 184 122 -117 -3023531799 1 23 1.260869565217 29 123 -117 -3105312559 1 19 20.789473684211 395 123 -101 -3126475872 1 23 1.260869565217 29 123 -117 -3188005828 1 22 8.363636363636 184 122 -117 -3198969145 1 23 1.260869565217 29 123 -117 -3275293996 1 22 16.681818181818 367 125 -99 -3276123488 1 22 16.681818181818 367 125 -99 -3314983189 1 22 8.363636363636 184 122 -117 -3342719438 1 14 -13.857142857143 -194 118 -101 -3373581039 1 14 -13.857142857143 -194 118 -101 -3398507249 1 22 8.363636363636 184 122 -117 -3455216719 1 22 8.363636363636 184 122 -117 -3457053821 1 14 -13.857142857143 -194 118 -101 -3473924576 1 19 20.789473684211 395 123 -101 -3521368277 1 23 1.260869565217 29 123 -117 -3542840110 1 22 16.681818181818 367 125 -99 -3566741189 1 23 1.260869565217 29 123 -117 -3570297463 1 23 1.260869565217 29 123 -117 -3577318119 1 19 20.789473684211 395 123 -101 -3593959807 1 23 1.260869565217 29 123 -117 -3625286410 1 22 16.681818181818 367 125 -99 -3717551163 1 22 8.363636363636 184 122 -117 -3759340273 1 19 20.789473684211 395 123 -101 -3766999078 1 22 16.681818181818 367 125 -99 -3862393166 1 19 20.789473684211 395 123 -101 -3959216334 1 19 20.789473684211 395 123 -101 -3998790955 1 19 20.789473684211 395 123 -101 -4015442341 1 22 16.681818181818 367 125 -99 -4061635107 1 22 8.363636363636 184 122 -117 -4076864659 1 22 16.681818181818 367 125 -99 -4144173353 1 22 8.363636363636 184 122 -117 -4216440507 1 22 16.681818181818 367 125 -99 -4229654142 1 22 16.681818181818 367 125 -99 -4268716378 1 14 -13.857142857143 -194 118 -101 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt deleted file mode 100644 index 86f3fb94ed16..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_partition_order_aggregation.slt +++ /dev/null @@ -1,129 +0,0 @@ -# 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. - -query IIIRIII -SELECT - c9, - row_number() OVER (PARTITION BY c2 ORDER BY c9) AS row_number, - count(c3) OVER (PARTITION BY c2 ORDER BY c9) AS count_c3, - avg(c3) OVER (PARTITION BY c2 ORDER BY c9) AS avg_c3_by_c2, - sum(c3) OVER (PARTITION BY c2 ORDER BY c9) AS sum_c3_by_c2, - max(c3) OVER (PARTITION BY c2 ORDER BY c9) AS max_c3_by_c2, - min(c3) OVER (PARTITION BY c2 ORDER BY c9) AS min_c3_by_c2 -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- -28774375 1 1 30 30 30 30 -63044568 1 1 113 113 113 113 -141047417 1 1 36 36 36 36 -141680161 2 2 3.5 7 113 -106 -145294611 3 3 17.333333333333 52 113 -106 -225513085 1 1 -98 -98 -98 -98 -243203849 1 1 -101 -101 -101 -101 -326151275 2 2 38.5 77 47 30 -431948861 2 2 -43.5 -87 14 -101 -466439833 3 3 -8 -24 47 -101 -473294098 2 2 -14 -28 70 -98 -520189543 3 3 -17.333333333333 -52 70 -98 -538589788 4 4 12.25 49 73 -101 -557517119 5 5 -1.4 -7 73 -101 -559847112 3 3 -60.666666666667 -182 14 -101 -598822671 4 4 5.75 23 113 -106 -662099130 2 2 50 100 64 36 -754775609 4 4 -41.25 -165 17 -101 -774637006 4 4 -34.25 -137 70 -98 -811650497 6 6 8 48 73 -101 -879082834 5 5 -16 -80 70 -98 -933879086 7 7 9.285714285714 65 73 -101 -974297360 3 3 56 168 68 36 -1000948272 5 5 23.2 116 113 -106 -1013876852 4 4 34.25 137 68 -31 -1088543984 5 5 -18.4 -92 73 -101 -1098639440 6 6 24.5 147 113 -106 -1157161427 7 7 5.714285714286 40 113 -107 -1229567292 5 5 51 255 118 -31 -1243785310 8 8 -5.75 -46 73 -111 -1289293657 8 8 11.125 89 113 -107 -1362369177 6 6 -11.666666666667 -70 73 -101 -1365198901 6 6 32.666666666667 196 118 -59 -1454057357 6 6 -22.666666666667 -136 70 -98 -1491205016 9 9 10 90 113 -107 -1534194097 9 9 6.222222222222 56 102 -111 -1538863055 7 7 -7.571428571429 -53 73 -101 -1787652631 10 10 1.8 18 102 -111 -1824517658 8 8 -16.125 -129 73 -101 -1842680163 7 7 -11.714285714286 -82 70 -98 -1865307672 11 11 7.545454545455 83 102 -111 -1995343206 9 9 -22.333333333333 -201 73 -101 -2013662838 10 10 14.2 142 113 -107 -2042457019 12 12 15 180 102 -111 -2093538928 10 10 -12.4 -124 77 -101 -2125812933 8 8 -5.125 -41 70 -98 -2214035726 11 11 -10.090909090909 -111 77 -101 -2293105904 11 11 2.272727272727 25 113 -117 -2306130875 13 13 14.076923076923 183 102 -111 -2307004493 7 7 36.857142857143 258 118 -59 -2424630722 8 8 31.625 253 118 -59 -2496054700 9 9 16.888888888889 152 118 -101 -2502326480 14 14 9.214285714286 129 102 -111 -2525744318 12 12 -2.916666666667 -35 113 -117 -2592330556 12 12 1 12 123 -101 -2610290479 9 9 -0.555555555556 -5 70 -98 -2669374863 10 10 -1 -10 70 -98 -2705709344 13 13 2.153846153846 28 113 -117 -2712615025 11 11 2.545454545455 28 70 -98 -2778168728 15 15 5.066666666667 76 102 -111 -2818832252 16 16 -0.1875 -3 102 -111 -2830981072 12 12 12.333333333333 148 120 -98 -2844041986 14 14 -2.285714285714 -32 113 -117 -2861376515 13 13 10.769230769231 140 120 -98 -2861911482 10 10 6.6 66 118 -101 -2939920218 15 15 -5 -75 113 -117 -3023531799 17 17 -7.058823529412 -120 102 -117 -3105312559 13 13 6.384615384615 83 123 -101 -3126475872 18 18 -6.388888888889 -115 102 -117 -3188005828 16 16 1.375 22 113 -117 -3198969145 19 19 -2.157894736842 -41 102 -117 -3275293996 14 14 12.071428571429 169 120 -98 -3276123488 15 15 9.6 144 120 -98 -3314983189 17 17 4.352941176471 74 113 -117 -3342719438 11 11 -1.454545454545 -16 118 -101 -3373581039 12 12 -4.666666666667 -56 118 -101 -3398507249 18 18 5.722222222222 103 113 -117 -3455216719 19 19 9 171 113 -117 -3457053821 13 13 -7.692307692308 -100 118 -101 -3473924576 14 14 12.857142857143 180 123 -101 -3521368277 20 20 2.75 55 102 -117 -3542840110 16 16 4.5 72 120 -98 -3566741189 21 21 8.47619047619 178 123 -117 -3570297463 22 22 5.409090909091 119 123 -117 -3577318119 15 15 18.933333333333 284 123 -101 -3593959807 23 23 1.260869565217 29 123 -117 -3625286410 17 17 11.588235294118 197 125 -98 -3717551163 20 20 6.15 123 113 -117 -3759340273 16 16 24.75 396 123 -101 -3766999078 18 18 16.666666666667 300 125 -98 -3862393166 17 17 23.176470588235 394 123 -101 -3959216334 18 18 21.222222222222 382 123 -101 -3998790955 19 19 20.789473684211 395 123 -101 -4015442341 19 19 20.157894736842 383 125 -98 -4061635107 21 21 11.666666666667 245 122 -117 -4076864659 20 20 19.75 395 125 -98 -4144173353 22 22 8.363636363636 184 122 -117 -4216440507 21 21 14.095238095238 296 125 -99 -4229654142 22 22 16.681818181818 367 125 -99 -4268716378 14 14 -13.857142857143 -194 118 -101 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt deleted file mode 100644 index b81b2207be1a..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_range.slt +++ /dev/null @@ -1,132 +0,0 @@ -# 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. - -query IIIIIIIIII -SELECT - SUM(c5) OVER(ORDER BY c4 RANGE BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation2, - SUM(c4) OVER(ORDER BY c3 RANGE 3 PRECEDING) as summation3, - SUM(c4) OVER(ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation6, - SUM(c4) OVER(ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation7, - SUM(c2) OVER(PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation10, - SUM(c4) OVER(PARTITION BY c1 ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation11, - SUM(c2) OVER(PARTITION BY c1 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation14, - SUM(c4) OVER(PARTITION BY c5 ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation15, - SUM(c2) OVER(PARTITION BY c5, c7, c9 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation20, - SUM(c2) OVER(PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation21 -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- -61035129 -38183 231997 145307 4 -9603 63 -16110 4 4 --108973366 -2906 231997 131173 2 150222 44 3917 2 2 -623103518 -38455 231997 137382 5 -30140 60 -16974 5 5 --1927628110 -4018 231997 19981 2 -6028 56 -1114 2 2 --1899175111 15673 231997 13915 2 4551 60 15673 2 2 --1991133944 5182 231997 21095 1 15675 44 13630 1 1 --346989627 -14061 231997 74253 3 25687 62 -13217 3 3 --1009656194 36363 231997 20225 4 28059 62 20690 4 4 -397430452 80491 231997 240186 3 20142 60 28162 3 3 -1993193190 -14061 231997 214888 4 12439 60 11640 4 4 -1325868318 65202 231997 278980 1 -23170 56 27752 1 1 --1882293856 -8790 231997 -22782 1 -30113 56 -24085 1 1 -1282464673 -9599 231997 238615 4 -39052 63 -22501 4 4 -1544188174 4523 231997 218731 4 -70358 63 -31500 4 4 -2030965207 27241 231997 212619 3 -90242 63 13611 3 3 --537142430 12398 231997 71344 2 -29772 56 25305 2 2 -1689098844 11267 231997 207437 5 -78717 63 -26526 5 5 -1337043149 -8247 231997 256184 3 9967 60 -22796 3 3 -1171968280 17360 231997 208337 1 20150 60 -15154 1 1 -1902023838 -8549 231997 202910 4 233222 44 -1471 4 4 --1143802338 8900 231997 14495 1 117791 44 28781 1 1 --673237643 -8247 231997 10423 4 23116 62 -28070 4 4 -1188285940 8988 231997 255503 5 73746 62 21576 5 5 -2053379412 -12642 231997 224221 2 196022 44 -12642 2 2 -586844478 -12907 231997 154356 5 -13166 60 -12907 5 5 --382483011 -9599 231997 87470 3 -39337 56 -9565 3 3 --800561771 -15056 231997 38493 2 51186 62 23127 2 2 --1011669561 -2904 231997 -465 2 -79516 56 -2904 2 2 --134213907 19208 231997 127256 5 -14848 56 19208 5 5 --4229382 -1967 231997 129206 4 23720 62 -1967 4 4 --587831330 45185 231997 46039 2 -19184 63 24495 2 2 --2098805236 13741 231997 7465 3 -4914 56 13741 3 3 --2117946883 -13608 231997 -6276 5 2045 44 2045 5 5 -2106705285 4523 231997 246701 1 21131 60 8692 1 1 -2033001162 -546 231997 230728 2 -27731 56 18109 2 2 -1991172974 -24558 231997 203248 4 208664 44 -24558 4 4 -670497898 -8247 231997 121331 3 70388 62 14457 3 3 -762932956 43358 231997 180389 4 -9396 60 20744 4 4 -141218956 14090 231997 154116 3 159031 44 8809 3 3 -1413111008 -7078 231997 233919 1 55336 62 -18410 1 1 --1813935549 -17195 231997 -51244 4 -23911 60 -28462 4 4 --2141451704 14468 231997 -29777 3 -11122 60 -11122 3 3 --1090239422 35827 231997 2439 2 -22198 63 -12056 2 2 -2047637360 3756 231997 217547 4 -103423 63 -13181 4 4 --1302295658 2479 231997 -15205 3 57904 44 15091 3 3 --644225469 13717 231997 5756 1 -55077 56 -4667 1 1 -912707948 52329 231997 241709 3 35304 60 32064 3 3 --1222533990 -10871 231997 -45392 2 -76612 56 -30187 2 2 -659422734 -12399 231997 106874 4 -67542 56 -30508 4 4 -41423756 16337 231997 145543 5 40057 62 16337 5 5 -1955646088 64670 231997 227806 5 127598 62 24896 5 5 --842693467 -14061 231997 15366 5 -36395 60 -12484 5 5 -434021400 -25184 231997 185288 4 17766 60 -2376 4 4 --1908480893 -40939 231997 -1758 2 -283 62 -21739 2 2 -240273900 67120 231997 183649 3 188564 44 29533 3 3 --928766616 -38455 231997 -1256 1 -43679 63 -21481 1 1 -794623392 64670 231997 193025 1 3240 60 12636 1 1 --2138770630 37793 231997 -8321 2 21456 62 21456 2 2 --335410409 -20071 231997 92637 1 136175 44 18384 1 1 -2064155045 -11396 231997 238009 4 -89635 63 13788 4 4 --237425046 27361 231997 97918 4 -34056 56 5281 4 4 --1331533190 30045 231997 -30296 1 -10142 63 10837 1 1 --1808210365 -40939 231997 -67556 2 -46425 56 -16312 2 2 --1383162419 27138 231997 -35654 1 42813 44 27138 1 1 --467659022 32514 231997 103858 5 13330 63 32514 5 5 -370975815 28868 231997 196729 2 -23315 60 13080 2 2 -2051224722 -10871 231997 236863 4 146914 62 19316 4 4 -1436496767 59917 231997 259399 3 -38858 63 194 3 3 -702611616 -38196 231997 113643 4 180876 44 -7688 4 4 -1593800404 3756 231997 233963 2 -52191 63 18167 2 2 --1885422396 -49963 231997 1303 4 -12612 63 -12612 4 4 -994303988 -22073 231997 223491 1 52170 62 -18218 1 1 -383352709 15295 231997 212024 1 -8020 60 15295 1 1 -715235348 35827 231997 159645 2 -16551 63 23388 2 2 -1824882165 6926 231997 204381 5 102702 62 22080 5 5 -706441268 35694 231997 136257 5 203490 44 22614 5 5 -1354539333 -22073 231997 252329 2 -27025 56 -3855 2 2 -49866617 8988 231997 161417 2 55931 62 15874 2 2 --629486480 15788 231997 21544 5 38904 62 15788 5 5 --903316089 3756 231997 27850 3 -50410 56 29106 3 3 -427197269 -42978 231997 209850 4 -39939 63 -30336 4 4 -1188089983 14468 231997 233927 1 229080 44 25590 1 1 -852509237 67120 231997 209645 4 -50922 56 16620 4 4 -1423957796 -13608 231997 259205 4 80622 62 25286 4 4 -1738331255 -71880 231997 182301 3 -103853 63 -25136 3 3 -1579876740 -2935 231997 215796 4 -29960 56 -2935 4 4 --1176490478 87389 231997 -14286 1 89010 44 31106 1 1 -439738328 -18025 231997 167263 2 -259 60 -18025 2 2 --421042466 -6823 231997 97035 3 6507 63 -6823 3 3 -431378678 -46744 231997 187664 1 -37034 56 -22186 1 1 --2141999138 18877 231997 -18655 3 -18655 56 -18655 3 3 -1489733240 -9168 231997 250231 3 799 60 -9168 3 3 -1299719633 52329 231997 251228 3 32763 60 12613 3 3 -2143473091 -14704 231997 231997 1 6427 60 -14704 1 1 --168758331 20967 231997 108048 2 146305 44 10130 2 2 --1448995523 7652 231997 -62792 1 7369 62 7652 1 1 --1660426473 -2888 231997 -70444 2 -15500 63 -2888 2 2 -1213926989 -8448 231997 261116 1 234693 44 5613 1 1 --1339586153 59917 231997 -41133 1 -20979 63 -5479 1 1 -2025611582 -2269 231997 199008 5 -45840 56 -15880 5 5 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt deleted file mode 100644 index 92e587409035..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_window_ranked_built_in_functions.slt +++ /dev/null @@ -1,127 +0,0 @@ -# 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. - -query IIIII -select - c9, - cume_dist() OVER (PARTITION BY c2 ORDER BY c3) cume_dist_by_c3, - rank() OVER (PARTITION BY c2 ORDER BY c3) rank_by_c3, - dense_rank() OVER (PARTITION BY c2 ORDER BY c3) dense_rank_by_c3, - percent_rank() OVER (PARTITION BY c2 ORDER BY c3) percent_rank_by_c3 -FROM aggregate_test_100_by_sql -ORDER BY c9; ----- -28774375 0.608695652174 14 14 0.590909090909 -63044568 0.954545454545 21 19 0.952380952381 -141047417 0.714285714286 10 10 0.692307692308 -141680161 0.136363636364 3 3 0.095238095238 -145294611 0.590909090909 13 12 0.571428571429 -225513085 0.090909090909 2 2 0.047619047619 -243203849 0.052631578947 1 1 0 -326151275 0.652173913043 15 15 0.636363636364 -431948861 0.473684210526 9 8 0.444444444444 -466439833 0.130434782609 3 3 0.090909090909 -473294098 0.772727272727 17 17 0.761904761905 -520189543 0.318181818182 7 7 0.285714285714 -538589788 0.782608695652 18 18 0.772727272727 -557517119 0.304347826087 7 7 0.272727272727 -559847112 0.105263157895 2 2 0.055555555556 -598822671 0.409090909091 9 8 0.380952380952 -662099130 0.857142857143 12 12 0.846153846154 -754775609 0.578947368421 10 9 0.5 -774637006 0.136363636364 3 3 0.095238095238 -811650497 0.695652173913 16 16 0.681818181818 -879082834 0.727272727273 16 16 0.714285714286 -933879086 0.565217391304 13 13 0.545454545455 -974297360 0.928571428571 13 13 0.923076923077 -1000948272 0.863636363636 19 17 0.857142857143 -1013876852 0.571428571429 8 8 0.538461538462 -1088543984 0.736842105263 14 12 0.722222222222 -1098639440 0.545454545455 12 11 0.52380952381 -1157161427 0.090909090909 2 2 0.047619047619 -1229567292 1 14 14 1 -1243785310 0.086956521739 2 2 0.045454545455 -1289293657 0.636363636364 14 13 0.619047619048 -1362369177 0.631578947368 12 10 0.611111111111 -1365198901 0.357142857143 5 5 0.307692307692 -1454057357 0.227272727273 5 5 0.190476190476 -1491205016 0.454545454545 10 9 0.428571428571 -1534194097 0.95652173913 22 22 0.954545454545 -1538863055 0.578947368421 10 9 0.5 -1787652631 0.434782608696 10 10 0.409090909091 -1824517658 0.157894736842 3 3 0.111111111111 -1842680163 0.681818181818 15 15 0.666666666667 -1865307672 0.739130434783 17 17 0.727272727273 -1995343206 0.210526315789 4 4 0.166666666667 -2013662838 0.727272727273 15 14 0.666666666667 -2042457019 0.913043478261 21 21 0.909090909091 -2093538928 0.789473684211 15 13 0.777777777778 -2125812933 0.636363636364 14 14 0.619047619048 -2214035726 0.421052631579 7 7 0.333333333333 -2293105904 0.045454545455 1 1 0 -2306130875 0.478260869565 11 11 0.454545454545 -2307004493 0.785714285714 11 11 0.769230769231 -2424630722 0.642857142857 9 9 0.615384615385 -2496054700 0.071428571429 1 1 0 -2502326480 0.347826086957 8 8 0.318181818182 -2525744318 0.272727272727 5 5 0.190476190476 -2592330556 1 19 17 1 -2610290479 0.545454545455 12 12 0.52380952381 -2669374863 0.409090909091 9 9 0.380952380952 -2705709344 0.772727272727 17 15 0.761904761905 -2712615025 0.590909090909 13 13 0.571428571429 -2778168728 0.391304347826 9 9 0.363636363636 -2818832252 0.217391304348 5 5 0.181818181818 -2830981072 0.954545454545 21 21 0.952380952381 -2844041986 0.272727272727 5 5 0.190476190476 -2861376515 0.363636363636 8 8 0.333333333333 -2861911482 0.214285714286 3 3 0.153846153846 -2939920218 0.363636363636 8 7 0.333333333333 -3023531799 0.04347826087 1 1 0 -3105312559 0.684210526316 13 11 0.666666666667 -3126475872 0.521739130435 12 12 0.5 -3188005828 0.909090909091 20 18 0.904761904762 -3198969145 0.826086956522 19 19 0.818181818182 -3275293996 0.5 11 11 0.47619047619 -3276123488 0.272727272727 6 6 0.238095238095 -3314983189 0.727272727273 15 14 0.666666666667 -3342719438 0.285714285714 4 4 0.230769230769 -3373581039 0.5 7 7 0.461538461538 -3398507249 0.5 11 10 0.47619047619 -3455216719 0.818181818182 18 16 0.809523809524 -3457053821 0.428571428571 6 6 0.384615384615 -3473924576 0.842105263158 16 14 0.833333333333 -3521368277 0.869565217391 20 20 0.863636363636 -3542840110 0.181818181818 4 4 0.142857142857 -3566741189 1 23 23 1 -3570297463 0.260869565217 6 6 0.227272727273 -3577318119 0.894736842105 17 15 0.888888888889 -3593959807 0.173913043478 4 4 0.136363636364 -3625286410 1 22 22 1 -3717551163 0.318181818182 7 6 0.285714285714 -3759340273 0.947368421053 18 16 0.944444444444 -3766999078 0.909090909091 20 20 0.904761904762 -3862393166 0.315789473684 6 6 0.277777777778 -3959216334 0.263157894737 5 5 0.222222222222 -3998790955 0.421052631579 7 7 0.333333333333 -4015442341 0.863636363636 19 19 0.857142857143 -4061635107 1 22 20 1 -4076864659 0.454545454545 10 10 0.428571428571 -4144173353 0.181818181818 4 4 0.142857142857 -4216440507 0.045454545455 1 1 0 -4229654142 0.818181818182 18 18 0.809523809524 -4268716378 0.142857142857 2 2 0.076923076923 diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt b/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt deleted file mode 100644 index c47b0cd9fe6b..000000000000 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/values_list.slt +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -query IRII -SELECT * FROM -(VALUES (1,2.0,-3,1+1),(10,20.0,-30,2+2)) -AS tbl(int_col, float_col, negative_col, summation); ----- -1 2 -3 2 -10 20 -30 4 diff --git a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs index 7d5c9be20fca..475098addd27 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs @@ -1,7 +1,5 @@ use half::f16; -use log::info; use rust_decimal::Decimal; -use sqlparser::ast::DataType::Dec; use rust_decimal::prelude::*; use bigdecimal::BigDecimal; diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs index 317548b47fcb..96efca84a054 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs @@ -34,12 +34,12 @@ mod normalize; pub struct DataFusion { ctx: SessionContext, file_name: String, - postgres_compatible: bool + is_pg_compatibility_test: bool, } impl DataFusion { pub fn new(ctx: SessionContext, file_name: String, postgres_compatible: bool) -> Self { - Self { ctx, file_name, postgres_compatible } + Self { ctx, file_name, is_pg_compatibility_test: postgres_compatible } } } @@ -49,7 +49,7 @@ impl sqllogictest::AsyncDB for DataFusion { async fn run(&mut self, sql: &str) -> Result { println!("[{}] Running query: \"{}\"", self.file_name, sql); - let result = run_query(&self.ctx, sql, self.postgres_compatible).await?; + let result = run_query(&self.ctx, sql, self.is_pg_compatibility_test).await?; Ok(result) } @@ -68,7 +68,7 @@ impl sqllogictest::AsyncDB for DataFusion { } } -async fn run_query(ctx: &SessionContext, sql: impl Into, postgres_compatible: bool) -> Result { +async fn run_query(ctx: &SessionContext, sql: impl Into, is_pg_compatibility_test: bool) -> Result { let sql = sql.into(); // Check if the sql is `insert` if let Ok(mut statements) = DFParser::parse_sql(&sql) { @@ -82,6 +82,6 @@ async fn run_query(ctx: &SessionContext, sql: impl Into, postgres_compat } let df = ctx.sql(sql.as_str()).await?; let results: Vec = df.collect().await?; - let formatted_batches = normalize::convert_batches(results, postgres_compatible)?; + let formatted_batches = normalize::convert_batches(results, is_pg_compatibility_test)?; Ok(formatted_batches) } diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs index 2a0a9d610682..d48cf74fa027 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs @@ -16,7 +16,6 @@ // under the License. use arrow::{array, array::ArrayRef, datatypes::DataType, record_batch::RecordBatch}; -use arrow::error::ArrowError; use sqllogictest::{ColumnType, DBOutput}; use datafusion::error::DataFusionError; @@ -27,7 +26,7 @@ use super::error::{DFSqlLogicTestError, Result}; /// /// Assumes empty record batches are a successful statement completion /// -pub fn convert_batches(batches: Vec, postgres_compatible: bool) -> Result { +pub fn convert_batches(batches: Vec, is_pg_compatibility_test: bool) -> Result { if batches.is_empty() { // DataFusion doesn't report number of rows complete return Ok(DBOutput::StatementComplete(0)); @@ -51,20 +50,20 @@ pub fn convert_batches(batches: Vec, postgres_compatible: bool) -> ), ))); } - rows.append(&mut convert_batch(batch, postgres_compatible)?); + rows.append(&mut convert_batch(batch, is_pg_compatibility_test)?); } Ok(DBOutput::Rows { types, rows }) } /// Convert a single batch to a `Vec>` for comparison -fn convert_batch(batch: RecordBatch, postgres_compatible: bool) -> Result>> { +fn convert_batch(batch: RecordBatch, is_pg_compatibility_test: bool) -> Result>> { (0..batch.num_rows()) .map(|row| { batch .columns() .iter() - .map(|col| cell_to_string(col, row, postgres_compatible)) + .map(|col| cell_to_string(col, row, is_pg_compatibility_test)) .collect::>>() }) .collect() @@ -78,19 +77,6 @@ macro_rules! get_row_value { }}; } -macro_rules! get_string_value { - ($array_type:ty, $column: ident, $row: ident) => {{ - let array = $column.as_any().downcast_ref::<$array_type>().unwrap(); - - let s = array.value($row); - if s.is_empty() { - "(empty)".to_string() - } else { - s.to_string() - } - }}; -} - /// Normalizes the content of a single cell in RecordBatch prior to printing. /// /// This is to make the output comparable to the semi-standard .slt format @@ -101,12 +87,12 @@ macro_rules! get_string_value { /// /// Floating numbers are rounded to have a consistent representation with the Postgres runner. /// -pub fn cell_to_string(col: &ArrayRef, row: usize, postgres_compatible: bool) -> Result { +pub fn cell_to_string(col: &ArrayRef, row: usize, is_pg_compatibility_test: bool) -> Result { if !col.is_valid(row) { // represent any null value with the string "NULL" Ok(NULL_STR.to_string()) } else { - if postgres_compatible { + if is_pg_compatibility_test { postgres_compatible_cell_to_string(col, row) } else { match col.data_type() { diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs index 93063c57c983..7373c47e106d 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -17,17 +17,13 @@ use std::sync::Arc; use std::time::Duration; -use std::fmt::Write; use async_trait::async_trait; -use log::info; +use log::debug; use sqllogictest::{ColumnType, DBOutput}; -use testcontainers::core::WaitFor; -use testcontainers::images::generic::GenericImage; use tokio::task::JoinHandle; -use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, offset::Utc}; -use futures::TryStreamExt; +use chrono::{NaiveDate, NaiveDateTime, NaiveTime}; use postgres_types::Type; use tokio_postgres::{Column, Row}; use rust_decimal::Decimal; @@ -38,10 +34,12 @@ pub mod image; pub struct Postgres { client: Arc, join_handle: JoinHandle<()>, + file_name: String, } impl Postgres { pub async fn connect_with_retry( + file_name: String, host: &str, port: u16, db: &str, @@ -50,23 +48,24 @@ impl Postgres { ) -> Result { let mut retry = 0; loop { - let connection_result = Postgres::connect(host, port, db, user, pass).await; + let connection_result = Postgres::connect(file_name.clone(), host, port, db, user, pass).await; match connection_result { Err(e) if retry <= 3 => { - info!("Retrying connection error '{:?}'", e); + debug!("Retrying connection error '{:?}'", e); retry += 1; - tokio::time::sleep(Duration::from_millis(500)).await; + tokio::time::sleep(Duration::from_secs(1)).await; } result => break result, } } } - pub async fn connect(host: &str, - port: u16, - db: &str, - user: &str, - pass: &str) -> Result { + async fn connect(file_name: String, + host: &str, + port: u16, + db: &str, + user: &str, + pass: &str) -> Result { let (client, connection) = tokio_postgres::Config::new() .host(host) .port(port) @@ -85,6 +84,7 @@ impl Postgres { Ok(Self { client: Arc::new(client), join_handle, + file_name, }) } } @@ -140,6 +140,8 @@ impl sqllogictest::AsyncDB for Postgres { type Error = tokio_postgres::error::Error; async fn run(&mut self, sql: &str) -> Result { + println!("[{}] Running query: \"{}\"", self.file_name, sql); + let is_query_sql = { let lower_sql = sql.trim_start().to_ascii_lowercase(); lower_sql.starts_with("select") diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index b8691020d2be..31dde4f951d5 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -16,11 +16,9 @@ // under the License. use std::error::Error; -use std::fs::copy; use std::path::{Path, PathBuf}; -use log::info; -use tempfile::tempdir; +use log::{debug, info}; use testcontainers::clients::Cli as Docker; use datafusion::prelude::SessionContext; @@ -35,7 +33,7 @@ mod setup; mod utils; const TEST_DIRECTORY: &str = "tests/sqllogictests/test_files"; -const TEST_DIRECTORY_POSTGRES: &str = "tests/sqllogictests/postgres/test_files"; +const PG_COMPAT_FILE_PREFIX: &str = "pg_compat_"; #[tokio::main] #[cfg(target_family = "windows")] @@ -58,38 +56,45 @@ pub async fn main() -> Result<(), Box> { for path in files { let file_name = path.file_name().unwrap().to_str().unwrap().to_string(); + let is_pg_compatibility_test = file_name.starts_with(PG_COMPAT_FILE_PREFIX); if options.complete_mode { - run_complete_file(&path, file_name).await?; - } else if options.postgres_mode { - run_postgres_test_file(&path, file_name).await?; + run_complete_file(&path, file_name, is_pg_compatibility_test).await?; } else { - run_test_file(&path, file_name).await?; + if options.postgres_runner { + if is_pg_compatibility_test { + run_test_file_with_postgres(&path, file_name).await?; + } else { + debug!("Skipping test file {:?}", path); + } + } else { + run_test_file(&path, file_name, is_pg_compatibility_test).await?; + } } } Ok(()) } -async fn run_test_file(path: &PathBuf, file_name: String) -> Result<(), Box> { - println!("Running: {}", path.display()); - let ctx = context_for_test_file(&file_name).await; - let mut runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, false)); +async fn run_test_file(path: &PathBuf, file_name: String, is_pg_compatibility_test: bool) -> Result<(), Box> { + println!("Running with DataFusion runner: {}", path.display()); + let ctx = context_for_test_file(&file_name, is_pg_compatibility_test).await; + let mut runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, is_pg_compatibility_test)); runner.run_file_async(path).await?; Ok(()) } -async fn run_postgres_test_file( +async fn run_test_file_with_postgres( path: &PathBuf, file_name: String, ) -> Result<(), Box> { - use sqllogictest::{default_validator, update_test_file}; - info!("Running postgres test: {}", path.display()); + info!("Running with Postgres runner: {}", path.display()); let docker = Docker::default(); let postgres_container = docker.run(postgres::image::postgres_docker_image()); let postgres_client = Postgres::connect_with_retry( + file_name, "127.0.0.1", postgres_container.get_host_port_ipv4(PG_PORT), PG_DB, @@ -97,28 +102,23 @@ async fn run_postgres_test_file( PG_PASSWORD, ) .await?; - let postgres_runner = sqllogictest::Runner::new(postgres_client); - - update_test_file(&path, postgres_runner, " ", default_validator).await?; + let mut postgres_runner = sqllogictest::Runner::new(postgres_client); - let ctx = SessionContext::new(); - setup::register_aggregate_csv_by_sql(&ctx).await; - let mut df_runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, true)); - - df_runner.run_file_async(path).await?; + postgres_runner.run_file_async(path).await?; Ok(()) } async fn run_complete_file( path: &PathBuf, file_name: String, + is_pg_compatibility_test: bool, ) -> Result<(), Box> { use sqllogictest::{default_validator, update_test_file}; info!("Using complete mode to complete: {}", path.display()); - let ctx = context_for_test_file(&file_name).await; - let runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, true)); + let ctx = context_for_test_file(&file_name, is_pg_compatibility_test).await; + let runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, is_pg_compatibility_test)); let col_separator = " "; let validator = default_validator; @@ -130,12 +130,7 @@ async fn run_complete_file( } fn read_test_files(options: &Options) -> Vec { - let path = if options.postgres_mode { - TEST_DIRECTORY_POSTGRES - } else { - TEST_DIRECTORY - }; - std::fs::read_dir(path) + std::fs::read_dir(TEST_DIRECTORY) .unwrap() .map(|path| path.unwrap().path()) .filter(|path| options.check_test_file(path.as_path())) @@ -143,17 +138,24 @@ fn read_test_files(options: &Options) -> Vec { } /// Create a SessionContext, configured for the specific test -async fn context_for_test_file(file_name: &str) -> SessionContext { - match file_name { - "aggregate.slt" | "select.slt" => { - info!("Registering aggregate tables"); - let ctx = SessionContext::new(); - setup::register_aggregate_tables(&ctx).await; - ctx - } - _ => { - info!("Using default SessionContext"); - SessionContext::new() +async fn context_for_test_file(file_name: &str, is_pg_compatibility_test: bool) -> SessionContext { + if is_pg_compatibility_test { + info!("Registering pg compatibility tables"); + let ctx = SessionContext::new(); + setup::register_aggregate_csv_by_sql(&ctx).await; + ctx + } else { + match file_name { + "aggregate.slt" | "select.slt" => { + info!("Registering aggregate tables"); + let ctx = SessionContext::new(); + setup::register_aggregate_tables(&ctx).await; + ctx + } + _ => { + info!("Using default SessionContext"); + SessionContext::new() + } } } } @@ -168,8 +170,8 @@ struct Options { /// Auto complete mode to fill out expected results complete_mode: bool, - /// Run Postgres compatibility tests - postgres_mode: bool, + /// Run Postgres compatibility tests with Postgres runner + postgres_runner: bool, } impl Options { @@ -177,7 +179,14 @@ impl Options { let args: Vec<_> = std::env::args().collect(); let complete_mode = args.iter().any(|a| a == "--complete"); - let postgres_mode = args.iter().any(|a| a == "--postgres"); + // std::env::var("PG_COMPAT").map_or() + let postgres_runner = match std::env::var("PG_COMPAT") { + Ok(value) => { + info!("PG_COMPAT value {}", value); + true + } + Err(_) => false + }; // treat args after the first as filters to run (substring matching) let filters = if !args.is_empty() { @@ -193,7 +202,7 @@ impl Options { Self { filters, complete_mode, - postgres_mode, + postgres_runner, } } diff --git a/datafusion/core/tests/sqllogictests/test_files/aggregate.slt b/datafusion/core/tests/sqllogictests/test_files/aggregate.slt index 540930d4a349..7a1b012b8410 100644 --- a/datafusion/core/tests/sqllogictests/test_files/aggregate.slt +++ b/datafusion/core/tests/sqllogictests/test_files/aggregate.slt @@ -980,14 +980,14 @@ select max(c1) from d_table query R select sum(c1) from d_table ---- -100 +100.000 # FIX: doesn't check datatype # aggregate_decimal_avg query R select avg(c1) from d_table ---- -5 +5.0000000 # FIX: different test table # aggregate diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt b/datafusion/core/tests/sqllogictests/test_files/pg_compat_simple.slt similarity index 63% rename from datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt rename to datafusion/core/tests/sqllogictests/test_files/pg_compat_simple.slt index 84a4dc7e518b..3281b781fbed 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/test_data.slt +++ b/datafusion/core/tests/sqllogictests/test_files/pg_compat_simple.slt @@ -15,6 +15,401 @@ # specific language governing permissions and limitations # under the License. + +query RRRRR +SELECT + abs(-1.1) as abs, + exp(2.0) as exp, + sin(3.0) as sin, + cos(4.0) as cos, + tan(5.0) as tan; +---- +1.1 7.389056098931 0.14112000806 -0.653643620864 -3.380515006247 + + +query I +select length('ä'); +---- +2 + + +query I +SELECT 1 as num; +---- +1 + + +query IIT +SELECT + c2, + c3, + c10 +FROM aggregate_test_100_by_sql +ORDER BY c2 ASC, c3 DESC, c10; +---- +1 125 17869394731126786457 +1 120 16439861276703750332 +1 103 10901819591635583995 +1 83 4602675983996931623 +1 71 10297218950720052365 +1 70 4976799313755010034 +1 57 4338034436871150616 +1 54 17818611040257178339 +1 41 15419512479294091215 +1 38 1842662804748246269 +1 36 7788847578701297242 +1 29 14857091259186476033 +1 12 15449267433866484283 +1 -5 4776679784701509574 +1 -8 9904216782086286050 +1 -24 2402288956117186783 +1 -25 12763583666216333412 +1 -56 677091006469429514 +1 -72 5885937420286765261 +1 -85 12101411955859039553 +1 -98 9634106610243643486 +1 -99 14933742247195536130 +2 122 15695681119022625322 +2 113 4225581724448081782 +2 97 2792105417953811674 +2 93 5536487915963301239 +2 68 3898128009708892708 +2 63 13144161537396946288 +2 52 12565360638488684051 +2 52 7386391799827871203 +2 49 10948666249269100825 +2 45 8554426087132697832 +2 31 3343692635488765507 +2 29 562977550464243101 +2 1 5863949479783605708 +2 -29 11759014161799384683 +2 -43 906367167997372130 +2 -48 9135746610908713318 +2 -60 1719090662556698549 +2 -60 7045482583778080653 +2 -61 939909697866979632 +2 -106 7464432081248293405 +2 -107 4403623840168496677 +2 -117 12659011877190539078 +3 123 12883447461717956514 +3 112 9916295859593918600 +3 104 13079037564113702254 +3 97 8188072741116415408 +3 77 17419098323248948387 +3 73 2906943497598597237 +3 71 3998472996619161534 +3 22 196777795886465166 +3 17 12662506238151717757 +3 17 732272194388185106 +3 14 8164671015278284913 +3 13 10771380284714693539 +3 13 14881411008939145569 +3 -2 13062025193350212516 +3 -12 16060348691054629425 +3 -72 17452974532402389080 +3 -76 12046662515387914426 +3 -95 10966649192992996919 +3 -101 17929716297117857676 +4 123 4546434653720168472 +4 102 2240998421986827216 +4 97 9726016502640071617 +4 96 5437030162957481122 +4 74 10767179755613315144 +4 73 9575476605699527641 +4 65 11378396836996498283 +4 55 1524771507450695976 +4 47 2881913079548128905 +4 30 13526465947516666293 +4 17 3732692885824435932 +4 5 35363005357834672 +4 3 8622584762448622224 +4 -38 878137512938218976 +4 -53 9463973906560740422 +4 -54 7966148640299601101 +4 -56 2774306934041974261 +4 -59 15100310750150419896 +4 -79 2464584078983135763 +4 -90 4094315663314091142 +4 -101 16778113360088370541 +4 -111 8382489916947120498 +4 -117 13684453606722360110 +5 118 16493024289408725403 +5 68 9865419128970328044 +5 64 16127995415060805595 +5 62 10575647935385523483 +5 36 17448660630302620693 +5 -5 11429640193932435507 +5 -31 11005002152861474932 +5 -40 11720144131976083864 +5 -44 2413406423648025909 +5 -59 2501626630745849169 +5 -82 3330177516592499461 +5 -86 2126626171973341689 +5 -94 12849419495718510869 +5 -101 2243924747182709810 + + +query IIT +SELECT + c5, + c4, + c10 +FROM aggregate_test_100_by_sql +ORDER BY c5 ASC, c4 DESC, c10; +---- +-2141999138 -18655 13062025193350212516 +-2141451704 -11122 17452974532402389080 +-2138770630 21456 13144161537396946288 +-2117946883 2045 2501626630745849169 +-2098805236 13741 196777795886465166 +-1991133944 13630 9634106610243643486 +-1927628110 -1114 7464432081248293405 +-1908480893 -21739 1719090662556698549 +-1899175111 15673 8554426087132697832 +-1885422396 -12612 10767179755613315144 +-1882293856 -24085 2402288956117186783 +-1813935549 -28462 11378396836996498283 +-1808210365 -16312 7045482583778080653 +-1660426473 -2888 939909697866979632 +-1448995523 7652 15449267433866484283 +-1383162419 27138 9904216782086286050 +-1339586153 -5479 10297218950720052365 +-1331533190 10837 16439861276703750332 +-1302295658 15091 17419098323248948387 +-1222533990 -30187 12659011877190539078 +-1176490478 31106 17869394731126786457 +-1143802338 28781 4338034436871150616 +-1090239422 -12056 12565360638488684051 +-1011669561 -2904 4403623840168496677 +-1009656194 20690 2881913079548128905 +-928766616 -21481 7788847578701297242 +-903316089 29106 8188072741116415408 +-842693467 -12484 2243924747182709810 +-800561771 23127 3343692635488765507 +-673237643 -28070 3732692885824435932 +-644225469 -4667 15419512479294091215 +-629486480 15788 2413406423648025909 +-587831330 24495 10948666249269100825 +-537142430 25305 11759014161799384683 +-467659022 32514 2126626171973341689 +-421042466 -6823 9916295859593918600 +-382483011 -9565 2906943497598597237 +-346989627 -13217 17929716297117857676 +-335410409 18384 1842662804748246269 +-237425046 5281 2464584078983135763 +-168758331 10130 15695681119022625322 +-134213907 19208 16493024289408725403 +-108973366 3917 4225581724448081782 +-4229382 -1967 8382489916947120498 +41423756 16337 10575647935385523483 +49866617 15874 3898128009708892708 +61035129 -16110 13526465947516666293 +141218956 8809 12046662515387914426 +240273900 29533 12883447461717956514 +370975815 13080 906367167997372130 +383352709 15295 12763583666216333412 +397430452 28162 8164671015278284913 +427197269 -30336 5437030162957481122 +431378678 -22186 10901819591635583995 +434021400 -2376 7966148640299601101 +439738328 -18025 9135746610908713318 +586844478 -12907 11005002152861474932 +623103518 -16974 17448660630302620693 +659422734 -30508 8622584762448622224 +670497898 14457 12662506238151717757 +702611616 -7688 35363005357834672 +706441268 22614 11720144131976083864 +715235348 23388 7386391799827871203 +762932956 20744 878137512938218976 +794623392 12636 4776679784701509574 +852509237 16620 4546434653720168472 +912707948 32064 10771380284714693539 +994303988 -18218 14857091259186476033 +1171968280 -15154 12101411955859039553 +1188089983 25590 5885937420286765261 +1188285940 21576 9865419128970328044 +1213926989 5613 14933742247195536130 +1282464673 -22501 9575476605699527641 +1299719633 12613 14881411008939145569 +1325868318 27752 4976799313755010034 +1337043149 -22796 732272194388185106 +1354539333 -3855 562977550464243101 +1413111008 -18410 17818611040257178339 +1423957796 25286 15100310750150419896 +1436496767 194 3998472996619161534 +1489733240 -9168 16060348691054629425 +1544188174 -31500 2774306934041974261 +1579876740 -2935 4094315663314091142 +1593800404 18167 2792105417953811674 +1689098844 -26526 16127995415060805595 +1738331255 -25136 13079037564113702254 +1824882165 22080 3330177516592499461 +1902023838 -1471 1524771507450695976 +1955646088 24896 11429640193932435507 +1991172974 -24558 2240998421986827216 +1993193190 11640 16778113360088370541 +2025611582 -15880 12849419495718510869 +2030965207 13611 10966649192992996919 +2033001162 18109 5863949479783605708 +2047637360 -13181 9726016502640071617 +2051224722 19316 13684453606722360110 +2053379412 -12642 5536487915963301239 +2064155045 13788 9463973906560740422 +2106705285 8692 677091006469429514 +2143473091 -14704 4602675983996931623 + + +query IRII +SELECT * FROM +(VALUES (1,2.0,-3,1+1),(10,20.0,-30,2+2)) +AS tbl(int_col, float_col, negative_col, summation); +---- +1 2 -3 2 +10 20 -30 4 + + +query IIRIII +SELECT + count(*) AS count_all, + count(c3) AS count_c3, + avg(c3) AS avg, + sum(c3) AS sum, + max(c3) AS max, + min(c3) AS min +FROM aggregate_test_100_by_sql; +---- +100 100 7.81 781 125 -117 + + +query IIRIII +select + c2, + sum(c3) sum_c3, + avg(c3) avg_c3, + max(c3) max_c3, + min(c3) min_c3, + count(c3) count_c3 +from aggregate_test_100_by_sql +group by c2 +order by c2; +---- +1 367 16.681818181818 125 -99 22 +2 184 8.363636363636 122 -117 22 +3 395 20.789473684211 123 -101 19 +4 29 1.260869565217 123 -117 23 +5 -194 -13.857142857143 118 -101 14 + + +query I +SELECT + t1.c9 result +FROM aggregate_test_100_by_sql t1 +INNER JOIN aggregate_test_100_by_sql t2 +ON t1.c9 = t2.c9 +ORDER BY result; +---- +28774375 +63044568 +141047417 +141680161 +145294611 +225513085 +243203849 +326151275 +431948861 +466439833 +473294098 +520189543 +538589788 +557517119 +559847112 +598822671 +662099130 +754775609 +774637006 +811650497 +879082834 +933879086 +974297360 +1000948272 +1013876852 +1088543984 +1098639440 +1157161427 +1229567292 +1243785310 +1289293657 +1362369177 +1365198901 +1454057357 +1491205016 +1534194097 +1538863055 +1787652631 +1824517658 +1842680163 +1865307672 +1995343206 +2013662838 +2042457019 +2093538928 +2125812933 +2214035726 +2293105904 +2306130875 +2307004493 +2424630722 +2496054700 +2502326480 +2525744318 +2592330556 +2610290479 +2669374863 +2705709344 +2712615025 +2778168728 +2818832252 +2830981072 +2844041986 +2861376515 +2861911482 +2939920218 +3023531799 +3105312559 +3126475872 +3188005828 +3198969145 +3275293996 +3276123488 +3314983189 +3342719438 +3373581039 +3398507249 +3455216719 +3457053821 +3473924576 +3521368277 +3542840110 +3566741189 +3570297463 +3577318119 +3593959807 +3625286410 +3717551163 +3759340273 +3766999078 +3862393166 +3959216334 +3998790955 +4015442341 +4061635107 +4076864659 +4144173353 +4216440507 +4229654142 +4268716378 + + query TIIIIIIIITRRT select * from aggregate_test_100_by_sql order by c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13; diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt b/datafusion/core/tests/sqllogictests/test_files/pg_compat_types.slt similarity index 63% rename from datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt rename to datafusion/core/tests/sqllogictests/test_files/pg_compat_types.slt index c200e3481ede..ebe4df92ac73 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/type_representation.slt +++ b/datafusion/core/tests/sqllogictests/test_files/pg_compat_types.slt @@ -1,3 +1,21 @@ +# 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. + + query T select null::VARCHAR ---- diff --git a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt b/datafusion/core/tests/sqllogictests/test_files/pg_compat_union.slt similarity index 59% rename from datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt rename to datafusion/core/tests/sqllogictests/test_files/pg_compat_union.slt index 3742ae8a690c..e007b2a252a9 100644 --- a/datafusion/core/tests/sqllogictests/postgres/test_files/simple_except_all.slt +++ b/datafusion/core/tests/sqllogictests/test_files/pg_compat_union.slt @@ -15,6 +15,21 @@ # specific language governing permissions and limitations # under the License. +query I +SELECT * FROM ( + SELECT c2 + FROM aggregate_test_100_by_sql t1 + EXCEPT + SELECT c2 + FROM aggregate_test_100_by_sql t2 + WHERE c2 IN (3, 4) +) s +ORDER BY c2 +---- +1 +2 +5 + query I SELECT * FROM ( SELECT c2 @@ -84,3 +99,81 @@ ORDER BY c2 5 5 5 + + +query I +SELECT * FROM ( + SELECT c2 + FROM aggregate_test_100_by_sql t1 + INTERSECT + SELECT c2 + FROM aggregate_test_100_by_sql t2 + WHERE c2 IN (3, 4) +) s +ORDER BY c2 +---- +3 +4 + + +query I +SELECT * FROM ( + SELECT c2 + FROM aggregate_test_100_by_sql t1 + INTERSECT ALL + SELECT c2 + FROM aggregate_test_100_by_sql t2 + WHERE c2 IN (3, 4) +) s +ORDER BY c2 +---- +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 + + +query I +SELECT 1 num UNION ALL SELECT 2 num ORDER BY num; +---- +1 +2 + diff --git a/datafusion/core/tests/sqllogictests/test_files/pg_compat_window.slt b/datafusion/core/tests/sqllogictests/test_files/pg_compat_window.slt new file mode 100644 index 000000000000..58b64a55265c --- /dev/null +++ b/datafusion/core/tests/sqllogictests/test_files/pg_compat_window.slt @@ -0,0 +1,1433 @@ +# 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. + + +query IIIIIIIIII +SELECT + c9, + row_number() OVER (PARTITION BY c2 ORDER BY c9) row_num, + lead(c9) OVER (PARTITION BY c2 ORDER BY c9) lead_c9, + lag(c9) OVER (PARTITION BY c2 ORDER BY c9) lag_c9, + first_value(c9) OVER (PARTITION BY c2 ORDER BY c9) first_c9, + first_value(c9) OVER (PARTITION BY c2 ORDER BY c9 DESC) first_c9_desc, + last_value(c9) OVER (PARTITION BY c2 ORDER BY c9) last_c9, + last_value(c9) OVER (PARTITION BY c2 ORDER BY c9 DESC) last_c9_desc, + nth_value(c9, 2) OVER (PARTITION BY c2 ORDER BY c9) second_c9, + nth_value(c9, 2) OVER (PARTITION BY c2 ORDER BY c9 DESC) second_c9_desc +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +28774375 1 326151275 NULL 28774375 3593959807 28774375 28774375 NULL 3570297463 +63044568 1 141680161 NULL 63044568 4144173353 63044568 63044568 NULL 4061635107 +141047417 1 662099130 NULL 141047417 4268716378 141047417 141047417 NULL 3457053821 +141680161 2 145294611 63044568 63044568 4144173353 141680161 141680161 141680161 4061635107 +145294611 3 598822671 141680161 63044568 4144173353 145294611 145294611 141680161 4061635107 +225513085 1 473294098 NULL 225513085 4229654142 225513085 225513085 NULL 4216440507 +243203849 1 431948861 NULL 243203849 3998790955 243203849 243203849 NULL 3959216334 +326151275 2 466439833 28774375 28774375 3593959807 326151275 326151275 326151275 3570297463 +431948861 2 559847112 243203849 243203849 3998790955 431948861 431948861 431948861 3959216334 +466439833 3 538589788 326151275 28774375 3593959807 466439833 466439833 326151275 3570297463 +473294098 2 520189543 225513085 225513085 4229654142 473294098 473294098 473294098 4216440507 +520189543 3 774637006 473294098 225513085 4229654142 520189543 520189543 473294098 4216440507 +538589788 4 557517119 466439833 28774375 3593959807 538589788 538589788 326151275 3570297463 +557517119 5 811650497 538589788 28774375 3593959807 557517119 557517119 326151275 3570297463 +559847112 3 754775609 431948861 243203849 3998790955 559847112 559847112 431948861 3959216334 +598822671 4 1000948272 145294611 63044568 4144173353 598822671 598822671 141680161 4061635107 +662099130 2 974297360 141047417 141047417 4268716378 662099130 662099130 662099130 3457053821 +754775609 4 1088543984 559847112 243203849 3998790955 754775609 754775609 431948861 3959216334 +774637006 4 879082834 520189543 225513085 4229654142 774637006 774637006 473294098 4216440507 +811650497 6 933879086 557517119 28774375 3593959807 811650497 811650497 326151275 3570297463 +879082834 5 1454057357 774637006 225513085 4229654142 879082834 879082834 473294098 4216440507 +933879086 7 1243785310 811650497 28774375 3593959807 933879086 933879086 326151275 3570297463 +974297360 3 1013876852 662099130 141047417 4268716378 974297360 974297360 662099130 3457053821 +1000948272 5 1098639440 598822671 63044568 4144173353 1000948272 1000948272 141680161 4061635107 +1013876852 4 1229567292 974297360 141047417 4268716378 1013876852 1013876852 662099130 3457053821 +1088543984 5 1362369177 754775609 243203849 3998790955 1088543984 1088543984 431948861 3959216334 +1098639440 6 1157161427 1000948272 63044568 4144173353 1098639440 1098639440 141680161 4061635107 +1157161427 7 1289293657 1098639440 63044568 4144173353 1157161427 1157161427 141680161 4061635107 +1229567292 5 1365198901 1013876852 141047417 4268716378 1229567292 1229567292 662099130 3457053821 +1243785310 8 1534194097 933879086 28774375 3593959807 1243785310 1243785310 326151275 3570297463 +1289293657 8 1491205016 1157161427 63044568 4144173353 1289293657 1289293657 141680161 4061635107 +1362369177 6 1538863055 1088543984 243203849 3998790955 1362369177 1362369177 431948861 3959216334 +1365198901 6 2307004493 1229567292 141047417 4268716378 1365198901 1365198901 662099130 3457053821 +1454057357 6 1842680163 879082834 225513085 4229654142 1454057357 1454057357 473294098 4216440507 +1491205016 9 2013662838 1289293657 63044568 4144173353 1491205016 1491205016 141680161 4061635107 +1534194097 9 1787652631 1243785310 28774375 3593959807 1534194097 1534194097 326151275 3570297463 +1538863055 7 1824517658 1362369177 243203849 3998790955 1538863055 1538863055 431948861 3959216334 +1787652631 10 1865307672 1534194097 28774375 3593959807 1787652631 1787652631 326151275 3570297463 +1824517658 8 1995343206 1538863055 243203849 3998790955 1824517658 1824517658 431948861 3959216334 +1842680163 7 2125812933 1454057357 225513085 4229654142 1842680163 1842680163 473294098 4216440507 +1865307672 11 2042457019 1787652631 28774375 3593959807 1865307672 1865307672 326151275 3570297463 +1995343206 9 2093538928 1824517658 243203849 3998790955 1995343206 1995343206 431948861 3959216334 +2013662838 10 2293105904 1491205016 63044568 4144173353 2013662838 2013662838 141680161 4061635107 +2042457019 12 2306130875 1865307672 28774375 3593959807 2042457019 2042457019 326151275 3570297463 +2093538928 10 2214035726 1995343206 243203849 3998790955 2093538928 2093538928 431948861 3959216334 +2125812933 8 2610290479 1842680163 225513085 4229654142 2125812933 2125812933 473294098 4216440507 +2214035726 11 2592330556 2093538928 243203849 3998790955 2214035726 2214035726 431948861 3959216334 +2293105904 11 2525744318 2013662838 63044568 4144173353 2293105904 2293105904 141680161 4061635107 +2306130875 13 2502326480 2042457019 28774375 3593959807 2306130875 2306130875 326151275 3570297463 +2307004493 7 2424630722 1365198901 141047417 4268716378 2307004493 2307004493 662099130 3457053821 +2424630722 8 2496054700 2307004493 141047417 4268716378 2424630722 2424630722 662099130 3457053821 +2496054700 9 2861911482 2424630722 141047417 4268716378 2496054700 2496054700 662099130 3457053821 +2502326480 14 2778168728 2306130875 28774375 3593959807 2502326480 2502326480 326151275 3570297463 +2525744318 12 2705709344 2293105904 63044568 4144173353 2525744318 2525744318 141680161 4061635107 +2592330556 12 3105312559 2214035726 243203849 3998790955 2592330556 2592330556 431948861 3959216334 +2610290479 9 2669374863 2125812933 225513085 4229654142 2610290479 2610290479 473294098 4216440507 +2669374863 10 2712615025 2610290479 225513085 4229654142 2669374863 2669374863 473294098 4216440507 +2705709344 13 2844041986 2525744318 63044568 4144173353 2705709344 2705709344 141680161 4061635107 +2712615025 11 2830981072 2669374863 225513085 4229654142 2712615025 2712615025 473294098 4216440507 +2778168728 15 2818832252 2502326480 28774375 3593959807 2778168728 2778168728 326151275 3570297463 +2818832252 16 3023531799 2778168728 28774375 3593959807 2818832252 2818832252 326151275 3570297463 +2830981072 12 2861376515 2712615025 225513085 4229654142 2830981072 2830981072 473294098 4216440507 +2844041986 14 2939920218 2705709344 63044568 4144173353 2844041986 2844041986 141680161 4061635107 +2861376515 13 3275293996 2830981072 225513085 4229654142 2861376515 2861376515 473294098 4216440507 +2861911482 10 3342719438 2496054700 141047417 4268716378 2861911482 2861911482 662099130 3457053821 +2939920218 15 3188005828 2844041986 63044568 4144173353 2939920218 2939920218 141680161 4061635107 +3023531799 17 3126475872 2818832252 28774375 3593959807 3023531799 3023531799 326151275 3570297463 +3105312559 13 3473924576 2592330556 243203849 3998790955 3105312559 3105312559 431948861 3959216334 +3126475872 18 3198969145 3023531799 28774375 3593959807 3126475872 3126475872 326151275 3570297463 +3188005828 16 3314983189 2939920218 63044568 4144173353 3188005828 3188005828 141680161 4061635107 +3198969145 19 3521368277 3126475872 28774375 3593959807 3198969145 3198969145 326151275 3570297463 +3275293996 14 3276123488 2861376515 225513085 4229654142 3275293996 3275293996 473294098 4216440507 +3276123488 15 3542840110 3275293996 225513085 4229654142 3276123488 3276123488 473294098 4216440507 +3314983189 17 3398507249 3188005828 63044568 4144173353 3314983189 3314983189 141680161 4061635107 +3342719438 11 3373581039 2861911482 141047417 4268716378 3342719438 3342719438 662099130 3457053821 +3373581039 12 3457053821 3342719438 141047417 4268716378 3373581039 3373581039 662099130 3457053821 +3398507249 18 3455216719 3314983189 63044568 4144173353 3398507249 3398507249 141680161 4061635107 +3455216719 19 3717551163 3398507249 63044568 4144173353 3455216719 3455216719 141680161 4061635107 +3457053821 13 4268716378 3373581039 141047417 4268716378 3457053821 3457053821 662099130 3457053821 +3473924576 14 3577318119 3105312559 243203849 3998790955 3473924576 3473924576 431948861 3959216334 +3521368277 20 3566741189 3198969145 28774375 3593959807 3521368277 3521368277 326151275 3570297463 +3542840110 16 3625286410 3276123488 225513085 4229654142 3542840110 3542840110 473294098 4216440507 +3566741189 21 3570297463 3521368277 28774375 3593959807 3566741189 3566741189 326151275 3570297463 +3570297463 22 3593959807 3566741189 28774375 3593959807 3570297463 3570297463 326151275 3570297463 +3577318119 15 3759340273 3473924576 243203849 3998790955 3577318119 3577318119 431948861 3959216334 +3593959807 23 NULL 3570297463 28774375 3593959807 3593959807 3593959807 326151275 NULL +3625286410 17 3766999078 3542840110 225513085 4229654142 3625286410 3625286410 473294098 4216440507 +3717551163 20 4061635107 3455216719 63044568 4144173353 3717551163 3717551163 141680161 4061635107 +3759340273 16 3862393166 3577318119 243203849 3998790955 3759340273 3759340273 431948861 3959216334 +3766999078 18 4015442341 3625286410 225513085 4229654142 3766999078 3766999078 473294098 4216440507 +3862393166 17 3959216334 3759340273 243203849 3998790955 3862393166 3862393166 431948861 3959216334 +3959216334 18 3998790955 3862393166 243203849 3998790955 3959216334 3959216334 431948861 3959216334 +3998790955 19 NULL 3959216334 243203849 3998790955 3998790955 3998790955 431948861 NULL +4015442341 19 4076864659 3766999078 225513085 4229654142 4015442341 4015442341 473294098 4216440507 +4061635107 21 4144173353 3717551163 63044568 4144173353 4061635107 4061635107 141680161 4061635107 +4076864659 20 4216440507 4015442341 225513085 4229654142 4076864659 4076864659 473294098 4216440507 +4144173353 22 NULL 4061635107 63044568 4144173353 4144173353 4144173353 141680161 NULL +4216440507 21 4229654142 4076864659 225513085 4229654142 4216440507 4216440507 473294098 4216440507 +4229654142 22 NULL 4216440507 225513085 4229654142 4229654142 4229654142 473294098 NULL +4268716378 14 NULL 3457053821 141047417 4268716378 4268716378 4268716378 662099130 NULL + + +query IIIIIIIIII +SELECT + c9, + row_number() OVER (ORDER BY c9) row_num, + lead(c9) OVER (ORDER BY c9) lead_c9, + lag(c9) OVER (ORDER BY c9) lag_c9, + first_value(c9) OVER (ORDER BY c9) first_c9, + first_value(c9) OVER (ORDER BY c9 DESC) first_c9_desc, + last_value(c9) OVER (ORDER BY c9) last_c9, + last_value(c9) OVER (ORDER BY c9 DESC) last_c9_desc, + nth_value(c9, 2) OVER (ORDER BY c9) second_c9, + nth_value(c9, 2) OVER (ORDER BY c9 DESC) second_c9_desc +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +28774375 1 63044568 NULL 28774375 4268716378 28774375 28774375 NULL 4229654142 +63044568 2 141047417 28774375 28774375 4268716378 63044568 63044568 63044568 4229654142 +141047417 3 141680161 63044568 28774375 4268716378 141047417 141047417 63044568 4229654142 +141680161 4 145294611 141047417 28774375 4268716378 141680161 141680161 63044568 4229654142 +145294611 5 225513085 141680161 28774375 4268716378 145294611 145294611 63044568 4229654142 +225513085 6 243203849 145294611 28774375 4268716378 225513085 225513085 63044568 4229654142 +243203849 7 326151275 225513085 28774375 4268716378 243203849 243203849 63044568 4229654142 +326151275 8 431948861 243203849 28774375 4268716378 326151275 326151275 63044568 4229654142 +431948861 9 466439833 326151275 28774375 4268716378 431948861 431948861 63044568 4229654142 +466439833 10 473294098 431948861 28774375 4268716378 466439833 466439833 63044568 4229654142 +473294098 11 520189543 466439833 28774375 4268716378 473294098 473294098 63044568 4229654142 +520189543 12 538589788 473294098 28774375 4268716378 520189543 520189543 63044568 4229654142 +538589788 13 557517119 520189543 28774375 4268716378 538589788 538589788 63044568 4229654142 +557517119 14 559847112 538589788 28774375 4268716378 557517119 557517119 63044568 4229654142 +559847112 15 598822671 557517119 28774375 4268716378 559847112 559847112 63044568 4229654142 +598822671 16 662099130 559847112 28774375 4268716378 598822671 598822671 63044568 4229654142 +662099130 17 754775609 598822671 28774375 4268716378 662099130 662099130 63044568 4229654142 +754775609 18 774637006 662099130 28774375 4268716378 754775609 754775609 63044568 4229654142 +774637006 19 811650497 754775609 28774375 4268716378 774637006 774637006 63044568 4229654142 +811650497 20 879082834 774637006 28774375 4268716378 811650497 811650497 63044568 4229654142 +879082834 21 933879086 811650497 28774375 4268716378 879082834 879082834 63044568 4229654142 +933879086 22 974297360 879082834 28774375 4268716378 933879086 933879086 63044568 4229654142 +974297360 23 1000948272 933879086 28774375 4268716378 974297360 974297360 63044568 4229654142 +1000948272 24 1013876852 974297360 28774375 4268716378 1000948272 1000948272 63044568 4229654142 +1013876852 25 1088543984 1000948272 28774375 4268716378 1013876852 1013876852 63044568 4229654142 +1088543984 26 1098639440 1013876852 28774375 4268716378 1088543984 1088543984 63044568 4229654142 +1098639440 27 1157161427 1088543984 28774375 4268716378 1098639440 1098639440 63044568 4229654142 +1157161427 28 1229567292 1098639440 28774375 4268716378 1157161427 1157161427 63044568 4229654142 +1229567292 29 1243785310 1157161427 28774375 4268716378 1229567292 1229567292 63044568 4229654142 +1243785310 30 1289293657 1229567292 28774375 4268716378 1243785310 1243785310 63044568 4229654142 +1289293657 31 1362369177 1243785310 28774375 4268716378 1289293657 1289293657 63044568 4229654142 +1362369177 32 1365198901 1289293657 28774375 4268716378 1362369177 1362369177 63044568 4229654142 +1365198901 33 1454057357 1362369177 28774375 4268716378 1365198901 1365198901 63044568 4229654142 +1454057357 34 1491205016 1365198901 28774375 4268716378 1454057357 1454057357 63044568 4229654142 +1491205016 35 1534194097 1454057357 28774375 4268716378 1491205016 1491205016 63044568 4229654142 +1534194097 36 1538863055 1491205016 28774375 4268716378 1534194097 1534194097 63044568 4229654142 +1538863055 37 1787652631 1534194097 28774375 4268716378 1538863055 1538863055 63044568 4229654142 +1787652631 38 1824517658 1538863055 28774375 4268716378 1787652631 1787652631 63044568 4229654142 +1824517658 39 1842680163 1787652631 28774375 4268716378 1824517658 1824517658 63044568 4229654142 +1842680163 40 1865307672 1824517658 28774375 4268716378 1842680163 1842680163 63044568 4229654142 +1865307672 41 1995343206 1842680163 28774375 4268716378 1865307672 1865307672 63044568 4229654142 +1995343206 42 2013662838 1865307672 28774375 4268716378 1995343206 1995343206 63044568 4229654142 +2013662838 43 2042457019 1995343206 28774375 4268716378 2013662838 2013662838 63044568 4229654142 +2042457019 44 2093538928 2013662838 28774375 4268716378 2042457019 2042457019 63044568 4229654142 +2093538928 45 2125812933 2042457019 28774375 4268716378 2093538928 2093538928 63044568 4229654142 +2125812933 46 2214035726 2093538928 28774375 4268716378 2125812933 2125812933 63044568 4229654142 +2214035726 47 2293105904 2125812933 28774375 4268716378 2214035726 2214035726 63044568 4229654142 +2293105904 48 2306130875 2214035726 28774375 4268716378 2293105904 2293105904 63044568 4229654142 +2306130875 49 2307004493 2293105904 28774375 4268716378 2306130875 2306130875 63044568 4229654142 +2307004493 50 2424630722 2306130875 28774375 4268716378 2307004493 2307004493 63044568 4229654142 +2424630722 51 2496054700 2307004493 28774375 4268716378 2424630722 2424630722 63044568 4229654142 +2496054700 52 2502326480 2424630722 28774375 4268716378 2496054700 2496054700 63044568 4229654142 +2502326480 53 2525744318 2496054700 28774375 4268716378 2502326480 2502326480 63044568 4229654142 +2525744318 54 2592330556 2502326480 28774375 4268716378 2525744318 2525744318 63044568 4229654142 +2592330556 55 2610290479 2525744318 28774375 4268716378 2592330556 2592330556 63044568 4229654142 +2610290479 56 2669374863 2592330556 28774375 4268716378 2610290479 2610290479 63044568 4229654142 +2669374863 57 2705709344 2610290479 28774375 4268716378 2669374863 2669374863 63044568 4229654142 +2705709344 58 2712615025 2669374863 28774375 4268716378 2705709344 2705709344 63044568 4229654142 +2712615025 59 2778168728 2705709344 28774375 4268716378 2712615025 2712615025 63044568 4229654142 +2778168728 60 2818832252 2712615025 28774375 4268716378 2778168728 2778168728 63044568 4229654142 +2818832252 61 2830981072 2778168728 28774375 4268716378 2818832252 2818832252 63044568 4229654142 +2830981072 62 2844041986 2818832252 28774375 4268716378 2830981072 2830981072 63044568 4229654142 +2844041986 63 2861376515 2830981072 28774375 4268716378 2844041986 2844041986 63044568 4229654142 +2861376515 64 2861911482 2844041986 28774375 4268716378 2861376515 2861376515 63044568 4229654142 +2861911482 65 2939920218 2861376515 28774375 4268716378 2861911482 2861911482 63044568 4229654142 +2939920218 66 3023531799 2861911482 28774375 4268716378 2939920218 2939920218 63044568 4229654142 +3023531799 67 3105312559 2939920218 28774375 4268716378 3023531799 3023531799 63044568 4229654142 +3105312559 68 3126475872 3023531799 28774375 4268716378 3105312559 3105312559 63044568 4229654142 +3126475872 69 3188005828 3105312559 28774375 4268716378 3126475872 3126475872 63044568 4229654142 +3188005828 70 3198969145 3126475872 28774375 4268716378 3188005828 3188005828 63044568 4229654142 +3198969145 71 3275293996 3188005828 28774375 4268716378 3198969145 3198969145 63044568 4229654142 +3275293996 72 3276123488 3198969145 28774375 4268716378 3275293996 3275293996 63044568 4229654142 +3276123488 73 3314983189 3275293996 28774375 4268716378 3276123488 3276123488 63044568 4229654142 +3314983189 74 3342719438 3276123488 28774375 4268716378 3314983189 3314983189 63044568 4229654142 +3342719438 75 3373581039 3314983189 28774375 4268716378 3342719438 3342719438 63044568 4229654142 +3373581039 76 3398507249 3342719438 28774375 4268716378 3373581039 3373581039 63044568 4229654142 +3398507249 77 3455216719 3373581039 28774375 4268716378 3398507249 3398507249 63044568 4229654142 +3455216719 78 3457053821 3398507249 28774375 4268716378 3455216719 3455216719 63044568 4229654142 +3457053821 79 3473924576 3455216719 28774375 4268716378 3457053821 3457053821 63044568 4229654142 +3473924576 80 3521368277 3457053821 28774375 4268716378 3473924576 3473924576 63044568 4229654142 +3521368277 81 3542840110 3473924576 28774375 4268716378 3521368277 3521368277 63044568 4229654142 +3542840110 82 3566741189 3521368277 28774375 4268716378 3542840110 3542840110 63044568 4229654142 +3566741189 83 3570297463 3542840110 28774375 4268716378 3566741189 3566741189 63044568 4229654142 +3570297463 84 3577318119 3566741189 28774375 4268716378 3570297463 3570297463 63044568 4229654142 +3577318119 85 3593959807 3570297463 28774375 4268716378 3577318119 3577318119 63044568 4229654142 +3593959807 86 3625286410 3577318119 28774375 4268716378 3593959807 3593959807 63044568 4229654142 +3625286410 87 3717551163 3593959807 28774375 4268716378 3625286410 3625286410 63044568 4229654142 +3717551163 88 3759340273 3625286410 28774375 4268716378 3717551163 3717551163 63044568 4229654142 +3759340273 89 3766999078 3717551163 28774375 4268716378 3759340273 3759340273 63044568 4229654142 +3766999078 90 3862393166 3759340273 28774375 4268716378 3766999078 3766999078 63044568 4229654142 +3862393166 91 3959216334 3766999078 28774375 4268716378 3862393166 3862393166 63044568 4229654142 +3959216334 92 3998790955 3862393166 28774375 4268716378 3959216334 3959216334 63044568 4229654142 +3998790955 93 4015442341 3959216334 28774375 4268716378 3998790955 3998790955 63044568 4229654142 +4015442341 94 4061635107 3998790955 28774375 4268716378 4015442341 4015442341 63044568 4229654142 +4061635107 95 4076864659 4015442341 28774375 4268716378 4061635107 4061635107 63044568 4229654142 +4076864659 96 4144173353 4061635107 28774375 4268716378 4076864659 4076864659 63044568 4229654142 +4144173353 97 4216440507 4076864659 28774375 4268716378 4144173353 4144173353 63044568 4229654142 +4216440507 98 4229654142 4144173353 28774375 4268716378 4216440507 4216440507 63044568 4229654142 +4229654142 99 4268716378 4216440507 28774375 4268716378 4229654142 4229654142 63044568 4229654142 +4268716378 100 NULL 4229654142 28774375 4268716378 4268716378 4268716378 63044568 NULL + + +query IIRIII +SELECT + row_number() OVER () AS row_number, + count(c3) OVER () AS count_c3, + avg(c3) OVER () AS avg, + sum(c3) OVER () AS sum, + max(c3) OVER () AS max, + min(c3) OVER () AS min +FROM aggregate_test_100_by_sql +ORDER BY row_number; +---- +1 100 7.81 781 125 -117 +2 100 7.81 781 125 -117 +3 100 7.81 781 125 -117 +4 100 7.81 781 125 -117 +5 100 7.81 781 125 -117 +6 100 7.81 781 125 -117 +7 100 7.81 781 125 -117 +8 100 7.81 781 125 -117 +9 100 7.81 781 125 -117 +10 100 7.81 781 125 -117 +11 100 7.81 781 125 -117 +12 100 7.81 781 125 -117 +13 100 7.81 781 125 -117 +14 100 7.81 781 125 -117 +15 100 7.81 781 125 -117 +16 100 7.81 781 125 -117 +17 100 7.81 781 125 -117 +18 100 7.81 781 125 -117 +19 100 7.81 781 125 -117 +20 100 7.81 781 125 -117 +21 100 7.81 781 125 -117 +22 100 7.81 781 125 -117 +23 100 7.81 781 125 -117 +24 100 7.81 781 125 -117 +25 100 7.81 781 125 -117 +26 100 7.81 781 125 -117 +27 100 7.81 781 125 -117 +28 100 7.81 781 125 -117 +29 100 7.81 781 125 -117 +30 100 7.81 781 125 -117 +31 100 7.81 781 125 -117 +32 100 7.81 781 125 -117 +33 100 7.81 781 125 -117 +34 100 7.81 781 125 -117 +35 100 7.81 781 125 -117 +36 100 7.81 781 125 -117 +37 100 7.81 781 125 -117 +38 100 7.81 781 125 -117 +39 100 7.81 781 125 -117 +40 100 7.81 781 125 -117 +41 100 7.81 781 125 -117 +42 100 7.81 781 125 -117 +43 100 7.81 781 125 -117 +44 100 7.81 781 125 -117 +45 100 7.81 781 125 -117 +46 100 7.81 781 125 -117 +47 100 7.81 781 125 -117 +48 100 7.81 781 125 -117 +49 100 7.81 781 125 -117 +50 100 7.81 781 125 -117 +51 100 7.81 781 125 -117 +52 100 7.81 781 125 -117 +53 100 7.81 781 125 -117 +54 100 7.81 781 125 -117 +55 100 7.81 781 125 -117 +56 100 7.81 781 125 -117 +57 100 7.81 781 125 -117 +58 100 7.81 781 125 -117 +59 100 7.81 781 125 -117 +60 100 7.81 781 125 -117 +61 100 7.81 781 125 -117 +62 100 7.81 781 125 -117 +63 100 7.81 781 125 -117 +64 100 7.81 781 125 -117 +65 100 7.81 781 125 -117 +66 100 7.81 781 125 -117 +67 100 7.81 781 125 -117 +68 100 7.81 781 125 -117 +69 100 7.81 781 125 -117 +70 100 7.81 781 125 -117 +71 100 7.81 781 125 -117 +72 100 7.81 781 125 -117 +73 100 7.81 781 125 -117 +74 100 7.81 781 125 -117 +75 100 7.81 781 125 -117 +76 100 7.81 781 125 -117 +77 100 7.81 781 125 -117 +78 100 7.81 781 125 -117 +79 100 7.81 781 125 -117 +80 100 7.81 781 125 -117 +81 100 7.81 781 125 -117 +82 100 7.81 781 125 -117 +83 100 7.81 781 125 -117 +84 100 7.81 781 125 -117 +85 100 7.81 781 125 -117 +86 100 7.81 781 125 -117 +87 100 7.81 781 125 -117 +88 100 7.81 781 125 -117 +89 100 7.81 781 125 -117 +90 100 7.81 781 125 -117 +91 100 7.81 781 125 -117 +92 100 7.81 781 125 -117 +93 100 7.81 781 125 -117 +94 100 7.81 781 125 -117 +95 100 7.81 781 125 -117 +96 100 7.81 781 125 -117 +97 100 7.81 781 125 -117 +98 100 7.81 781 125 -117 +99 100 7.81 781 125 -117 +100 100 7.81 781 125 -117 + + +query IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII +SELECT + SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation1, + SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation2, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation3, + SUM(c4) OVER(ORDER BY c3 DESC GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation4, + SUM(c3) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation5, + SUM(c5) OVER(ORDER BY c3 DESC GROUPS 2 PRECEDING) as summation6, + SUM(c5) OVER(ORDER BY c3 DESC GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation7, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation8, + SUM(c4) OVER(ORDER BY c4 DESC GROUPS UNBOUNDED PRECEDING) as summation9, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS CURRENT ROW) as summation10, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation11, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation12, + SUM(c5) OVER(ORDER BY c4 DESC GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation13, + SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation21, + SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation22, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation23, + SUM(c4) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation24, + SUM(c3) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation25, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c3 GROUPS 2 PRECEDING) as summation26, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation27, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation28, + SUM(c4) OVER(PARTITION BY c4 ORDER BY c4 GROUPS UNBOUNDED PRECEDING) as summation29, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS CURRENT ROW) as summation30, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation31, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation32, + SUM(c5) OVER(PARTITION BY c4 ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation33, + SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation41, + SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation42, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation43, + SUM(c4) OVER(ORDER BY c5, c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation44, + SUM(c3) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation45, + SUM(c5) OVER(ORDER BY c5, c3 GROUPS 2 PRECEDING) as summation46, + SUM(c5) OVER(ORDER BY c5, c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation47, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation48, + SUM(c4) OVER(ORDER BY c5, c4 GROUPS UNBOUNDED PRECEDING) as summation49, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS CURRENT ROW) as summation50, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation51, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation52, + SUM(c5) OVER(ORDER BY c5, c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation53, + SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation61, + SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 3 PRECEDING AND 2 PRECEDING) as summation62, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 2 PRECEDING AND 2 PRECEDING) as summation63, + SUM(c4) OVER(ORDER BY c3 GROUPS BETWEEN 1 FOLLOWING AND 3 FOLLOWING) as summation64, + SUM(c3) OVER(ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) as summation65, + SUM(c5) OVER(ORDER BY c3 GROUPS 2 PRECEDING) as summation66, + SUM(c5) OVER(ORDER BY c3 GROUPS BETWEEN CURRENT ROW AND 3 FOLLOWING) as summation67, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation68, + SUM(c4) OVER(ORDER BY c4 GROUPS UNBOUNDED PRECEDING) as summation69, + SUM(c5) OVER(ORDER BY c4 GROUPS CURRENT ROW) as summation70, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as summation71, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) as summation72, + SUM(c5) OVER(ORDER BY c4 GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) as summation73 +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +-35127 -20071 1171968280 -44741 -60 -1045189740 1645376618 15862627961 728662 61035129 2252131671 4277743253 2191096542 -16110 NULL NULL NULL NULL 61035129 61035129 61035129 -16110 61035129 61035129 61035129 NULL 22943 14370 41423756 51422 -76 152325502 813503800 15862627961 145307 61035129 65801428664 65851295281 65740393535 -37724 -22668 623103518 3056 -94 311073214 -1380600149 15862627961 -512775 61035129 13671531419 11863321054 13610496290 +37269 20967 1213926989 -54145 -59 -1574720463 1639694101 15862627961 951392 -108973366 5255341318 5017916272 5364314684 3917 NULL NULL NULL NULL -108973366 -108973366 -108973366 3917 -108973366 -108973366 -108973366 NULL 36569 15411 -168758331 30244 -111 -411945604 -21912375 15862627961 131173 -108973366 65779516289 65645302382 65888489655 -31020 -47322 1436496767 40175 -79 1208315423 -1743478794 15862627961 -715478 -108973366 10498313277 8380366394 10607286643 +14062 11006 61035129 -15056 -48 -1285298976 1303653581 15862627961 695376 623103518 3999306907 2191096542 3376203389 -16974 NULL NULL NULL NULL 623103518 623103518 623103518 -16974 623103518 623103518 623103518 NULL -80790 -20401 439738328 -23739 3 1649686324 2655635766 15862627961 137382 623103518 61887961550 62474806028 61264858032 -35127 -38183 994303988 29390 -60 -1045189740 -3184474087 15862627961 -480353 623103518 12486424572 12926162900 11863321054 +1164 19243 -2117946883 -15742 55 89808975 -2114836321 15862627961 952517 -1927628110 6045764800 7482261567 7973392910 -1114 NULL NULL NULL NULL -1927628110 -1927628110 -1927628110 -1114 -1927628110 -1927628110 -1927628110 NULL 6563 15786 -2098805236 -18678 -60 -6017567290 -7620706510 15862627961 19981 -1927628110 28492735496 26501601552 30420363606 -30917 -12838 -4229382 5182 71 -2943527053 -1901324969 15862627961 -721634 -1927628110 7889235051 9791258889 9816863161 +67523 35827 49866617 -24738 -25 -3496662635 -3184474087 15862627961 740879 -1899175111 7846553398 7217066918 9745728509 15673 NULL NULL NULL NULL -1899175111 -1899175111 -1899175111 15673 -1899175111 -1899175111 -1899175111 NULL -6162 12516 -1927628110 -65159 74 -5735284114 -7480826912 15862627961 13915 -1899175111 32328844499 30420363606 34228019610 11625 -20071 -1302295658 56517 -44 -2878810989 -3871666709 15862627961 -493209 -1899175111 6116899452 6500252161 8016074563 +14039 -18815 2064155045 -9562 -95 2065442845 -1901324969 15862627961 826881 -1991133944 10028823751 7930018515 12019957695 13630 NULL NULL NULL NULL -1991133944 -1991133944 -1991133944 13630 -1991133944 -1991133944 -1991133944 NULL 49758 23501 -2117946883 -7180 -106 -6207886063 -7726418058 15862627961 21095 -1991133944 26501601552 24402796316 28492735496 17679 -15175 370975815 -5204 22 26303141 3645319585 15862627961 -581254 -1991133944 3842670266 5873635473 5833804210 +17679 27241 586844478 -5985 83 26303141 -2140016957 15862627961 790510 -346989627 7246194997 9293832357 7593184624 -13217 NULL NULL NULL NULL -346989627 -346989627 -346989627 -13217 -346989627 -346989627 -346989627 NULL 21293 25691 -421042466 33795 38 -1150515104 -1088583413 15862627961 74253 -346989627 64556718969 64174235958 64903708596 -14433 -4871 1171968280 32854 97 -2135787575 2057268348 15862627961 -571730 -346989627 8269443337 10412916428 8616432964 +53780 -7078 -2138770630 29390 -117 -1972491598 -3888467183 15862627961 567403 -1009656194 12359612306 13122545262 13369268500 20690 NULL NULL NULL NULL -1009656194 -1009656194 -1009656194 20690 -1009656194 -1009656194 -1009656194 NULL 13030 16725 -1090239422 -4859 36 -3111565177 -3684432366 15862627961 20225 -1009656194 55728616981 54716947420 56738273175 74575 13717 -134213907 17417 -38 -3553056774 -559380590 15862627961 -314716 -1009656194 2493359461 4544584183 3503015655 +28098 -8332 -903316089 44641 70 -367071380 1863474126 15862627961 211266 397430452 18400914040 17257111702 18003483588 28162 NULL NULL NULL NULL 397430452 397430452 397430452 28162 397430452 397430452 397430452 NULL 55734 42613 370975815 -54898 96 1151758976 1690027799 15862627961 240186 397430452 64604572155 64987924864 64207141703 36394 -36 -1383162419 -44741 57 1160862510 1981771941 15862627961 48893 397430452 -2140855627 -814987309 -2538286079 +17679 27241 794623392 -5985 120 26303141 -2140016957 15862627961 890461 1993193190 7523673648 8823393281 5530480458 11640 NULL NULL NULL NULL 1993193190 1993193190 1993193190 11640 1993193190 1993193190 1993193190 NULL -5373 23425 1955646088 15840 -94 5940012252 8082771141 15862627961 214888 1993193190 20549346056 22540519030 18556152866 -14433 -4871 -168758331 32854 13 -2135787575 2057268348 15862627961 -646824 1993193190 10332147503 9000614313 8338954313 +15239 -44678 -1143802338 -17538 -8 2322760594 2439184170 15862627961 239018 1325868318 18003483588 18400914040 16677615270 27752 NULL NULL NULL NULL 1325868318 1325868318 1325868318 27752 1325868318 1325868318 1325868318 NULL 681 -16888 1282464673 -45061 17 3908052624 5430561808 15862627961 278980 1325868318 46149116149 47448835782 44823247831 4929 -54988 1188089983 -49963 14 750085326 437338198 15862627961 20731 1325868318 -814987309 -2198149728 -2140855627 +46712 64670 1282464673 27693 102 -1775723035 -1449239099 15862627961 487280 -1882293856 2457410212 3794453361 4339704068 -24085 NULL NULL NULL NULL -1882293856 -1882293856 -1882293856 -24085 -1882293856 -1882293856 -1882293856 NULL -71225 -6066 -1899175111 -47662 65 -5666891363 -7164866243 15862627961 -22782 -1882293856 36113442006 34228019610 37995735862 -5560 12398 1738331255 55502 17 -2036083577 974546445 15862627961 -279368 -1882293856 11522923893 13514096867 13405217749 +-49576 387 -1908480893 59917 17 -2287736392 3560913151 15862627961 534161 1282464673 5076918034 5508296712 3794453361 -22501 NULL NULL NULL NULL 1282464673 1282464673 1282464673 -22501 1282464673 1282464673 1282464673 NULL 42891 47166 1188285940 17569 13 3684677602 5245095773 15862627961 238615 1282464673 48731300455 49945227444 47448835782 15239 65202 -1882293856 -12225 103 2322760594 -144263301 15862627961 -324665 1282464673 12068174600 13405217749 10785709927 +-2090 -4237 427197269 -13608 NULL 6149069904 -2420213359 15862627961 231997 1544188174 1544188174 2203610908 NULL -31500 NULL NULL NULL NULL 1544188174 1544188174 1544188174 -31500 1544188174 1544188174 1544188174 NULL -18123 25480 1436496767 -11294 -90 4470418181 6406964162 15862627961 218731 1544188174 36368366538 37858099778 34824178364 -38792 -40939 NULL -6613 3 -759786886 6588808232 15862627961 -31500 1544188174 15862627961 15862627961 14318439787 +40940 29579 -2098805236 5182 -43 5636453529 2057268348 15862627961 840492 2030965207 12019957695 10028823751 9988992488 13611 NULL NULL NULL NULL 2030965207 2030965207 2030965207 13611 2030965207 2030965207 2030965207 NULL 2922 -12918 1993193190 24244 1 6049769979 8162828451 15862627961 212619 2030965207 16530541284 18556152866 14499576077 2913 -8448 794623392 13699 -98 1253758252 5168794507 15862627961 -594884 2030965207 5873635473 6244611288 3842670266 +-5560 -33253 -1383162419 30451 -59 -2036083577 1519076272 15862627961 317051 -537142430 16872687706 18060777689 17409830136 25305 NULL NULL NULL NULL -537142430 -537142430 -537142430 25305 -537142430 -537142430 -537142430 NULL 93435 11121 -629486480 16126 -86 -1754460240 -1808326929 15862627961 71344 -537142430 62748392040 62160560710 63285534470 71051 43358 1955646088 -17958 -72 812635004 -546350337 15862627961 -59749 -537142430 -1547202175 -123244379 -1010059745 +31670 65202 1991172974 66574 17 1113315852 -1552050368 15862627961 411060 1689098844 610199839 2348531094 -1078899005 -26526 NULL NULL NULL NULL 1689098844 1689098844 1689098844 -26526 1689098844 1689098844 1689098844 NULL -67930 -34435 1579876740 -4527 104 4862775988 7154336102 15862627961 207437 1689098844 31650501220 33244301624 29961402376 11586 45118 -1813935549 36740 104 -408248030 2439184170 15862627961 -205589 1689098844 16941526966 16268289323 15252428122 +-32689 -38183 431378678 80491 -24 1584341489 2495165914 15862627961 511365 1337043149 3794453361 5076918034 2457410212 -22796 NULL NULL NULL NULL 1337043149 1337043149 1337043149 -22796 1337043149 1337043149 1337043149 NULL -8787 -9888 1299719633 3021 29 3962631100 5528651286 15862627961 256184 1337043149 44823247831 46149116149 43486204682 57823 52329 1991172974 -24442 73 3944161437 1645376618 15862627961 -302164 1337043149 13405217749 11522923893 12068174600 +53530 14090 -346989627 13699 -94 2759425399 4309797580 15862627961 760652 1171968280 5449711533 7593184624 4277743253 -15154 NULL NULL NULL NULL 1171968280 1171968280 1171968280 -15154 1171968280 1171968280 1171968280 NULL 40902 48684 912707948 52779 -72 3078980216 4762271192 15862627961 208337 1171968280 53493571647 54487875635 52321603367 20625 -18815 61035129 36170 83 2284185998 2900644355 15862627961 -543809 1171968280 11584884708 13610496290 10412916428 +46693 37793 1436496767 17417 -111 799645256 2352299442 15862627961 951046 1902023838 7973392910 6045764800 6071369072 -1471 NULL NULL NULL NULL 1902023838 1902023838 1902023838 -1471 1902023838 1902023838 1902023838 NULL -6157 -51662 1738331255 11978 -5 5465237258 7842036090 15862627961 202910 1902023838 26398188956 28223071121 24496165118 44727 35827 434021400 66574 -106 2940130772 -1339125374 15862627961 -720520 1902023838 9791258889 9787029507 7889235051 +38577 -5070 240273900 -8549 14 -3241149212 1796328434 15862627961 183104 -1143802338 17257111702 16353795613 18400914040 28781 NULL NULL NULL NULL -1143802338 -1143802338 -1143802338 28781 -1143802338 -1143802338 -1143802338 NULL 32735 -15096 -1222533990 5730 52 -3542826806 -4255367515 15862627961 14495 -1143802338 52482905660 51306415182 53626707998 36569 -7078 1325868318 11267 97 2171332508 -1552050368 15862627961 77674 -1143802338 -2538286079 -2140855627 -1394483741 +-32689 -38183 1738331255 80491 65 1584341489 2495165914 15862627961 382990 -673237643 -1078899005 610199839 -405661362 -28070 NULL NULL NULL NULL -673237643 -673237643 -673237643 -28070 -673237643 -673237643 -673237643 NULL 7012 16622 -842693467 35616 41 -2316492881 -2534780922 15862627961 10423 -673237643 60213611118 59413049347 60886848761 57823 52329 -1222533990 -24442 64 3944161437 1645376618 15862627961 -179063 -673237643 16268289323 14454353774 16941526966 +-611 -37351 706441268 -33532 63 2660931489 -1025454778 15862627961 504513 1188285940 12172060572 13996942737 10983774632 21576 NULL NULL NULL NULL 1188285940 1188285940 1188285940 21576 1188285940 1188285940 1188285940 NULL 19407 -33372 1171968280 -4275 -99 3548344203 4984397235 15862627961 255503 1188285940 51133513384 52321603367 49945227444 31670 -5070 762932956 -9599 -82 1113315852 3560913151 15862627961 -250940 1188285940 4878853329 2740082699 3690567389 +-48148 9534 -842693467 -12225 -31 5218698356 1009134449 15862627961 829815 2053379412 11934056247 10048633851 9880676835 -12642 NULL NULL NULL NULL 2053379412 2053379412 2053379412 -12642 2053379412 2053379412 2053379412 NULL 25390 4928 2047637360 7776 -53 6152241494 8367712833 15862627961 224221 2053379412 8367712833 10418937555 6314333421 -55203 2479 2047637360 -20802 74 2894556845 7209871330 15862627961 -610460 2053379412 5981951126 6568795604 3928571714 +24352 -8790 -1885422396 56438 97 433054757 2427194517 15862627961 816908 586844478 9880676835 11934056247 9293832357 -12907 NULL NULL NULL NULL 586844478 586844478 586844478 -12907 586844478 586844478 586844478 NULL -72468 -24562 434021400 -33025 36 1460604206 2539868628 15862627961 154356 586844478 62474806028 62914544356 61887961550 68836 35694 -346989627 16515 93 2056218702 -1449239099 15862627961 -597818 586844478 6568795604 8616432964 5981951126 +-49576 387 702611616 59917 -72 -2287736392 3560913151 15862627961 890731 -382483011 5591766247 7081499487 5974249258 -9565 NULL NULL NULL NULL -382483011 -382483011 -382483011 -9565 -382483011 -382483011 -382483011 NULL 28214 57819 -467659022 10448 -101 -1271184499 -1302308093 15862627961 87470 -382483011 64174235958 63753193492 64556718969 15239 65202 -1090239422 -12225 -12 2322760594 -144263301 15862627961 -668299 -382483011 9888378703 7746926999 10270861714 +-17721 13717 -587831330 -24442 -40 -1441635278 -489488557 15862627961 438243 -800561771 13902822234 14618057582 14703384005 23127 NULL NULL NULL NULL -800561771 -800561771 -800561771 23127 -800561771 -800561771 -800561771 NULL -9802 7625 -903316089 -16949 17 -2546571327 -2747511363 15862627961 38493 -800561771 59413049347 58570355880 60213611118 -39770 -8332 1824882165 -24738 52 1609316679 -2085860747 15862627961 -183119 -800561771 1159243956 1865685224 1959805727 +-14433 -8448 434021400 -12838 -90 -2135787575 -187208211 15862627961 940911 -1011669561 7302003527 5641577054 8313673088 -2904 NULL NULL NULL NULL -1011669561 -1011669561 -1011669561 -2904 -1011669561 -1011669561 -1011669561 NULL 65617 59887 -1143802338 28315 47 -3245711321 -3853408460 15862627961 -465 -1011669561 54716947420 53626707998 55728616981 -16856 -10871 1354539333 -9562 -61 -187208211 -921860586 15862627961 -711818 -1011669561 7548954873 9128831613 8560624434 +90245 56283 -1009656194 -28042 38 -1634505428 1074101516 15862627961 605927 -134213907 11318043778 13369268500 11452257685 19208 NULL NULL NULL NULL -134213907 -134213907 -134213907 19208 -134213907 -134213907 -134213907 NULL 56920 23665 -237425046 18287 113 -540397284 -205992899 15862627961 127256 -134213907 65645302382 65476544051 65779516289 2003 -31959 1593800404 67120 -117 -664229739 -541722291 15862627961 -354722 -134213907 4410370276 4074959867 4544584183 +-30917 -15175 -1927628110 -10871 -54 -2943527053 824461350 15862627961 949079 -4229382 6071369072 7973392910 6075598454 -1967 NULL NULL NULL NULL -4229382 -4229382 -4229382 -1967 -4229382 -4229382 -4229382 NULL 47625 29338 -134213907 16101 62 -247416655 148096120 15862627961 129206 -4229382 65888489655 65779516289 65892719037 -15742 NULL -1660426473 -18079 55 824461350 -2140016957 15862627961 -719049 -4229382 9787029507 10221050907 9791258889 +36636 -19881 1423957796 31696 52 450275604 -4140888104 15862627961 391728 -587831330 14030226252 15985872340 14618057582 24495 NULL NULL NULL NULL -587831330 -587831330 -587831330 24495 -587831330 -587831330 -587831330 NULL 32851 -32737 -644225469 50996 -29 -1861543279 -2013675248 15862627961 46039 -587831330 62160560710 61531074230 62748392040 67523 11006 -800561771 -8549 -5 -3496662635 2352299442 15862627961 -135236 -587831330 1244570379 1959805727 1832401709 +-37724 7017 670497898 36430 -98 311073214 1845356201 15862627961 813251 -2098805236 7930018515 9994173560 10028823751 13741 NULL NULL NULL NULL -2098805236 -2098805236 -2098805236 13741 -2098805236 -2098805236 -2098805236 NULL 39750 10334 -2138770630 -9223 -98 -6355522749 -7926048183 15862627961 7465 -2098805236 24402796316 22284849433 26501601552 28098 72839 2030965207 -15056 -53 -367071380 -489488557 15862627961 -567513 -2098805236 5833804210 3842670266 7932609446 +-22116 11412 -237425046 -26471 71 3390925772 -7024468539 15862627961 953437 -2117946883 5364314684 5255341318 7482261567 2045 NULL NULL NULL NULL -2117946883 -2117946883 -2117946883 2045 -2117946883 -2117946883 -2117946883 NULL 7465 -29777 -2141451704 26257 22 -6398169217 -8135514173 15862627961 -6276 -2117946883 22284849433 20146078803 24402796316 -21948 11580 -1927628110 -11396 113 -6071106818 5455080817 15862627961 -719395 -2117946883 8380366394 9816863161 10498313277 +-2090 -4237 -168758331 -13608 12 6149069904 -2420213359 15862627961 928929 2106705285 6889553023 7030771979 4782847738 8692 NULL NULL NULL NULL 2106705285 2106705285 2106705285 8692 2106705285 2106705285 2106705285 NULL 14450 6674 2053379412 -14704 83 6224239742 4250178376 15862627961 246701 2106705285 4250178376 6314333421 2143473091 -38792 -40939 1213926989 -6613 -76 -759786886 6588808232 15862627961 -688240 2106705285 11079780223 9630784700 8973074938 +-31090 -36 -335410409 46015 123 3395035512 1258109085 15862627961 660587 2033001162 10193867690 11787668094 8160866528 18109 NULL NULL NULL NULL 2033001162 2033001162 2033001162 18109 2033001162 2033001162 2033001162 NULL 14299 -4240 2025611582 -6507 97 6089577951 8185242656 15862627961 230728 2033001162 14499576077 16530541284 12466574915 33616 64670 41423756 -30544 97 2641271504 1946039989 15862627961 -410481 2033001162 7701761433 8554270670 5668760271 +-44611 -31959 1337043149 -8886 104 4160882907 7209871330 15862627961 462722 1991172974 4339704068 2457410212 2348531094 -24558 NULL NULL NULL NULL 1991172974 1991172974 1991172974 -24558 1991172974 1991172974 1991172974 NULL 32587 20609 1902023838 9371 -101 5848842900 8040942953 15862627961 203248 1991172974 22540519030 24496165118 20549346056 -55630 -42978 1689098844 -54145 -24 5156491918 3739840441 15862627961 -255283 1991172974 13514096867 15252428122 11522923893 +-32689 -38183 383352709 80491 -53 1584341489 2495165914 15862627961 785722 670497898 10664671458 9362375800 9994173560 14457 NULL NULL NULL NULL 670497898 670497898 670497898 14457 670497898 670497898 670497898 NULL -53620 -29881 623103518 38314 5 1953024150 2794786130 15862627961 121331 670497898 60605435298 61264858032 59934937400 57823 52329 -2098805236 -24442 77 3944161437 1645376618 15862627961 -539268 670497898 5868454401 7932609446 5197956503 +71051 40600 1188285940 51482 47 812635004 1210863559 15862627961 546713 762932956 13122545262 10983774632 12359612306 20744 NULL NULL NULL NULL 762932956 762932956 762932956 20744 762932956 762932956 762932956 NULL 71694 14926 706441268 61320 -5 2184609572 3322773533 15862627961 180389 762932956 57810649168 58525884516 57047716212 59319 28868 2051224722 27693 63 1840350039 1195987713 15862627961 -293972 762932956 3503015655 2493359461 2740082699 +-12381 -40939 -1331533190 12207 -56 -2472569238 2900644355 15862627961 920237 141218956 7030771979 6862013648 6889553023 8809 NULL NULL NULL NULL 141218956 141218956 141218956 8809 141218956 141218956 141218956 NULL 54443 32211 49866617 57908 123 252120702 1135821380 15862627961 154116 141218956 65740393535 65801428664 65599174579 35484 6926 -1448995523 -26471 122 1728676075 -6189260496 15862627961 -679431 141218956 8973074938 11079780223 8831855982 +36569 45118 439738328 56517 -2 2171332508 -559380590 15862627961 640723 1413111008 1942161073 2936465061 529050065 -18410 NULL NULL NULL NULL 1413111008 1413111008 1413111008 -18410 1413111008 1413111008 1413111008 NULL 7977 4956 1337043149 16312 -59 4104693490 5763298811 15862627961 233919 1413111008 42131665349 43486204682 40718554341 36636 45185 -928766616 43647 29 450275604 2212756264 15862627961 -427136 1413111008 15333577896 13191578758 13920466888 +4929 22467 1689098844 11267 -117 750085326 -2222183579 15862627961 354528 -1813935549 -405661362 -1078899005 1408274187 -28462 NULL NULL NULL NULL -1813935549 -1813935549 -1813935549 -28462 -1813935549 -1813935549 -1813935549 NULL -65798 3061 -1885422396 -11548 -60 -5581651801 -6731567910 15862627961 -51244 -1813935549 37995735862 36113442006 39809671411 20255 37793 427197269 59917 17 -2263607335 846995940 15862627961 -150993 -1813935549 14454353774 13231819784 16268289323 +9669 -10720 1489733240 36170 52 -6330479452 775314354 15862627961 879609 -2141451704 5974249258 5591766247 8115700962 -11122 NULL NULL NULL NULL -2141451704 -2141451704 -2141451704 -11122 -2141451704 -2141451704 -2141451704 NULL -8321 NULL NULL 37242 63 -4283450842 -8496974453 15862627961 -29777 -2141451704 18004627099 15862627961 20146078803 47750 27361 -842693467 -13608 73 -1049567811 -7024468539 15862627961 -658734 -2141451704 7746926999 6656687577 9888378703 +44727 27310 -382483011 60858 -101 2940130772 -3871666709 15862627961 867553 -1090239422 8115700962 5974249258 9205940384 -12056 NULL NULL NULL NULL -1090239422 -1090239422 -1090239422 -12056 -1090239422 -1090239422 -1090239422 NULL 14740 919 -1176490478 -3695 -107 -3410532238 -4040331793 15862627961 2439 -1090239422 53626707998 52482905660 54716947420 53780 36363 -1885422396 8900 -72 -1972491598 1796328434 15862627961 -647612 -1090239422 6656687577 5813994110 7746926999 +-68124 -47322 2053379412 -57682 -101 5160673327 7362171447 15862627961 803727 2047637360 9293832357 9880676835 7246194997 -13181 NULL NULL NULL NULL 2047637360 2047637360 2047637360 -13181 2047637360 2047637360 2047637360 NULL 21975 -2269 2030965207 20462 -117 6111603729 8216396539 15862627961 217547 2047637360 12466574915 14499576077 10418937555 -48148 -27346 2143473091 -71880 -31 5218698356 6899004582 15862627961 -584911 2047637360 8616432964 8269443337 6568795604 +-55203 -42978 -1899175111 -49963 17 2894556845 -2190825778 15862627961 771265 -1302295658 9362375800 9745728509 10664671458 15091 NULL NULL NULL NULL -1302295658 -1302295658 -1302295658 15091 -1302295658 -1302295658 -1302295658 NULL 17400 21659 -1339586153 29700 -117 -3973415001 -4845122464 15862627961 -15205 -1302295658 48781585534 47450052344 50083881192 -49576 -37351 2064155045 -57682 -25 -2287736392 3321754114 15862627961 -524177 -1302295658 5197956503 5868454401 6500252161 +74575 45185 1579876740 3056 71 -3553056774 -2085860747 15862627961 929454 -644225469 5379257015 6733796348 6023482484 -4667 NULL NULL NULL NULL -644225469 -644225469 -644225469 -4667 -644225469 -644225469 -644225469 NULL -6306 10643 -800561771 65588 -44 -2118024883 -2398685709 15862627961 5756 -644225469 60886848761 60213611118 61531074230 14062 -15328 -421042466 60858 29 -1285298976 -4140888104 15862627961 -702124 -644225469 9839145477 8499559324 10483370946 +57823 -22668 NULL -30544 125 3944161437 2125466408 15862627961 64578 912707948 16330286983 15862627961 15417579035 32064 NULL NULL NULL NULL 912707948 912707948 912707948 32064 912707948 912707948 912707948 NULL 63846 33380 794623392 -7782 29 2559840577 4267070199 15862627961 241709 912707948 55400583583 56253092820 54487875635 42295 -38196 240273900 5494 -86 1466043674 1845356201 15862627961 199483 912707948 445048926 -731441552 -467659022 +-16856 -4018 -673237643 NULL 96 -187208211 828690732 15862627961 324341 -1222533990 1408274187 -405661362 2630808177 -30187 NULL NULL NULL NULL -1222533990 -1222533990 -1222533990 -30187 -1222533990 -1222533990 -1222533990 NULL 21368 5358 -1331533190 47831 125 -3856362838 -4633066228 15862627961 -45392 -1222533990 50083881192 48781585534 51306415182 -12838 NULL 659422734 -5985 65 828690732 -2114836321 15862627961 -122531 -1222533990 13231819784 13659017053 14454353774 +32242 52329 -1222533990 36986 -56 -86961173 3300694238 15862627961 263497 659422734 2203610908 2630808177 1544188174 -30508 NULL NULL NULL NULL 659422734 659422734 659422734 -30508 659422734 659422734 659422734 NULL -63957 -30932 586844478 29383 17 1869370730 2738973516 15862627961 106874 659422734 61264858032 61887961550 60605435298 -1210 18877 NULL 44641 96 550424758 2125466408 15862627961 -62008 659422734 14318439787 15862627961 13659017053 +11586 -54988 2033001162 8900 68 -408248030 2212756264 15862627961 693544 41423756 7308357291 8160866528 7266933535 16337 NULL NULL NULL NULL 41423756 41423756 41423756 16337 41423756 41423756 41423756 NULL 53369 23125 -108973366 8573 68 -71778992 293544458 15862627961 145543 41423756 65892719037 65888489655 65851295281 46693 -19881 -629486480 -33532 123 799645256 -2222183579 15862627961 -445210 41423756 8595694426 8645561043 8554270670 +33616 -12399 -537142430 -6115 49 2641271504 974546445 15862627961 367233 1955646088 15985872340 17409830136 14030226252 24896 NULL NULL NULL NULL 1955646088 1955646088 1955646088 24896 1955646088 1955646088 1955646088 NULL -4189 -3056 1824882165 -28798 102 5682552091 7965623834 15862627961 227806 1955646088 24496165118 26398188956 22540519030 12762 -33253 715235348 -31054 -59 2856840301 3300694238 15862627961 -110340 1955646088 1832401709 1244570379 -123244379 +17679 27241 -2141451704 -5985 74 26303141 -2140016957 15862627961 855069 -842693467 9205940384 8115700962 10048633851 -12484 NULL NULL NULL NULL -842693467 -842693467 -842693467 -12484 -842693467 -842693467 -842693467 NULL 38958 -791 -928766616 -9610 31 -2674776172 -2960718350 15862627961 15366 -842693467 58570355880 57667039791 59413049347 -14433 -4871 2053379412 32854 52 -2135787575 2057268348 15862627961 -635556 -842693467 5813994110 3928571714 6656687577 +-13633 -2237 1902023838 -33528 -61 2937914773 -325765486 15862627961 946703 434021400 6075598454 6071369072 5641577054 -2376 NULL NULL NULL NULL 434021400 434021400 434021400 -2376 434021400 434021400 434021400 NULL -44761 -2174 427197269 -47906 -48 1292597347 2083707724 15862627961 185288 434021400 63348565756 63779944434 62914544356 -22116 -10720 -1011669561 11551 -111 3390925772 2308428293 15862627961 -717082 434021400 10221050907 8560624434 9787029507 +-38792 -25184 -2141999138 20389 103 -759786886 -6189260496 15862627961 578848 -1908480893 3599815819 2671049203 5508296712 -21739 NULL NULL NULL NULL -1908480893 -1908480893 -1908480893 -21739 -1908480893 -1908480893 -1908480893 NULL 20191 27371 -1991133944 -21024 45 -5827242947 -7575372256 15862627961 -1758 -1908480893 30420363606 28492735496 32328844499 9669 23277 1282464673 2147 36 -6330479452 -325765486 15862627961 -368590 -1908480893 10354331249 10785709927 12262812142 +87389 NULL 912707948 40175 97 -83707341 -541722291 15862627961 125217 240273900 16594069513 15417579035 16353795613 29533 NULL NULL NULL NULL 240273900 240273900 240273900 29533 240273900 240273900 240273900 NULL 51186 -236 61035129 56537 -43 442527985 1392032876 15862627961 183649 240273900 65599174579 65740393535 65358900679 117434 30045 -1143802338 31106 125 -407508384 -83707341 15862627961 136313 240273900 -491167652 -1394483741 -731441552 +14062 11006 1413111008 -15056 -60 -1285298976 1303653581 15862627961 600587 -928766616 2671049203 529050065 3599815819 -21481 NULL NULL NULL NULL -928766616 -928766616 -928766616 -21481 -928766616 -928766616 -928766616 NULL 13355 -14960 -1011669561 39749 97 -2950092371 -3475337943 15862627961 -1256 -928766616 56738273175 55728616981 57667039791 -35127 -38183 431378678 29390 -2 -1045189740 -3184474087 15862627961 -390071 -928766616 12262812142 10354331249 13191578758 +33616 -12399 2030965207 -6115 13 2641271504 974546445 15862627961 866208 794623392 9618016673 9988992488 8823393281 12636 NULL NULL NULL NULL 794623392 794623392 794623392 12636 794623392 794623392 794623392 NULL 96002 46002 715235348 30466 123 2272791696 3554144565 15862627961 193025 794623392 57047716212 57810649168 56253092820 12762 -33253 1993193190 -31054 -43 2856840301 3300694238 15862627961 -621575 794623392 7039234680 8338954313 6244611288 +20255 8988 1824882165 43647 -38 -2263607335 -1339125374 15862627961 525969 -2138770630 10983774632 12172060572 13122545262 21456 NULL NULL NULL NULL -2138770630 -2138770630 -2138770630 21456 -2138770630 -2138770630 -2138770630 NULL -6276 -18655 -2141999138 29416 -59 -6422221472 -8346656693 15862627961 -8321 -2138770630 20146078803 18004627099 22284849433 38577 27310 -1009656194 -17538 68 -3241149212 -1025454778 15862627961 -272516 -2138770630 2740082699 3503015655 4878853329 +11625 36363 2051224722 -31438 97 -2878810989 -1380600149 15862627961 624311 -335410409 11452257685 11318043778 11787668094 18384 NULL NULL NULL NULL -335410409 -335410409 -335410409 18384 -335410409 -335410409 -335410409 NULL -5940 -16388 -382483011 34619 -79 -1064883047 -875807693 15862627961 92637 -335410409 64903708596 64556718969 65239119005 -17721 7017 2033001162 31696 118 -1441635278 -3888467183 15862627961 -373930 -335410409 4074959867 5668760271 4410370276 +22255 28868 -1302295658 2147 22 1874406893 5455080817 15862627961 799510 2064155045 9994173560 10664671458 7930018515 13788 NULL NULL NULL NULL 2064155045 2064155045 2064155045 13788 2064155045 2064155045 2064155045 NULL 15973 6135 2051224722 -6012 -56 6168759179 6314333421 15862627961 238009 2064155045 6314333421 8367712833 4250178376 -2090 4523 -1991133944 10843 17 6149069904 2245382708 15862627961 -553725 2064155045 7932609446 5833804210 5868454401 +47750 11580 -1448995523 39440 113 -1049567811 2291766377 15862627961 947475 -237425046 5017916272 6231843261 5255341318 5281 NULL NULL NULL NULL -237425046 -237425046 -237425046 5281 -237425046 -237425046 -237425046 NULL 11013 -22782 -346989627 33255 122 -919825082 -649370650 15862627961 97918 -237425046 65239119005 64903708596 65476544051 53530 17360 -2117946883 20389 -99 2759425399 -2709994284 15862627961 -710197 -237425046 10607286643 10498313277 10844711689 +117434 77259 1299719633 16302 122 -407508384 -1995762929 15862627961 901298 -1331533190 5530480458 7523673648 6862013648 10837 NULL NULL NULL NULL -1331533190 -1331533190 -1331533190 10837 -1331533190 -1331533190 -1331533190 NULL 55239 34790 -1383162419 16010 77 -4054281762 -5032853316 15862627961 -30296 -1331533190 47450052344 46110466191 48781585534 37269 -2906 141218956 87389 -101 -1574720463 -1583998862 15862627961 -658464 -1331533190 9000614313 8831855982 10332147503 +-38792 -25184 2025611582 20389 36 -759786886 -6189260496 15862627961 712350 -1808210365 2191096542 2252131671 3999306907 -16312 NULL NULL NULL NULL -1808210365 -1808210365 -1808210365 -16312 -1808210365 -1808210365 -1808210365 NULL -84359 -36697 -1882293856 31902 -61 -5504439770 -6300794780 15862627961 -67556 -1808210365 39809671411 37995735862 41617881776 9669 23277 439738328 2147 30 -6330479452 -325765486 15862627961 -496665 -1808210365 11863321054 12486424572 13671531419 +54956 -546 397430452 -17958 -72 -774892077 -1392370326 15862627961 266156 -1383162419 16677615270 18003483588 18060777689 27138 NULL NULL NULL NULL -1383162419 -1383162419 -1383162419 27138 -1383162419 -1383162419 -1383162419 NULL 10111 -19200 -1660426473 20449 71 -4492584415 -5356577420 15862627961 -35654 -1383162419 44727303772 43278308249 46110466191 46712 -8790 -537142430 36986 70 -1775723035 1258109085 15862627961 -7021 -1383162419 -2198149728 -1010059745 -814987309 +41786 27361 NULL -5204 13 2529191423 5168794507 15862627961 32514 -467659022 15862627961 15862627961 16330286983 32514 NULL NULL NULL NULL -467659022 -467659022 -467659022 32514 -467659022 -467659022 -467659022 NULL 91279 40283 -587831330 -29605 112 -1592632782 -1618174126 15862627961 103858 -467659022 63285534470 62748392040 63753193492 12156 -2269 -1176490478 12207 NULL 3137829300 2291766377 15862627961 231997 -467659022 -467659022 445048926 NULL +59319 7837 -1991133944 11551 -5 1840350039 2245382708 15862627961 853572 370975815 9988992488 12019957695 9618016673 13080 NULL NULL NULL NULL 370975815 370975815 370975815 13080 370975815 370975815 370975815 NULL 50607 -7301 141218956 13121 -25 752468671 1578956245 15862627961 196729 370975815 65358900679 65599174579 64987924864 47245 -4237 1299719633 30451 -95 181227663 2427194517 15862627961 -608495 370975815 6244611288 7039234680 5873635473 +-16856 -4018 762932956 NULL 118 -187208211 828690732 15862627961 586719 2051224722 13369268500 12359612306 11318043778 19316 NULL NULL NULL NULL 2051224722 2051224722 2051224722 19316 2051224722 2051224722 2051224722 NULL 25213 31720 2033001162 9838 93 6131863244 8275464464 15862627961 236863 2051224722 10418937555 12466574915 8367712833 -12838 NULL -335410409 -5985 47 828690732 -2114836321 15862627961 -335406 2051224722 4544584183 4410370276 2493359461 +-7120 2479 -108973366 36740 -106 -888530120 846995940 15862627961 953631 1436496767 7482261567 5364314684 6045764800 194 NULL NULL NULL NULL 1436496767 1436496767 1436496767 194 1436496767 1436496767 1436496767 NULL -5953 -22265 1413111008 -43603 -12 4273565571 6050294921 15862627961 259399 1436496767 39294596545 40718554341 37858099778 -611 8988 1902023838 -29587 -59 2660931489 -2190825778 15862627961 -721440 1436496767 9816863161 7889235051 8380366394 +42295 72839 -1339586153 -31054 -12 1466043674 1253036374 15862627961 909464 702611616 7784111103 7363068637 7081499487 -7688 NULL NULL NULL NULL 702611616 702611616 702611616 -7688 702611616 702611616 702611616 NULL -18099 -47482 659422734 66746 -40 2032532248 2887221188 15862627961 113643 702611616 59934937400 60605435298 59232325784 -31090 -546 -382483011 80491 112 3395035512 1863474126 15862627961 -685155 702611616 8781128474 10270861714 8078516858 +-68124 -47322 -134213907 -57682 1 5160673327 7362171447 15862627961 642478 1593800404 11787668094 11452257685 10193867690 18167 NULL NULL NULL NULL 1593800404 1593800404 1593800404 18167 1593800404 1593800404 1593800404 NULL -51962 -40668 1544188174 -29582 64 4717865318 6846112668 15862627961 233963 1593800404 33244301624 34824178364 31650501220 -48148 -27346 852509237 -71880 38 5218698356 6899004582 15862627961 -392314 1593800404 5668760271 7701761433 4074959867 +-56933 -27346 -1090239422 -9599 93 -1044244963 437338198 15862627961 842457 -1885422396 10048633851 9205940384 11934056247 -12612 NULL NULL NULL NULL -1885422396 -1885422396 -1885422396 -12612 -1885422396 -1885422396 -1885422396 NULL -43877 -22853 -1908480893 -68859 -24 -5693078400 -7389862166 15862627961 1303 -1885422396 34228019610 32328844499 36113442006 -7120 22467 586844478 -12255 -101 -888530120 1009134449 15862627961 -623072 -1885422396 3928571714 5981951126 5813994110 +-39770 -15328 623103518 5494 54 1609316679 1981771941 15862627961 659133 994303988 2936465061 3376203389 1942161073 -18218 NULL NULL NULL NULL 994303988 994303988 994303988 -18218 994303988 994303988 994303988 NULL 27948 29256 852509237 32012 -85 2759521173 4542648191 15862627961 223491 994303988 54487875635 55400583583 53493571647 -32689 -8247 -2141999138 -31438 -48 1584341489 1303653581 15862627961 -445354 994303988 13920466888 15333577896 12926162900 +34485 17970 -629486480 33142 77 -9207907 1195987713 15862627961 756174 383352709 9745728509 7846553398 9362375800 15295 NULL NULL NULL NULL 383352709 383352709 383352709 15295 383352709 383352709 383352709 NULL 94879 38342 240273900 -24360 14 994602424 1639359108 15862627961 212024 383352709 64987924864 65358900679 64604572155 24352 7837 670497898 -6115 45 433054757 -1392370326 15862627961 -508882 383352709 6500252161 5197956503 6116899452 +44727 27310 1955646088 60858 31 2940130772 -3871666709 15862627961 415116 715235348 14618057582 14030226252 13902822234 23388 NULL NULL NULL NULL 715235348 715235348 715235348 23388 715235348 715235348 715235348 NULL 73515 6769 702611616 50000 -38 2124288232 3125300933 15862627961 159645 715235348 58525884516 59232325784 57810649168 53780 36363 706441268 8900 49 -1972491598 1796328434 15862627961 -159731 715235348 1959805727 1159243956 1244570379 +35484 23277 -800561771 14425 68 1728676075 4109068163 15862627961 482937 1824882165 13996942737 14703384005 12172060572 22080 NULL NULL NULL NULL 1824882165 1824882165 1824882165 22080 1824882165 1824882165 1824882165 NULL -12886 -8359 1689098844 -1133 55 5252312264 7673725065 15862627961 204381 1824882165 28223071121 29961402376 26398188956 41786 29579 -2138770630 28558 -40 2529191423 775314354 15862627961 -228860 1824882165 3690567389 4878853329 1865685224 +68836 12398 715235348 10843 -82 2056218702 887668931 15862627961 460857 706441268 14703384005 13902822234 13996942737 22614 NULL NULL NULL NULL 706441268 706441268 706441268 22614 706441268 706441268 706441268 NULL 22263 -16051 670497898 56768 52 2079550782 2979232964 15862627961 136257 706441268 59232325784 59934937400 58525884516 54201 -2237 1188285940 33142 31 447930603 1519076272 15862627961 -206246 706441268 1865685224 3690567389 1159243956 +-39770 -15328 -1011669561 5494 41 1609316679 1981771941 15862627961 934121 1354539333 6733796348 8313673088 5379257015 -3855 NULL NULL NULL NULL 1354539333 1354539333 1354539333 -3855 1354539333 1354539333 1354539333 NULL -4696 40365 1325868318 7070 54 4017450800 5628104904 15862627961 252329 1354539333 43486204682 44823247831 42131665349 -32689 -8247 -1339586153 -31438 -90 1584341489 1303653581 15862627961 -705979 1354539333 10483370946 9839145477 9128831613 +-611 -37351 852509237 -33532 -44 2660931489 -1025454778 15862627961 709418 49866617 7266933535 7308357291 7217066918 15874 NULL NULL NULL NULL 49866617 49866617 49866617 15874 49866617 49866617 49866617 NULL 18051 1950 -4229382 22232 30 87060991 492394602 15862627961 161417 49866617 65851295281 65892719037 65801428664 31670 -5070 -1899175111 -9599 62 1113315852 3560913151 15862627961 -461547 49866617 8645561043 8016074563 8595694426 +54201 43358 41423756 -6613 45 447930603 2308428293 15862627961 725206 -629486480 7217066918 7266933535 7846553398 15788 NULL NULL NULL NULL -629486480 -629486480 -629486480 15788 -629486480 -629486480 -629486480 NULL 30673 -4943 -673237643 82314 49 -1946949592 -2222119262 15862627961 21544 -629486480 61531074230 60886848761 62160560710 22255 11412 383352709 56438 68 1874406893 1210863559 15862627961 -477421 -629486480 8016074563 6116899452 8645561043 +-68124 -47322 -1176490478 -57682 57 5160673327 7362171447 15862627961 154323 -903316089 16353795613 16594069513 17257111702 29106 NULL NULL NULL NULL -903316089 -903316089 -903316089 29106 -903316089 -903316089 -903316089 NULL 12927 17786 -1009656194 -17427 -101 -2841738899 -3219808970 15862627961 27850 -903316089 57667039791 56738273175 58570355880 -48148 -27346 397430452 -71880 123 5218698356 6899004582 15862627961 106780 -903316089 -1394483741 -2538286079 -491167652 +-55630 -46744 -1813935549 -12255 3 5156491918 3321754114 15862627961 294005 427197269 2630808177 1408274187 2203610908 -30336 NULL NULL NULL NULL 427197269 427197269 427197269 -30336 427197269 427197269 427197269 NULL 4015 28375 383352709 -42587 103 1207980430 1732335675 15862627961 209850 427197269 64207141703 64604572155 63779944434 -8499 387 1544188174 -12652 -117 4624049772 5587870596 15862627961 -92344 427197269 13659017053 14318439787 13231819784 +9669 -10720 1325868318 36170 -29 -6330479452 775314354 15862627961 291746 1188089983 18060777689 16677615270 16872687706 25590 NULL NULL NULL NULL 1188089983 1188089983 1188089983 25590 1188089983 1188089983 1188089983 NULL 45858 13846 994303988 4688 68 3354362251 4872767585 15862627961 233927 1188089983 52321603367 53493571647 51133513384 47750 27361 1423957796 -13608 -8 -1049567811 -7024468539 15862627961 -34159 1188089983 -1010059745 -1547202175 -2198149728 +87389 NULL 1593800404 40175 62 -83707341 -541722291 15862627961 677207 852509237 8160866528 10193867690 7308357291 16620 NULL NULL NULL NULL 852509237 852509237 852509237 16620 852509237 852509237 852509237 NULL 105452 44132 762932956 -1308 13 2410065585 3931489453 15862627961 209645 852509237 56253092820 57047716212 55400583583 117434 30045 49866617 31106 1 -407508384 -83707341 15862627961 -428590 852509237 8554270670 8595694426 7701761433 +-22116 11412 1188089983 -26471 -5 3390925772 -7024468539 15862627961 342337 1423957796 17409830136 16872687706 15985872340 25286 NULL NULL NULL NULL 1423957796 1423957796 1423957796 25286 1423957796 1423957796 1423957796 NULL -19581 -26651 1354539333 -40474 71 4191608137 5894375977 15862627961 259205 1423957796 40718554341 42131665349 39294596545 -21948 11580 -587831330 -11396 -29 -6071106818 5455080817 15862627961 -85054 1423957796 -123244379 1832401709 -1547202175 +-31020 23125 -1882293856 -12652 64 1208315423 6899004582 15862627961 437586 1738331255 2348531094 4339704068 610199839 -25136 NULL NULL NULL NULL 1738331255 1738331255 1738331255 -25136 1738331255 1738331255 1738331255 NULL -14350 15232 1593800404 45505 -82 5021230503 7420883346 15862627961 182301 1738331255 29961402376 31650501220 28223071121 -44611 9534 -673237643 16302 102 4160882907 1074101516 15862627961 -230725 1738331255 15252428122 16941526966 13514096867 +20625 6926 -1660426473 11361 29 2284185998 3645319585 15862627961 937976 1579876740 8313673088 7302003527 6733796348 -2935 NULL NULL NULL NULL 1579876740 1579876740 1579876740 -2935 1579876740 1579876740 1579876740 NULL -25242 -8974 1489733240 -33495 97 4613798154 6601107243 15862627961 215796 1579876740 34824178364 36368366538 33244301624 40940 27241 -644225469 39440 -107 5636453529 4109068163 15862627961 -708914 1579876740 9128831613 10483370946 7548954873 +77259 NULL -467659022 67120 123 -1176490478 -1583998862 15862627961 95684 -1176490478 15417579035 16330286983 16594069513 31106 NULL NULL NULL NULL -1176490478 -1176490478 -1176490478 31106 -1176490478 -1176490478 -1176490478 NULL 55628 25928 -1302295658 13821 57 -3701320126 -4422201799 15862627961 -14286 -1176490478 51306415182 50083881192 52482905660 98226 20967 -903316089 NULL 13 -252465672 -1176490478 15862627961 167419 -1176490478 -731441552 -491167652 445048926 +47245 35694 -1808210365 -11396 29 181227663 6588808232 15862627961 677351 439738328 3376203389 3999306907 2936465061 -18025 NULL NULL NULL NULL 439738328 439738328 439738328 -18025 439738328 439738328 439738328 NULL -85830 -52522 431378678 -60389 -31 1305138406 2309109058 15862627961 167263 439738328 62914544356 63348565756 62474806028 -13633 -25184 1413111008 51482 36 2937914773 887668931 15862627961 -463379 439738328 12926162900 13920466888 12486424572 +2003 30045 -644225469 -71880 5 -664229739 3739840441 15862627961 917152 -421042466 7363068637 6023482484 7784111103 -6823 NULL NULL NULL NULL -421042466 -421042466 -421042466 -6823 -421042466 -421042466 -421042466 NULL 65926 49800 -537142430 -4398 73 -1425843918 -1485925513 15862627961 97035 -421042466 63753193492 63285534470 64174235958 -74786 -46744 1489733240 33962 71 1748667467 -1995762929 15862627961 -691978 -421042466 8078516858 8781128474 8499559324 +-74786 -2906 -928766616 -20802 73 1748667467 5587870596 15862627961 556662 431378678 5508296712 3599815819 5076918034 -22186 NULL NULL NULL NULL 431378678 431378678 431378678 -22186 431378678 431378678 431378678 NULL -11441 43457 397430452 -33308 -54 1256006399 1891982884 15862627961 187664 431378678 63779944434 64207141703 63348565756 -68124 3756 1337043149 -28042 -60 5160673327 1639694101 15862627961 -346851 431378678 10785709927 12068174600 10354331249 +-1210 -38196 994303988 55502 36 550424758 714841163 15862627961 622068 -2141999138 529050065 1942161073 2671049203 -18655 NULL NULL NULL NULL -2141999138 -2141999138 -2141999138 -18655 -2141999138 -2141999138 -2141999138 NULL -29777 NULL NULL 12379 -72 -2141999138 -8540168355 15862627961 -18655 -2141999138 15862627961 15862627961 18004627099 54956 17970 -1908480893 -20087 54 -774892077 1253036374 15862627961 -408726 -2141999138 13191578758 12262812142 15333577896 +12762 18877 -421042466 16515 73 2856840301 -546350337 15862627961 900296 1489733240 7081499487 7784111103 5591766247 -9168 NULL NULL NULL NULL 1489733240 1489733240 1489733240 -9168 1489733240 1489733240 1489733240 NULL -33598 6876 1423957796 -16268 -56 4350187803 6207598558 15862627961 250231 1489733240 37858099778 39294596545 36368366538 34485 40600 -2141451704 46015 5 -9207907 714841163 15862627961 -677467 1489733240 10270861714 9888378703 8781128474 +57823 -22668 370975815 -30544 -101 3944161437 2125466408 15862627961 878821 1299719633 8823393281 9618016673 7523673648 12613 NULL NULL NULL NULL 1299719633 1299719633 1299719633 12613 1299719633 1299719633 1299719633 NULL 45053 27189 1213926989 1101 70 3796111295 5317170433 15862627961 251228 1299719633 47448835782 48731300455 46149116149 42295 -38196 -1331533190 5494 -5 1466043674 1845356201 15862627961 -634211 1299719633 8338954313 10332147503 7039234680 +-8499 3756 2047637360 -29587 -85 4624049772 -144263301 15862627961 775806 2143473091 7593184624 7246194997 5449711533 -14704 NULL NULL NULL NULL 2143473091 2143473091 2143473091 -14704 2143473091 2143473091 2143473091 NULL -4866 1146 2064155045 NULL NULL 6314333421 2143473091 15862627961 231997 2143473091 2143473091 4250178376 NULL -56933 -44678 2025611582 -8886 -101 -1044244963 7362171447 15862627961 -558513 2143473091 10412916428 11584884708 8269443337 +98226 31106 1993193190 33962 -76 -252465672 -1743478794 15862627961 911428 -168758331 6862013648 5530480458 7030771979 10130 NULL NULL NULL NULL -168758331 -168758331 -168758331 10130 -168758331 -168758331 -168758331 NULL 39786 5167 -335410409 21158 118 -741593786 -416174986 15862627961 108048 -168758331 65476544051 65239119005 65645302382 90245 23125 2106705285 77259 120 -1634505428 -252465672 15862627961 -669301 -168758331 8831855982 8973074938 9000614313 +36394 -8247 141218956 -20087 -99 1160862510 1946039989 15862627961 936581 -1448995523 4782847738 6889553023 6231843261 7652 NULL NULL NULL NULL -1448995523 -1448995523 -1448995523 7652 -1448995523 -1448995523 -1448995523 NULL -12872 -44774 -1808210365 32496 -8 -4917632361 -5503277285 15862627961 -62792 -1448995523 43278308249 41617881776 44727303772 32242 -12399 -237425046 36430 -56 -86961173 2495165914 15862627961 -696932 -1448995523 9630784700 10844711689 11079780223 +-21948 4523 -4229382 28558 -107 -6071106818 -2709994284 15862627961 943815 -1660426473 5641577054 6075598454 7302003527 -2888 NULL NULL NULL NULL -1660426473 -1660426473 -1660426473 -2888 -1660426473 -1660426473 -1660426473 NULL -64095 -52547 -1813935549 29311 12 -5282572387 -5832170568 15862627961 -70444 -1660426473 41617881776 39809671411 43278308249 -12381 14090 1579876740 -33528 -54 -2472569238 -2420213359 15862627961 -714706 -1660426473 8560624434 7548954873 10221050907 +2913 -2269 2106705285 -18079 -79 1253758252 -921860586 15862627961 942194 1213926989 6231843261 4782847738 5017916272 5613 NULL NULL NULL NULL 1213926989 1213926989 1213926989 5613 1213926989 1213926989 1213926989 NULL 15124 10436 1188089983 17864 73 3590302912 5121979613 15862627961 261116 1213926989 49945227444 51133513384 48731300455 1164 -4018 -108973366 11361 12 89808975 3279369834 15862627961 -704584 1213926989 10844711689 10607286643 9630784700 +-7120 2479 1354539333 36740 112 -888530120 846995940 15862627961 923975 -1339586153 6023482484 5379257015 7363068637 -5479 NULL NULL NULL NULL -1339586153 -1339586153 -1339586153 -5479 -1339586153 -1339586153 -1339586153 NULL 37260 4764 -1448995523 -4259 120 -4171744095 -5195948991 15862627961 -41133 -1339586153 46110466191 44727303772 47450052344 -611 8988 702611616 -29587 41 2660931489 -2190825778 15862627961 -697457 -1339586153 8499559324 8078516858 9839145477 +12156 17360 2143473091 32854 30 3137829300 3279369834 15862627961 744772 2025611582 4277743253 5449711533 2252131671 -15880 NULL NULL NULL NULL 2025611582 2025611582 2025611582 -15880 2025611582 2025611582 2025611582 NULL 9709 338 1991172974 18539 -95 6009977746 8137215311 15862627961 199008 2025611582 18556152866 20549346056 16530541284 14039 19243 -1808210365 14425 -85 2065442845 4309797580 15862627961 -528655 2025611582 13610496290 13671531419 11584884708 + + +query IIIIIII +SELECT + c8, + LEAD(c8) OVER () next_c8, + LEAD(c8, 10, 10) OVER() next_10_c8, + LEAD(c8, 100, 10) OVER() next_out_of_bounds_c8, + LAG(c8) OVER() prev_c8, + LAG(c8, -2, 0) OVER() AS prev_2_c8, + LAG(c8, -200, 10) OVER() AS prev_out_of_bounds_c8 +FROM aggregate_test_100_by_sql +ORDER BY c8; +---- +102 33715 48099 10 31648 28086 10 +299 NULL 10 10 7781 0 10 +363 17910 40566 10 48048 27744 10 +417 18736 53000 10 45185 29458 10 +794 44507 49283 10 3583 40622 10 +829 33821 11872 10 61069 59663 10 +832 53012 2684 10 40622 48483 10 +1535 34970 48048 10 50842 2516 10 +2516 57594 17910 10 34970 36599 10 +2555 24770 34970 10 28086 53000 10 +2684 47061 57751 10 12876 14722 10 +2809 56980 3691 10 64517 27600 10 +2986 35477 28086 10 12757 45185 10 +3583 794 24022 10 35429 44507 10 +3691 50009 35429 10 63353 5494 10 +3975 59134 10 10 39363 30972 10 +4168 24022 829 10 15573 49283 10 +5382 12393 31648 10 24380 12757 10 +5494 21119 794 10 50009 52046 10 +7781 299 10 10 30972 0 10 +9489 52286 32712 10 14337 34331 10 +9832 20807 12393 10 34331 17835 10 +11872 39363 10 10 57885 3975 10 +12393 12757 102 10 5382 2986 10 +12757 2986 33715 10 12393 35477 10 +12876 2684 29527 10 45253 47061 10 +13763 15573 53815 10 48483 4168 10 +14337 9489 15777 10 43062 52286 10 +14722 53815 54276 10 47061 61069 10 +15573 4168 61069 10 13763 24022 10 +15777 32712 18736 10 62167 24380 10 +17835 57510 2986 10 20807 45465 10 +17910 27744 34206 10 363 20421 10 +18736 29458 39635 10 417 35106 10 +20120 57885 10 10 54276 11872 10 +20421 63353 23948 10 27744 3691 10 +20807 17835 12757 10 9832 57510 10 +21119 52046 44507 10 5494 40566 10 +21463 48099 56980 10 43655 50842 10 +23948 61637 13763 10 55620 35429 10 +24022 49283 33821 10 4168 45253 10 +24380 5382 35106 10 32712 12393 10 +24770 53000 2516 10 2555 39635 10 +27034 48048 21119 10 27600 363 10 +27600 27034 5494 10 56980 48048 10 +27744 20421 55620 10 17910 63353 10 +28086 2555 1535 10 33715 24770 10 +29458 35106 52569 10 18736 31648 10 +29527 57751 30972 10 30296 42171 10 +30296 29527 59134 10 59663 57751 10 +30972 7781 10 10 59134 299 10 +31648 102 21463 10 35106 33715 10 +32712 24380 29458 10 15777 5382 10 +33715 28086 50842 10 102 2555 10 +33821 59663 39363 10 829 30296 10 +34206 55620 53012 10 40566 23948 10 +34331 9832 5382 10 52286 20807 10 +34970 2516 363 10 1535 57594 10 +35106 31648 43655 10 29458 102 10 +35429 3583 4168 10 61637 794 10 +35477 45185 2555 10 2986 417 10 +36599 64517 20421 10 57594 2809 10 +39363 3975 10 10 11872 59134 10 +39635 52569 36599 10 53000 43655 10 +40566 34206 832 10 52046 55620 10 +40622 832 12876 10 44507 53012 10 +42171 54276 299 10 57751 20120 10 +43062 14337 62167 10 NULL 9489 10 +43655 21463 2809 10 52569 48099 10 +44507 40622 45253 10 794 832 10 +45185 417 24770 10 35477 18736 10 +45253 12876 30296 10 49283 2684 10 +45465 62167 45185 10 57510 15777 10 +47061 14722 42171 10 2684 53815 10 +48048 363 52046 10 27034 17910 10 +48099 50842 27600 10 21463 1535 10 +48483 13763 14722 10 53012 15573 10 +49283 45253 59663 10 24022 12876 10 +50009 5494 3583 10 3691 21119 10 +50842 1535 27034 10 48099 34970 10 +52046 40566 40622 10 21119 34206 10 +52286 34331 24380 10 9489 9832 10 +52569 43655 64517 10 39635 21463 10 +53000 39635 57594 10 24770 52569 10 +53012 48483 47061 10 832 13763 10 +53815 61069 20120 10 14722 829 10 +54276 20120 10 10 42171 57885 10 +55620 23948 48483 10 34206 61637 10 +56980 27600 50009 10 2809 27034 10 +57510 45465 35477 10 17835 62167 10 +57594 36599 27744 10 2516 64517 10 +57751 42171 7781 10 29527 54276 10 +57885 11872 10 10 20120 39363 10 +59134 30972 10 10 3975 7781 10 +59663 30296 3975 10 33821 29527 10 +61069 829 57885 10 53815 33821 10 +61637 35429 15573 10 23948 3583 10 +62167 15777 417 10 45465 32712 10 +63353 3691 61637 10 20421 50009 10 +64517 2809 63353 10 36599 56980 10 + + +query IIIRIII +SELECT + c9, + row_number() OVER (ORDER BY c2, c9) AS row_number, + count(c3) OVER (ORDER BY c9) AS count_c3, + avg(c3) OVER (ORDER BY c2) AS avg_c3_by_c2, + sum(c3) OVER (ORDER BY c2) AS sum_c3_by_c2, + max(c3) OVER (ORDER BY c2) AS max_c3_by_c2, + min(c3) OVER (ORDER BY c2) AS min_c3_by_c2 +FROM aggregate_test_100_by_sql +ORDER BY row_number; +---- +225513085 1 6 16.681818181818 367 125 -99 +473294098 2 11 16.681818181818 367 125 -99 +520189543 3 12 16.681818181818 367 125 -99 +774637006 4 19 16.681818181818 367 125 -99 +879082834 5 21 16.681818181818 367 125 -99 +1454057357 6 34 16.681818181818 367 125 -99 +1842680163 7 40 16.681818181818 367 125 -99 +2125812933 8 46 16.681818181818 367 125 -99 +2610290479 9 56 16.681818181818 367 125 -99 +2669374863 10 57 16.681818181818 367 125 -99 +2712615025 11 59 16.681818181818 367 125 -99 +2830981072 12 62 16.681818181818 367 125 -99 +2861376515 13 64 16.681818181818 367 125 -99 +3275293996 14 72 16.681818181818 367 125 -99 +3276123488 15 73 16.681818181818 367 125 -99 +3542840110 16 82 16.681818181818 367 125 -99 +3625286410 17 87 16.681818181818 367 125 -99 +3766999078 18 90 16.681818181818 367 125 -99 +4015442341 19 94 16.681818181818 367 125 -99 +4076864659 20 96 16.681818181818 367 125 -99 +4216440507 21 98 16.681818181818 367 125 -99 +4229654142 22 99 16.681818181818 367 125 -99 +63044568 23 2 12.522727272727 551 125 -117 +141680161 24 4 12.522727272727 551 125 -117 +145294611 25 5 12.522727272727 551 125 -117 +598822671 26 16 12.522727272727 551 125 -117 +1000948272 27 24 12.522727272727 551 125 -117 +1098639440 28 27 12.522727272727 551 125 -117 +1157161427 29 28 12.522727272727 551 125 -117 +1289293657 30 31 12.522727272727 551 125 -117 +1491205016 31 35 12.522727272727 551 125 -117 +2013662838 32 43 12.522727272727 551 125 -117 +2293105904 33 48 12.522727272727 551 125 -117 +2525744318 34 54 12.522727272727 551 125 -117 +2705709344 35 58 12.522727272727 551 125 -117 +2844041986 36 63 12.522727272727 551 125 -117 +2939920218 37 66 12.522727272727 551 125 -117 +3188005828 38 70 12.522727272727 551 125 -117 +3314983189 39 74 12.522727272727 551 125 -117 +3398507249 40 77 12.522727272727 551 125 -117 +3455216719 41 78 12.522727272727 551 125 -117 +3717551163 42 88 12.522727272727 551 125 -117 +4061635107 43 95 12.522727272727 551 125 -117 +4144173353 44 97 12.522727272727 551 125 -117 +243203849 45 7 15.015873015873 946 125 -117 +431948861 46 9 15.015873015873 946 125 -117 +559847112 47 15 15.015873015873 946 125 -117 +754775609 48 18 15.015873015873 946 125 -117 +1088543984 49 26 15.015873015873 946 125 -117 +1362369177 50 32 15.015873015873 946 125 -117 +1538863055 51 37 15.015873015873 946 125 -117 +1824517658 52 39 15.015873015873 946 125 -117 +1995343206 53 42 15.015873015873 946 125 -117 +2093538928 54 45 15.015873015873 946 125 -117 +2214035726 55 47 15.015873015873 946 125 -117 +2592330556 56 55 15.015873015873 946 125 -117 +3105312559 57 68 15.015873015873 946 125 -117 +3473924576 58 80 15.015873015873 946 125 -117 +3577318119 59 85 15.015873015873 946 125 -117 +3759340273 60 89 15.015873015873 946 125 -117 +3862393166 61 91 15.015873015873 946 125 -117 +3959216334 62 92 15.015873015873 946 125 -117 +3998790955 63 93 15.015873015873 946 125 -117 +28774375 64 1 11.337209302326 975 125 -117 +326151275 65 8 11.337209302326 975 125 -117 +466439833 66 10 11.337209302326 975 125 -117 +538589788 67 13 11.337209302326 975 125 -117 +557517119 68 14 11.337209302326 975 125 -117 +811650497 69 20 11.337209302326 975 125 -117 +933879086 70 22 11.337209302326 975 125 -117 +1243785310 71 30 11.337209302326 975 125 -117 +1534194097 72 36 11.337209302326 975 125 -117 +1787652631 73 38 11.337209302326 975 125 -117 +1865307672 74 41 11.337209302326 975 125 -117 +2042457019 75 44 11.337209302326 975 125 -117 +2306130875 76 49 11.337209302326 975 125 -117 +2502326480 77 53 11.337209302326 975 125 -117 +2778168728 78 60 11.337209302326 975 125 -117 +2818832252 79 61 11.337209302326 975 125 -117 +3023531799 80 67 11.337209302326 975 125 -117 +3126475872 81 69 11.337209302326 975 125 -117 +3198969145 82 71 11.337209302326 975 125 -117 +3521368277 83 81 11.337209302326 975 125 -117 +3566741189 84 83 11.337209302326 975 125 -117 +3570297463 85 84 11.337209302326 975 125 -117 +3593959807 86 86 11.337209302326 975 125 -117 +141047417 87 3 7.81 781 125 -117 +662099130 88 17 7.81 781 125 -117 +974297360 89 23 7.81 781 125 -117 +1013876852 90 25 7.81 781 125 -117 +1229567292 91 29 7.81 781 125 -117 +1365198901 92 33 7.81 781 125 -117 +2307004493 93 50 7.81 781 125 -117 +2424630722 94 51 7.81 781 125 -117 +2496054700 95 52 7.81 781 125 -117 +2861911482 96 65 7.81 781 125 -117 +3342719438 97 75 7.81 781 125 -117 +3373581039 98 76 7.81 781 125 -117 +3457053821 99 79 7.81 781 125 -117 +4268716378 100 100 7.81 781 125 -117 + + +query IIIRIII +SELECT + c9, + row_number() OVER (PARTITION BY c2, c9) AS row_number, + count(c3) OVER (PARTITION BY c2) AS count_c3, + avg(c3) OVER (PARTITION BY c2) AS avg_c3_by_c2, + sum(c3) OVER (PARTITION BY c2) AS sum_c3_by_c2, + max(c3) OVER (PARTITION BY c2) AS max_c3_by_c2, + min(c3) OVER (PARTITION BY c2) AS min_c3_by_c2 +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +28774375 1 23 1.260869565217 29 123 -117 +63044568 1 22 8.363636363636 184 122 -117 +141047417 1 14 -13.857142857143 -194 118 -101 +141680161 1 22 8.363636363636 184 122 -117 +145294611 1 22 8.363636363636 184 122 -117 +225513085 1 22 16.681818181818 367 125 -99 +243203849 1 19 20.789473684211 395 123 -101 +326151275 1 23 1.260869565217 29 123 -117 +431948861 1 19 20.789473684211 395 123 -101 +466439833 1 23 1.260869565217 29 123 -117 +473294098 1 22 16.681818181818 367 125 -99 +520189543 1 22 16.681818181818 367 125 -99 +538589788 1 23 1.260869565217 29 123 -117 +557517119 1 23 1.260869565217 29 123 -117 +559847112 1 19 20.789473684211 395 123 -101 +598822671 1 22 8.363636363636 184 122 -117 +662099130 1 14 -13.857142857143 -194 118 -101 +754775609 1 19 20.789473684211 395 123 -101 +774637006 1 22 16.681818181818 367 125 -99 +811650497 1 23 1.260869565217 29 123 -117 +879082834 1 22 16.681818181818 367 125 -99 +933879086 1 23 1.260869565217 29 123 -117 +974297360 1 14 -13.857142857143 -194 118 -101 +1000948272 1 22 8.363636363636 184 122 -117 +1013876852 1 14 -13.857142857143 -194 118 -101 +1088543984 1 19 20.789473684211 395 123 -101 +1098639440 1 22 8.363636363636 184 122 -117 +1157161427 1 22 8.363636363636 184 122 -117 +1229567292 1 14 -13.857142857143 -194 118 -101 +1243785310 1 23 1.260869565217 29 123 -117 +1289293657 1 22 8.363636363636 184 122 -117 +1362369177 1 19 20.789473684211 395 123 -101 +1365198901 1 14 -13.857142857143 -194 118 -101 +1454057357 1 22 16.681818181818 367 125 -99 +1491205016 1 22 8.363636363636 184 122 -117 +1534194097 1 23 1.260869565217 29 123 -117 +1538863055 1 19 20.789473684211 395 123 -101 +1787652631 1 23 1.260869565217 29 123 -117 +1824517658 1 19 20.789473684211 395 123 -101 +1842680163 1 22 16.681818181818 367 125 -99 +1865307672 1 23 1.260869565217 29 123 -117 +1995343206 1 19 20.789473684211 395 123 -101 +2013662838 1 22 8.363636363636 184 122 -117 +2042457019 1 23 1.260869565217 29 123 -117 +2093538928 1 19 20.789473684211 395 123 -101 +2125812933 1 22 16.681818181818 367 125 -99 +2214035726 1 19 20.789473684211 395 123 -101 +2293105904 1 22 8.363636363636 184 122 -117 +2306130875 1 23 1.260869565217 29 123 -117 +2307004493 1 14 -13.857142857143 -194 118 -101 +2424630722 1 14 -13.857142857143 -194 118 -101 +2496054700 1 14 -13.857142857143 -194 118 -101 +2502326480 1 23 1.260869565217 29 123 -117 +2525744318 1 22 8.363636363636 184 122 -117 +2592330556 1 19 20.789473684211 395 123 -101 +2610290479 1 22 16.681818181818 367 125 -99 +2669374863 1 22 16.681818181818 367 125 -99 +2705709344 1 22 8.363636363636 184 122 -117 +2712615025 1 22 16.681818181818 367 125 -99 +2778168728 1 23 1.260869565217 29 123 -117 +2818832252 1 23 1.260869565217 29 123 -117 +2830981072 1 22 16.681818181818 367 125 -99 +2844041986 1 22 8.363636363636 184 122 -117 +2861376515 1 22 16.681818181818 367 125 -99 +2861911482 1 14 -13.857142857143 -194 118 -101 +2939920218 1 22 8.363636363636 184 122 -117 +3023531799 1 23 1.260869565217 29 123 -117 +3105312559 1 19 20.789473684211 395 123 -101 +3126475872 1 23 1.260869565217 29 123 -117 +3188005828 1 22 8.363636363636 184 122 -117 +3198969145 1 23 1.260869565217 29 123 -117 +3275293996 1 22 16.681818181818 367 125 -99 +3276123488 1 22 16.681818181818 367 125 -99 +3314983189 1 22 8.363636363636 184 122 -117 +3342719438 1 14 -13.857142857143 -194 118 -101 +3373581039 1 14 -13.857142857143 -194 118 -101 +3398507249 1 22 8.363636363636 184 122 -117 +3455216719 1 22 8.363636363636 184 122 -117 +3457053821 1 14 -13.857142857143 -194 118 -101 +3473924576 1 19 20.789473684211 395 123 -101 +3521368277 1 23 1.260869565217 29 123 -117 +3542840110 1 22 16.681818181818 367 125 -99 +3566741189 1 23 1.260869565217 29 123 -117 +3570297463 1 23 1.260869565217 29 123 -117 +3577318119 1 19 20.789473684211 395 123 -101 +3593959807 1 23 1.260869565217 29 123 -117 +3625286410 1 22 16.681818181818 367 125 -99 +3717551163 1 22 8.363636363636 184 122 -117 +3759340273 1 19 20.789473684211 395 123 -101 +3766999078 1 22 16.681818181818 367 125 -99 +3862393166 1 19 20.789473684211 395 123 -101 +3959216334 1 19 20.789473684211 395 123 -101 +3998790955 1 19 20.789473684211 395 123 -101 +4015442341 1 22 16.681818181818 367 125 -99 +4061635107 1 22 8.363636363636 184 122 -117 +4076864659 1 22 16.681818181818 367 125 -99 +4144173353 1 22 8.363636363636 184 122 -117 +4216440507 1 22 16.681818181818 367 125 -99 +4229654142 1 22 16.681818181818 367 125 -99 +4268716378 1 14 -13.857142857143 -194 118 -101 + + +query IIIRIII +SELECT + c9, + row_number() OVER (PARTITION BY c2 ORDER BY c9) AS row_number, + count(c3) OVER (PARTITION BY c2 ORDER BY c9) AS count_c3, + avg(c3) OVER (PARTITION BY c2 ORDER BY c9) AS avg_c3_by_c2, + sum(c3) OVER (PARTITION BY c2 ORDER BY c9) AS sum_c3_by_c2, + max(c3) OVER (PARTITION BY c2 ORDER BY c9) AS max_c3_by_c2, + min(c3) OVER (PARTITION BY c2 ORDER BY c9) AS min_c3_by_c2 +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +28774375 1 1 30 30 30 30 +63044568 1 1 113 113 113 113 +141047417 1 1 36 36 36 36 +141680161 2 2 3.5 7 113 -106 +145294611 3 3 17.333333333333 52 113 -106 +225513085 1 1 -98 -98 -98 -98 +243203849 1 1 -101 -101 -101 -101 +326151275 2 2 38.5 77 47 30 +431948861 2 2 -43.5 -87 14 -101 +466439833 3 3 -8 -24 47 -101 +473294098 2 2 -14 -28 70 -98 +520189543 3 3 -17.333333333333 -52 70 -98 +538589788 4 4 12.25 49 73 -101 +557517119 5 5 -1.4 -7 73 -101 +559847112 3 3 -60.666666666667 -182 14 -101 +598822671 4 4 5.75 23 113 -106 +662099130 2 2 50 100 64 36 +754775609 4 4 -41.25 -165 17 -101 +774637006 4 4 -34.25 -137 70 -98 +811650497 6 6 8 48 73 -101 +879082834 5 5 -16 -80 70 -98 +933879086 7 7 9.285714285714 65 73 -101 +974297360 3 3 56 168 68 36 +1000948272 5 5 23.2 116 113 -106 +1013876852 4 4 34.25 137 68 -31 +1088543984 5 5 -18.4 -92 73 -101 +1098639440 6 6 24.5 147 113 -106 +1157161427 7 7 5.714285714286 40 113 -107 +1229567292 5 5 51 255 118 -31 +1243785310 8 8 -5.75 -46 73 -111 +1289293657 8 8 11.125 89 113 -107 +1362369177 6 6 -11.666666666667 -70 73 -101 +1365198901 6 6 32.666666666667 196 118 -59 +1454057357 6 6 -22.666666666667 -136 70 -98 +1491205016 9 9 10 90 113 -107 +1534194097 9 9 6.222222222222 56 102 -111 +1538863055 7 7 -7.571428571429 -53 73 -101 +1787652631 10 10 1.8 18 102 -111 +1824517658 8 8 -16.125 -129 73 -101 +1842680163 7 7 -11.714285714286 -82 70 -98 +1865307672 11 11 7.545454545455 83 102 -111 +1995343206 9 9 -22.333333333333 -201 73 -101 +2013662838 10 10 14.2 142 113 -107 +2042457019 12 12 15 180 102 -111 +2093538928 10 10 -12.4 -124 77 -101 +2125812933 8 8 -5.125 -41 70 -98 +2214035726 11 11 -10.090909090909 -111 77 -101 +2293105904 11 11 2.272727272727 25 113 -117 +2306130875 13 13 14.076923076923 183 102 -111 +2307004493 7 7 36.857142857143 258 118 -59 +2424630722 8 8 31.625 253 118 -59 +2496054700 9 9 16.888888888889 152 118 -101 +2502326480 14 14 9.214285714286 129 102 -111 +2525744318 12 12 -2.916666666667 -35 113 -117 +2592330556 12 12 1 12 123 -101 +2610290479 9 9 -0.555555555556 -5 70 -98 +2669374863 10 10 -1 -10 70 -98 +2705709344 13 13 2.153846153846 28 113 -117 +2712615025 11 11 2.545454545455 28 70 -98 +2778168728 15 15 5.066666666667 76 102 -111 +2818832252 16 16 -0.1875 -3 102 -111 +2830981072 12 12 12.333333333333 148 120 -98 +2844041986 14 14 -2.285714285714 -32 113 -117 +2861376515 13 13 10.769230769231 140 120 -98 +2861911482 10 10 6.6 66 118 -101 +2939920218 15 15 -5 -75 113 -117 +3023531799 17 17 -7.058823529412 -120 102 -117 +3105312559 13 13 6.384615384615 83 123 -101 +3126475872 18 18 -6.388888888889 -115 102 -117 +3188005828 16 16 1.375 22 113 -117 +3198969145 19 19 -2.157894736842 -41 102 -117 +3275293996 14 14 12.071428571429 169 120 -98 +3276123488 15 15 9.6 144 120 -98 +3314983189 17 17 4.352941176471 74 113 -117 +3342719438 11 11 -1.454545454545 -16 118 -101 +3373581039 12 12 -4.666666666667 -56 118 -101 +3398507249 18 18 5.722222222222 103 113 -117 +3455216719 19 19 9 171 113 -117 +3457053821 13 13 -7.692307692308 -100 118 -101 +3473924576 14 14 12.857142857143 180 123 -101 +3521368277 20 20 2.75 55 102 -117 +3542840110 16 16 4.5 72 120 -98 +3566741189 21 21 8.47619047619 178 123 -117 +3570297463 22 22 5.409090909091 119 123 -117 +3577318119 15 15 18.933333333333 284 123 -101 +3593959807 23 23 1.260869565217 29 123 -117 +3625286410 17 17 11.588235294118 197 125 -98 +3717551163 20 20 6.15 123 113 -117 +3759340273 16 16 24.75 396 123 -101 +3766999078 18 18 16.666666666667 300 125 -98 +3862393166 17 17 23.176470588235 394 123 -101 +3959216334 18 18 21.222222222222 382 123 -101 +3998790955 19 19 20.789473684211 395 123 -101 +4015442341 19 19 20.157894736842 383 125 -98 +4061635107 21 21 11.666666666667 245 122 -117 +4076864659 20 20 19.75 395 125 -98 +4144173353 22 22 8.363636363636 184 122 -117 +4216440507 21 21 14.095238095238 296 125 -99 +4229654142 22 22 16.681818181818 367 125 -99 +4268716378 14 14 -13.857142857143 -194 118 -101 + + +query IIIIIIIIII +SELECT + SUM(c5) OVER(ORDER BY c4 RANGE BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation2, + SUM(c4) OVER(ORDER BY c3 RANGE 3 PRECEDING) as summation3, + SUM(c4) OVER(ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation6, + SUM(c4) OVER(ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation7, + SUM(c2) OVER(PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation10, + SUM(c4) OVER(PARTITION BY c1 ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation11, + SUM(c2) OVER(PARTITION BY c1 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation14, + SUM(c4) OVER(PARTITION BY c5 ORDER BY c5 RANGE UNBOUNDED PRECEDING) as summation15, + SUM(c2) OVER(PARTITION BY c5, c7, c9 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation20, + SUM(c2) OVER(PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation21 +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +61035129 -38183 231997 145307 4 -9603 63 -16110 4 4 +-108973366 -2906 231997 131173 2 150222 44 3917 2 2 +623103518 -38455 231997 137382 5 -30140 60 -16974 5 5 +-1927628110 -4018 231997 19981 2 -6028 56 -1114 2 2 +-1899175111 15673 231997 13915 2 4551 60 15673 2 2 +-1991133944 5182 231997 21095 1 15675 44 13630 1 1 +-346989627 -14061 231997 74253 3 25687 62 -13217 3 3 +-1009656194 36363 231997 20225 4 28059 62 20690 4 4 +397430452 80491 231997 240186 3 20142 60 28162 3 3 +1993193190 -14061 231997 214888 4 12439 60 11640 4 4 +1325868318 65202 231997 278980 1 -23170 56 27752 1 1 +-1882293856 -8790 231997 -22782 1 -30113 56 -24085 1 1 +1282464673 -9599 231997 238615 4 -39052 63 -22501 4 4 +1544188174 4523 231997 218731 4 -70358 63 -31500 4 4 +2030965207 27241 231997 212619 3 -90242 63 13611 3 3 +-537142430 12398 231997 71344 2 -29772 56 25305 2 2 +1689098844 11267 231997 207437 5 -78717 63 -26526 5 5 +1337043149 -8247 231997 256184 3 9967 60 -22796 3 3 +1171968280 17360 231997 208337 1 20150 60 -15154 1 1 +1902023838 -8549 231997 202910 4 233222 44 -1471 4 4 +-1143802338 8900 231997 14495 1 117791 44 28781 1 1 +-673237643 -8247 231997 10423 4 23116 62 -28070 4 4 +1188285940 8988 231997 255503 5 73746 62 21576 5 5 +2053379412 -12642 231997 224221 2 196022 44 -12642 2 2 +586844478 -12907 231997 154356 5 -13166 60 -12907 5 5 +-382483011 -9599 231997 87470 3 -39337 56 -9565 3 3 +-800561771 -15056 231997 38493 2 51186 62 23127 2 2 +-1011669561 -2904 231997 -465 2 -79516 56 -2904 2 2 +-134213907 19208 231997 127256 5 -14848 56 19208 5 5 +-4229382 -1967 231997 129206 4 23720 62 -1967 4 4 +-587831330 45185 231997 46039 2 -19184 63 24495 2 2 +-2098805236 13741 231997 7465 3 -4914 56 13741 3 3 +-2117946883 -13608 231997 -6276 5 2045 44 2045 5 5 +2106705285 4523 231997 246701 1 21131 60 8692 1 1 +2033001162 -546 231997 230728 2 -27731 56 18109 2 2 +1991172974 -24558 231997 203248 4 208664 44 -24558 4 4 +670497898 -8247 231997 121331 3 70388 62 14457 3 3 +762932956 43358 231997 180389 4 -9396 60 20744 4 4 +141218956 14090 231997 154116 3 159031 44 8809 3 3 +1413111008 -7078 231997 233919 1 55336 62 -18410 1 1 +-1813935549 -17195 231997 -51244 4 -23911 60 -28462 4 4 +-2141451704 14468 231997 -29777 3 -11122 60 -11122 3 3 +-1090239422 35827 231997 2439 2 -22198 63 -12056 2 2 +2047637360 3756 231997 217547 4 -103423 63 -13181 4 4 +-1302295658 2479 231997 -15205 3 57904 44 15091 3 3 +-644225469 13717 231997 5756 1 -55077 56 -4667 1 1 +912707948 52329 231997 241709 3 35304 60 32064 3 3 +-1222533990 -10871 231997 -45392 2 -76612 56 -30187 2 2 +659422734 -12399 231997 106874 4 -67542 56 -30508 4 4 +41423756 16337 231997 145543 5 40057 62 16337 5 5 +1955646088 64670 231997 227806 5 127598 62 24896 5 5 +-842693467 -14061 231997 15366 5 -36395 60 -12484 5 5 +434021400 -25184 231997 185288 4 17766 60 -2376 4 4 +-1908480893 -40939 231997 -1758 2 -283 62 -21739 2 2 +240273900 67120 231997 183649 3 188564 44 29533 3 3 +-928766616 -38455 231997 -1256 1 -43679 63 -21481 1 1 +794623392 64670 231997 193025 1 3240 60 12636 1 1 +-2138770630 37793 231997 -8321 2 21456 62 21456 2 2 +-335410409 -20071 231997 92637 1 136175 44 18384 1 1 +2064155045 -11396 231997 238009 4 -89635 63 13788 4 4 +-237425046 27361 231997 97918 4 -34056 56 5281 4 4 +-1331533190 30045 231997 -30296 1 -10142 63 10837 1 1 +-1808210365 -40939 231997 -67556 2 -46425 56 -16312 2 2 +-1383162419 27138 231997 -35654 1 42813 44 27138 1 1 +-467659022 32514 231997 103858 5 13330 63 32514 5 5 +370975815 28868 231997 196729 2 -23315 60 13080 2 2 +2051224722 -10871 231997 236863 4 146914 62 19316 4 4 +1436496767 59917 231997 259399 3 -38858 63 194 3 3 +702611616 -38196 231997 113643 4 180876 44 -7688 4 4 +1593800404 3756 231997 233963 2 -52191 63 18167 2 2 +-1885422396 -49963 231997 1303 4 -12612 63 -12612 4 4 +994303988 -22073 231997 223491 1 52170 62 -18218 1 1 +383352709 15295 231997 212024 1 -8020 60 15295 1 1 +715235348 35827 231997 159645 2 -16551 63 23388 2 2 +1824882165 6926 231997 204381 5 102702 62 22080 5 5 +706441268 35694 231997 136257 5 203490 44 22614 5 5 +1354539333 -22073 231997 252329 2 -27025 56 -3855 2 2 +49866617 8988 231997 161417 2 55931 62 15874 2 2 +-629486480 15788 231997 21544 5 38904 62 15788 5 5 +-903316089 3756 231997 27850 3 -50410 56 29106 3 3 +427197269 -42978 231997 209850 4 -39939 63 -30336 4 4 +1188089983 14468 231997 233927 1 229080 44 25590 1 1 +852509237 67120 231997 209645 4 -50922 56 16620 4 4 +1423957796 -13608 231997 259205 4 80622 62 25286 4 4 +1738331255 -71880 231997 182301 3 -103853 63 -25136 3 3 +1579876740 -2935 231997 215796 4 -29960 56 -2935 4 4 +-1176490478 87389 231997 -14286 1 89010 44 31106 1 1 +439738328 -18025 231997 167263 2 -259 60 -18025 2 2 +-421042466 -6823 231997 97035 3 6507 63 -6823 3 3 +431378678 -46744 231997 187664 1 -37034 56 -22186 1 1 +-2141999138 18877 231997 -18655 3 -18655 56 -18655 3 3 +1489733240 -9168 231997 250231 3 799 60 -9168 3 3 +1299719633 52329 231997 251228 3 32763 60 12613 3 3 +2143473091 -14704 231997 231997 1 6427 60 -14704 1 1 +-168758331 20967 231997 108048 2 146305 44 10130 2 2 +-1448995523 7652 231997 -62792 1 7369 62 7652 1 1 +-1660426473 -2888 231997 -70444 2 -15500 63 -2888 2 2 +1213926989 -8448 231997 261116 1 234693 44 5613 1 1 +-1339586153 59917 231997 -41133 1 -20979 63 -5479 1 1 +2025611582 -2269 231997 199008 5 -45840 56 -15880 5 5 + + +query IIIII +select + c9, + cume_dist() OVER (PARTITION BY c2 ORDER BY c3) cume_dist_by_c3, + rank() OVER (PARTITION BY c2 ORDER BY c3) rank_by_c3, + dense_rank() OVER (PARTITION BY c2 ORDER BY c3) dense_rank_by_c3, + percent_rank() OVER (PARTITION BY c2 ORDER BY c3) percent_rank_by_c3 +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +28774375 0.608695652174 14 14 0.590909090909 +63044568 0.954545454545 21 19 0.952380952381 +141047417 0.714285714286 10 10 0.692307692308 +141680161 0.136363636364 3 3 0.095238095238 +145294611 0.590909090909 13 12 0.571428571429 +225513085 0.090909090909 2 2 0.047619047619 +243203849 0.052631578947 1 1 0 +326151275 0.652173913043 15 15 0.636363636364 +431948861 0.473684210526 9 8 0.444444444444 +466439833 0.130434782609 3 3 0.090909090909 +473294098 0.772727272727 17 17 0.761904761905 +520189543 0.318181818182 7 7 0.285714285714 +538589788 0.782608695652 18 18 0.772727272727 +557517119 0.304347826087 7 7 0.272727272727 +559847112 0.105263157895 2 2 0.055555555556 +598822671 0.409090909091 9 8 0.380952380952 +662099130 0.857142857143 12 12 0.846153846154 +754775609 0.578947368421 10 9 0.5 +774637006 0.136363636364 3 3 0.095238095238 +811650497 0.695652173913 16 16 0.681818181818 +879082834 0.727272727273 16 16 0.714285714286 +933879086 0.565217391304 13 13 0.545454545455 +974297360 0.928571428571 13 13 0.923076923077 +1000948272 0.863636363636 19 17 0.857142857143 +1013876852 0.571428571429 8 8 0.538461538462 +1088543984 0.736842105263 14 12 0.722222222222 +1098639440 0.545454545455 12 11 0.52380952381 +1157161427 0.090909090909 2 2 0.047619047619 +1229567292 1 14 14 1 +1243785310 0.086956521739 2 2 0.045454545455 +1289293657 0.636363636364 14 13 0.619047619048 +1362369177 0.631578947368 12 10 0.611111111111 +1365198901 0.357142857143 5 5 0.307692307692 +1454057357 0.227272727273 5 5 0.190476190476 +1491205016 0.454545454545 10 9 0.428571428571 +1534194097 0.95652173913 22 22 0.954545454545 +1538863055 0.578947368421 10 9 0.5 +1787652631 0.434782608696 10 10 0.409090909091 +1824517658 0.157894736842 3 3 0.111111111111 +1842680163 0.681818181818 15 15 0.666666666667 +1865307672 0.739130434783 17 17 0.727272727273 +1995343206 0.210526315789 4 4 0.166666666667 +2013662838 0.727272727273 15 14 0.666666666667 +2042457019 0.913043478261 21 21 0.909090909091 +2093538928 0.789473684211 15 13 0.777777777778 +2125812933 0.636363636364 14 14 0.619047619048 +2214035726 0.421052631579 7 7 0.333333333333 +2293105904 0.045454545455 1 1 0 +2306130875 0.478260869565 11 11 0.454545454545 +2307004493 0.785714285714 11 11 0.769230769231 +2424630722 0.642857142857 9 9 0.615384615385 +2496054700 0.071428571429 1 1 0 +2502326480 0.347826086957 8 8 0.318181818182 +2525744318 0.272727272727 5 5 0.190476190476 +2592330556 1 19 17 1 +2610290479 0.545454545455 12 12 0.52380952381 +2669374863 0.409090909091 9 9 0.380952380952 +2705709344 0.772727272727 17 15 0.761904761905 +2712615025 0.590909090909 13 13 0.571428571429 +2778168728 0.391304347826 9 9 0.363636363636 +2818832252 0.217391304348 5 5 0.181818181818 +2830981072 0.954545454545 21 21 0.952380952381 +2844041986 0.272727272727 5 5 0.190476190476 +2861376515 0.363636363636 8 8 0.333333333333 +2861911482 0.214285714286 3 3 0.153846153846 +2939920218 0.363636363636 8 7 0.333333333333 +3023531799 0.04347826087 1 1 0 +3105312559 0.684210526316 13 11 0.666666666667 +3126475872 0.521739130435 12 12 0.5 +3188005828 0.909090909091 20 18 0.904761904762 +3198969145 0.826086956522 19 19 0.818181818182 +3275293996 0.5 11 11 0.47619047619 +3276123488 0.272727272727 6 6 0.238095238095 +3314983189 0.727272727273 15 14 0.666666666667 +3342719438 0.285714285714 4 4 0.230769230769 +3373581039 0.5 7 7 0.461538461538 +3398507249 0.5 11 10 0.47619047619 +3455216719 0.818181818182 18 16 0.809523809524 +3457053821 0.428571428571 6 6 0.384615384615 +3473924576 0.842105263158 16 14 0.833333333333 +3521368277 0.869565217391 20 20 0.863636363636 +3542840110 0.181818181818 4 4 0.142857142857 +3566741189 1 23 23 1 +3570297463 0.260869565217 6 6 0.227272727273 +3577318119 0.894736842105 17 15 0.888888888889 +3593959807 0.173913043478 4 4 0.136363636364 +3625286410 1 22 22 1 +3717551163 0.318181818182 7 6 0.285714285714 +3759340273 0.947368421053 18 16 0.944444444444 +3766999078 0.909090909091 20 20 0.904761904762 +3862393166 0.315789473684 6 6 0.277777777778 +3959216334 0.263157894737 5 5 0.222222222222 +3998790955 0.421052631579 7 7 0.333333333333 +4015442341 0.863636363636 19 19 0.857142857143 +4061635107 1 22 20 1 +4076864659 0.454545454545 10 10 0.428571428571 +4144173353 0.181818181818 4 4 0.142857142857 +4216440507 0.045454545455 1 1 0 +4229654142 0.818181818182 18 18 0.809523809524 +4268716378 0.142857142857 2 2 0.076923076923 + + +query IIIIIII +SELECT +SUM(c5) OVER(ORDER BY c13 ROWS BETWEEN 3 PRECEDING AND 1 FOLLOWING) as summation2, +SUM(c2) OVER(PARTITION BY c5 ORDER BY c13 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation10, +SUM(c2) OVER(PARTITION BY c1 ORDER BY c13 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation14, +SUM(c5) OVER(ORDER BY c5 ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING) as summation5, +SUM(c5) OVER(ORDER BY c5 ROWS BETWEEN UNBOUNDED PRECEDING AND 2 FOLLOWING) as summation6, +SUM(c2) OVER(PARTITION BY c5, c7, c9 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation20, +SUM(c2) OVER(PARTITION BY c5 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as summation21 +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +-4942047943 4 63 65888489655 -49496272718 4 4 +926757956 2 44 65239119005 -49988667320 2 2 +1732087197 5 60 63348565756 -44072309439 5 5 +-3150892396 2 56 22284849433 -18365391649 2 2 +-2580856019 2 60 26501601552 -22133107901 2 2 +-335727035 1 44 20146078803 -16466216538 1 1 +1814066719 3 62 63285534470 -49613916090 3 3 +2053694183 4 62 52482905660 -42707727919 4 4 +3621641894 3 60 65599174579 -47485937795 3 3 +-400780807 4 60 26398188956 1363051884 4 4 +7402117831 1 56 49945227444 -26269037388 1 1 +-494733298 1 56 30420363606 -25755253815 1 1 +795974017 4 63 52321603367 -28960619870 4 4 +1026366728 4 63 40718554341 -15787873259 4 4 +2286728521 3 63 22540519030 5443690406 3 3 +-1126902361 2 56 60886848761 -48311607997 2 2 +3039607922 5 63 36368366538 -10535560995 5 5 +452227974 3 60 48731300455 -24855926380 3 3 +5227296299 1 60 56253092820 -34082599483 1 1 +69074581 4 44 31650501220 -4686718095 4 4 +-1471170754 1 44 48781585534 -39865989020 1 1 +2660538843 4 62 57667039791 -46297932749 4 4 +1419803598 5 62 54487875635 -31586207821 5 5 +2419395622 2 44 14499576077 13719154870 2 2 +2481391591 5 60 63779944434 -44742807337 5 5 +-459020887 3 56 62748392040 -49376491044 3 3 +-624495791 2 62 56738273175 -45668446269 2 2 +-2096656853 2 56 51306415182 -41804411830 2 2 +1272929184 5 56 64903708596 -50030091076 5 5 +32805265 4 62 65476544051 -49938800703 4 4 +-4061661128 2 63 60213611118 -47890565531 2 2 +3706903676 3 56 18004627099 -14557735645 3 3 +540986341 5 44 15862627961 -12630107535 5 5 +6758184069 1 60 10418937555 15862627961 1 1 +2026749584 2 56 20549346056 7494915128 2 2 +5467570199 4 44 28223071121 -667913323 4 4 +2067671449 3 62 62474806028 -42663256555 3 3 +-1130350427 4 60 59934937400 -39537955622 4 4 +-2003065005 3 44 65892719037 -49125296903 3 3 +5408019493 1 62 46149116149 -21995471817 1 1 +-3164970139 4 60 32328844499 -27415680288 4 4 +-2694469368 3 60 15862627961 -8540168355 3 3 +-658921663 2 63 50083881192 -40875645214 2 2 +2805599223 4 63 18556152866 9548294540 4 4 +1553855901 3 44 44727303772 -36620277699 3 3 +1692583850 1 56 58570355880 -46885764079 1 1 +2735533457 3 60 57810649168 -36458975406 3 3 +2950771606 2 56 46110466191 -37764080037 2 2 +4826625882 4 56 62914544356 -43369697823 4 4 +-782600284 5 62 65645302382 -49877765574 5 5 +5648017295 5 62 29961402376 -2693524905 5 5 +-2767729102 5 60 55728616981 -45024220800 5 5 +5149003448 4 60 64604572155 -46025333589 4 4 +2961127755 2 62 24402796316 -20250814045 2 2 +5898948877 3 44 65851295281 -48741944194 3 3 +3960521203 1 63 53626707998 -43550421386 1 1 +3778827061 1 60 59232325784 -38625247674 1 1 +1686841798 2 62 15862627961 -10638973591 2 2 +2045904111 1 44 63753193492 -49782674421 1 1 +3236123325 4 63 12466574915 15862627961 4 4 +1611761891 4 56 64174235958 -49916888328 4 4 +1661243641 1 63 43278308249 -35443787221 1 1 +-1804099697 2 56 34228019610 -28864675811 2 2 +-1806255458 1 44 39809671411 -32918957573 1 1 +2971205313 5 63 61531074230 -48694091008 5 5 +3282334404 2 60 65801428664 -48344513742 2 2 +1922873587 4 62 16530541284 11612449585 4 4 +944558002 3 63 43486204682 -18961550403 3 3 +-2057472121 4 44 61887961550 -41948021207 4 4 +3274034209 2 63 37858099778 -12360443160 2 2 +-1924817872 4 63 28492735496 -23947043450 4 4 +-1526835643 1 62 57047716212 -35270885423 1 1 +-4360794332 1 60 65740393535 -47917316473 1 1 +440089321 2 63 60605435298 -40390464859 2 2 +-349482531 5 62 33244301624 -6677891069 5 5 +-1444906781 5 44 61264858032 -41185088251 5 5 +124105851 2 56 47448835782 -23431968584 2 2 +1507069678 2 62 65779516289 -49736546618 2 2 +-1359045062 5 62 59413049347 -47422906509 5 5 +-6342944350 3 56 54716947420 -44350983157 3 3 +2754612412 4 63 65358900679 -47051916395 4 4 +2926012685 1 44 55400583583 -32868672494 1 1 +-634904850 4 56 58525884516 -37630943686 4 4 +2039004659 4 62 44823247831 -20505738577 4 4 +1022726318 3 63 34824178364 -8633537157 3 3 +3963879356 4 56 39294596545 -14098774415 4 4 +-5184324536 1 44 47450052344 -38854319459 1 1 +2632160834 2 60 64207141703 -45402230071 2 2 +-2188934048 3 63 62160560710 -49041080635 3 3 +4261991101 1 56 64987924864 -46612178067 1 1 +-2680809293 3 56 15862627961 -6422221472 3 3 +-46187270 3 60 42131665349 -17381673663 3 3 +-255767708 3 60 51133513384 -27623576721 3 3 +3129721465 1 60 8367712833 15862627961 1 1 +2499782052 2 44 64556718969 -50025861694 2 2 +-1609671980 1 62 37995735862 -31587424383 1 1 +-1595655683 2 63 36113442006 -30247838230 2 2 +-1524432418 1 44 53493571647 -30286488188 1 1 +-5214552988 1 63 41617881776 -34221253231 1 1 +-1718403224 5 56 24496165118 3396053046 5 5 + + +query IIIII +SELECT + SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) as summation1, + SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 2 FOLLOWING AND 3 FOLLOWING) as summation2, + SUM(c2) OVER(ORDER BY c5 ROWS BETWEEN 2 FOLLOWING AND UNBOUNDED FOLLOWING) as summation3, + SUM(c2) OVER(ORDER BY c5 RANGE BETWEEN 2 FOLLOWING AND UNBOUNDED FOLLOWING) as summation4, + SUM(c2) OVER(ORDER BY c5 RANGE BETWEEN 1 PRECEDING AND 1 PRECEDING) as summation5 +FROM aggregate_test_100_by_sql +ORDER BY c9; +---- +2 5 159 162 NULL +5 7 173 177 NULL +5 7 125 129 NULL +1 6 264 266 NULL +2 5 258 262 NULL +3 4 266 268 NULL +3 6 190 191 NULL +2 8 229 230 NULL +1 5 146 150 NULL +4 5 21 26 NULL +3 3 79 82 NULL +4 4 253 257 NULL +1 4 83 86 NULL +3 7 58 62 NULL +5 8 16 18 NULL +2 6 200 205 NULL +2 9 48 51 NULL +1 5 77 79 NULL +1 6 96 97 NULL +5 8 34 39 NULL +1 6 236 238 NULL +2 7 214 215 NULL +1 7 90 91 NULL +4 2 2 6 NULL +2 7 129 134 NULL +3 5 191 194 NULL +5 6 215 219 NULL +2 4 230 234 NULL +2 9 177 179 NULL +2 6 168 173 NULL +5 8 205 207 NULL +5 4 268 269 NULL +2 3 269 272 NULL +4 NULL NULL 1 NULL +3 6 12 16 NULL +5 8 26 30 NULL +4 7 118 122 NULL +2 7 106 107 NULL +4 3 156 159 NULL +2 6 72 76 NULL +1 3 251 253 NULL +3 8 277 279 NULL +1 5 234 236 NULL +2 6 8 12 NULL +1 2 240 242 NULL +4 4 209 214 NULL +4 2 98 99 NULL +3 3 239 240 NULL +5 9 122 125 NULL +4 7 166 168 NULL +4 9 30 34 NULL +3 5 219 221 NULL +1 10 139 141 NULL +2 5 262 264 NULL +3 4 154 156 NULL +4 7 226 229 NULL +4 4 102 106 NULL +3 4 272 277 NULL +3 7 186 190 NULL +2 1 1 2 NULL +1 7 184 186 NULL +1 3 242 245 NULL +4 2 249 251 NULL +1 4 246 247 NULL +2 6 197 200 NULL +3 7 153 154 NULL +4 5 6 8 NULL +4 8 66 69 NULL +3 6 113 118 NULL +4 8 51 56 NULL +2 6 257 258 NULL +3 6 97 98 NULL +2 5 150 153 NULL +5 5 107 111 NULL +3 9 39 43 NULL +4 5 111 113 NULL +3 7 76 77 NULL +5 6 162 166 NULL +1 7 207 209 NULL +1 6 221 226 NULL +3 6 145 146 NULL +1 5 91 96 NULL +1 2 99 102 NULL +1 7 69 72 NULL +5 9 43 48 NULL +4 8 56 58 NULL +2 4 238 239 NULL +4 9 134 139 NULL +5 4 194 197 NULL +4 7 141 145 NULL +NULL 7 279 282 NULL +3 6 62 66 NULL +4 5 82 83 NULL +1 NULL NULL NULL NULL +4 6 179 184 NULL +2 2 247 248 NULL +2 2 248 249 NULL +5 4 86 90 NULL +1 5 245 246 NULL +4 6 18 21 NULL From ad4acb5c74d6a3464fad592f4aaad0492e5a972c Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 21:17:11 +0100 Subject: [PATCH 10/19] fmt --- datafusion/core/Cargo.toml | 8 +-- .../sqllogictests/src/engines/conversion.rs | 9 ++- .../src/engines/datafusion/mod.rs | 21 ++++-- .../src/engines/datafusion/normalize.rs | 64 ++++++++++++++----- .../tests/sqllogictests/src/engines/mod.rs | 2 +- .../sqllogictests/src/engines/postgres/mod.rs | 56 +++++++++------- .../core/tests/sqllogictests/src/main.rs | 29 +++++++-- 7 files changed, 130 insertions(+), 59 deletions(-) diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index f4aa3ed261fd..88a9d60fc889 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -103,22 +103,22 @@ xz2 = { version = "0.1", optional = true } [dev-dependencies] arrow = { version = "29.0.0", features = ["prettyprint", "dyn_cmp_dict"] } async-trait = "0.1.53" +bigdecimal = "0.3.0" criterion = "0.4" csv = "1.1.6" ctor = "0.1.22" doc-comment = "0.3" env_logger = "0.10" +half = "2.2.1" parquet-test-utils = { path = "../../parquet-test-utils" } postgres-types = { version = "0.2.4", features = ["derive", "with-chrono-0_4"] } rstest = "0.16.0" rust_decimal = { version = "1.27.0", features = ["tokio-pg"] } -bigdecimal = "0.3.0" -half = "2.2.1" sqllogictest = "0.10.0" test-utils = { path = "../../test-utils" } -tokio-postgres = "0.7.7" -thiserror = "1.0.37" testcontainers = "0.14.0" +thiserror = "1.0.37" +tokio-postgres = "0.7.7" [target.'cfg(not(target_os = "windows"))'.dev-dependencies] nix = "0.26.1" diff --git a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs index 475098addd27..f63c1bdd5317 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs @@ -1,7 +1,7 @@ +use bigdecimal::BigDecimal; use half::f16; -use rust_decimal::Decimal; use rust_decimal::prelude::*; -use bigdecimal::BigDecimal; +use rust_decimal::Decimal; pub const NULL_STR: &str = "NULL"; @@ -58,7 +58,10 @@ pub fn f64_to_str(value: f64) -> String { } pub fn i128_to_str(value: i128, scale: u32) -> String { - big_decimal_to_str(BigDecimal::from_str(&Decimal::from_i128_with_scale(value, scale).to_string()).unwrap()) + big_decimal_to_str( + BigDecimal::from_str(&Decimal::from_i128_with_scale(value, scale).to_string()) + .unwrap(), + ) } pub fn decimal_to_str(value: Decimal) -> String { diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs index 96efca84a054..e1fffd669ccb 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/mod.rs @@ -38,8 +38,16 @@ pub struct DataFusion { } impl DataFusion { - pub fn new(ctx: SessionContext, file_name: String, postgres_compatible: bool) -> Self { - Self { ctx, file_name, is_pg_compatibility_test: postgres_compatible } + pub fn new( + ctx: SessionContext, + file_name: String, + postgres_compatible: bool, + ) -> Self { + Self { + ctx, + file_name, + is_pg_compatibility_test: postgres_compatible, + } } } @@ -68,7 +76,11 @@ impl sqllogictest::AsyncDB for DataFusion { } } -async fn run_query(ctx: &SessionContext, sql: impl Into, is_pg_compatibility_test: bool) -> Result { +async fn run_query( + ctx: &SessionContext, + sql: impl Into, + is_pg_compatibility_test: bool, +) -> Result { let sql = sql.into(); // Check if the sql is `insert` if let Ok(mut statements) = DFParser::parse_sql(&sql) { @@ -82,6 +94,7 @@ async fn run_query(ctx: &SessionContext, sql: impl Into, is_pg_compatibi } let df = ctx.sql(sql.as_str()).await?; let results: Vec = df.collect().await?; - let formatted_batches = normalize::convert_batches(results, is_pg_compatibility_test)?; + let formatted_batches = + normalize::convert_batches(results, is_pg_compatibility_test)?; Ok(formatted_batches) } diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs index d48cf74fa027..1ab02d5ac762 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs @@ -16,8 +16,8 @@ // under the License. use arrow::{array, array::ArrayRef, datatypes::DataType, record_batch::RecordBatch}; -use sqllogictest::{ColumnType, DBOutput}; use datafusion::error::DataFusionError; +use sqllogictest::{ColumnType, DBOutput}; use super::super::conversion::*; use super::error::{DFSqlLogicTestError, Result}; @@ -26,7 +26,10 @@ use super::error::{DFSqlLogicTestError, Result}; /// /// Assumes empty record batches are a successful statement completion /// -pub fn convert_batches(batches: Vec, is_pg_compatibility_test: bool) -> Result { +pub fn convert_batches( + batches: Vec, + is_pg_compatibility_test: bool, +) -> Result { if batches.is_empty() { // DataFusion doesn't report number of rows complete return Ok(DBOutput::StatementComplete(0)); @@ -57,7 +60,10 @@ pub fn convert_batches(batches: Vec, is_pg_compatibility_test: bool } /// Convert a single batch to a `Vec>` for comparison -fn convert_batch(batch: RecordBatch, is_pg_compatibility_test: bool) -> Result>> { +fn convert_batch( + batch: RecordBatch, + is_pg_compatibility_test: bool, +) -> Result>> { (0..batch.num_rows()) .map(|row| { batch @@ -87,7 +93,11 @@ macro_rules! get_row_value { /// /// Floating numbers are rounded to have a consistent representation with the Postgres runner. /// -pub fn cell_to_string(col: &ArrayRef, row: usize, is_pg_compatibility_test: bool) -> Result { +pub fn cell_to_string( + col: &ArrayRef, + row: usize, + is_pg_compatibility_test: bool, +) -> Result { if !col.is_valid(row) { // represent any null value with the string "NULL" Ok(NULL_STR.to_string()) @@ -96,10 +106,17 @@ pub fn cell_to_string(col: &ArrayRef, row: usize, is_pg_compatibility_test: bool postgres_compatible_cell_to_string(col, row) } else { match col.data_type() { - DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(array::LargeStringArray, col, row))), - DataType::Utf8 => Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))), - _ => arrow::util::display::array_value_to_string(col, row) - }.map_err(DFSqlLogicTestError::Arrow) + DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!( + array::LargeStringArray, + col, + row + ))), + DataType::Utf8 => { + Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))) + } + _ => arrow::util::display::array_value_to_string(col, row), + } + .map_err(DFSqlLogicTestError::Arrow) } } } @@ -107,17 +124,32 @@ pub fn cell_to_string(col: &ArrayRef, row: usize, is_pg_compatibility_test: bool /// Convert values to text representation that are the same as in Postgres client implementation. fn postgres_compatible_cell_to_string(col: &ArrayRef, row: usize) -> Result { match col.data_type() { - DataType::Boolean => Ok(bool_to_str(get_row_value!(array::BooleanArray, col, row))), - DataType::Float16 => Ok(f16_to_str(get_row_value!(array::Float16Array, col, row))), - DataType::Float32 => Ok(f32_to_str(get_row_value!(array::Float32Array, col, row))), - DataType::Float64 => Ok(f64_to_str(get_row_value!(array::Float64Array, col, row))), + DataType::Boolean => { + Ok(bool_to_str(get_row_value!(array::BooleanArray, col, row))) + } + DataType::Float16 => { + Ok(f16_to_str(get_row_value!(array::Float16Array, col, row))) + } + DataType::Float32 => { + Ok(f32_to_str(get_row_value!(array::Float32Array, col, row))) + } + DataType::Float64 => { + Ok(f64_to_str(get_row_value!(array::Float64Array, col, row))) + } DataType::Decimal128(_, scale) => { let value = get_row_value!(array::Decimal128Array, col, row); let decimal_scale = u32::try_from((*scale).max(0)).unwrap(); Ok(i128_to_str(value, decimal_scale)) } - DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(array::LargeStringArray, col, row))), - DataType::Utf8 => Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))), - _ => arrow::util::display::array_value_to_string(col, row) - }.map_err(DFSqlLogicTestError::Arrow) + DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!( + array::LargeStringArray, + col, + row + ))), + DataType::Utf8 => { + Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))) + } + _ => arrow::util::display::array_value_to_string(col, row), + } + .map_err(DFSqlLogicTestError::Arrow) } diff --git a/datafusion/core/tests/sqllogictests/src/engines/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/mod.rs index 8e3a108e7a6a..ed350bf36482 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/mod.rs @@ -1,3 +1,3 @@ +mod conversion; pub mod datafusion; pub mod postgres; -mod conversion; diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs index 7373c47e106d..24ba3a037ecc 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -23,11 +23,11 @@ use log::debug; use sqllogictest::{ColumnType, DBOutput}; use tokio::task::JoinHandle; +use super::conversion::*; use chrono::{NaiveDate, NaiveDateTime, NaiveTime}; use postgres_types::Type; -use tokio_postgres::{Column, Row}; use rust_decimal::Decimal; -use super::conversion::*; +use tokio_postgres::{Column, Row}; pub mod image; @@ -48,7 +48,8 @@ impl Postgres { ) -> Result { let mut retry = 0; loop { - let connection_result = Postgres::connect(file_name.clone(), host, port, db, user, pass).await; + let connection_result = + Postgres::connect(file_name.clone(), host, port, db, user, pass).await; match connection_result { Err(e) if retry <= 3 => { debug!("Retrying connection error '{:?}'", e); @@ -60,12 +61,14 @@ impl Postgres { } } - async fn connect(file_name: String, - host: &str, - port: u16, - db: &str, - user: &str, - pass: &str) -> Result { + async fn connect( + file_name: String, + host: &str, + port: u16, + db: &str, + user: &str, + pass: &str, + ) -> Result { let (client, connection) = tokio_postgres::Config::new() .host(host) .port(port) @@ -97,18 +100,18 @@ impl Drop for Postgres { macro_rules! make_string { ($row:ident, $idx:ident, $t:ty) => {{ - let value:Option<$t> = $row.get($idx); - match value { + let value: Option<$t> = $row.get($idx); + match value { Some(value) => value.to_string(), - None => NULL_STR.to_string() - } + None => NULL_STR.to_string(), + } }}; ($row:ident, $idx:ident, $t:ty, $convert:ident) => {{ let value: Option<$t> = $row.get($idx); match value { Some(value) => $convert(value).to_string(), - None => NULL_STR.to_string() - } + None => NULL_STR.to_string(), + } }}; } @@ -128,10 +131,12 @@ fn cell_to_string(row: &Row, column: &Column, idx: usize) -> String { .unwrap_or_else(|| "NULL".to_string()) } Type::BOOL => make_string!(row, idx, bool, bool_to_str), - Type::BPCHAR | Type::VARCHAR | Type::TEXT => make_string!(row, idx, &str, varchar_to_str), + Type::BPCHAR | Type::VARCHAR | Type::TEXT => { + make_string!(row, idx, &str, varchar_to_str) + } Type::FLOAT4 => make_string!(row, idx, f32, f32_to_str), Type::FLOAT8 => make_string!(row, idx, f64, f64_to_str), - _ => todo!("Unsupported type: {}", column.type_().name()) + _ => unimplemented!("Unsupported type: {}", column.type_().name()), } } @@ -155,13 +160,16 @@ impl sqllogictest::AsyncDB for Postgres { return Ok(DBOutput::StatementComplete(0)); } let rows = self.client.query(sql, &[]).await?; - let output = rows.iter().map(|row| { - row.columns().iter().enumerate() - .map(|(idx, column)| { - cell_to_string(&row, &column, idx) - }) - .collect::>() - }).collect::>(); + let output = rows + .iter() + .map(|row| { + row.columns() + .iter() + .enumerate() + .map(|(idx, column)| cell_to_string(&row, &column, idx)) + .collect::>() + }) + .collect::>(); if output.is_empty() { let stmt = self.client.prepare(sql).await?; diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index 31dde4f951d5..ab8fadad7103 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -25,8 +25,8 @@ use datafusion::prelude::SessionContext; use crate::engines::datafusion::DataFusion; use crate::engines::postgres; -use crate::engines::postgres::{Postgres}; use crate::engines::postgres::image::{PG_DB, PG_PASSWORD, PG_PORT, PG_USER}; +use crate::engines::postgres::Postgres; mod engines; mod setup; @@ -76,10 +76,18 @@ pub async fn main() -> Result<(), Box> { Ok(()) } -async fn run_test_file(path: &PathBuf, file_name: String, is_pg_compatibility_test: bool) -> Result<(), Box> { +async fn run_test_file( + path: &PathBuf, + file_name: String, + is_pg_compatibility_test: bool, +) -> Result<(), Box> { println!("Running with DataFusion runner: {}", path.display()); let ctx = context_for_test_file(&file_name, is_pg_compatibility_test).await; - let mut runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, is_pg_compatibility_test)); + let mut runner = sqllogictest::Runner::new(DataFusion::new( + ctx, + file_name, + is_pg_compatibility_test, + )); runner.run_file_async(path).await?; Ok(()) } @@ -101,7 +109,7 @@ async fn run_test_file_with_postgres( PG_USER, PG_PASSWORD, ) - .await?; + .await?; let mut postgres_runner = sqllogictest::Runner::new(postgres_client); postgres_runner.run_file_async(path).await?; @@ -118,7 +126,11 @@ async fn run_complete_file( info!("Using complete mode to complete: {}", path.display()); let ctx = context_for_test_file(&file_name, is_pg_compatibility_test).await; - let runner = sqllogictest::Runner::new(DataFusion::new(ctx, file_name, is_pg_compatibility_test)); + let runner = sqllogictest::Runner::new(DataFusion::new( + ctx, + file_name, + is_pg_compatibility_test, + )); let col_separator = " "; let validator = default_validator; @@ -138,7 +150,10 @@ fn read_test_files(options: &Options) -> Vec { } /// Create a SessionContext, configured for the specific test -async fn context_for_test_file(file_name: &str, is_pg_compatibility_test: bool) -> SessionContext { +async fn context_for_test_file( + file_name: &str, + is_pg_compatibility_test: bool, +) -> SessionContext { if is_pg_compatibility_test { info!("Registering pg compatibility tables"); let ctx = SessionContext::new(); @@ -185,7 +200,7 @@ impl Options { info!("PG_COMPAT value {}", value); true } - Err(_) => false + Err(_) => false, }; // treat args after the first as filters to run (substring matching) From fa7866a228232f8ec9bd8f7a93e40cf7d7a0007b Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 21:27:23 +0100 Subject: [PATCH 11/19] clippy --- .../src/engines/datafusion/normalize.rs | 26 +++++++++---------- .../sqllogictests/src/engines/postgres/mod.rs | 2 +- .../core/tests/sqllogictests/src/main.rs | 14 +++++----- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs index 1ab02d5ac762..5733b1c32d11 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/datafusion/normalize.rs @@ -101,23 +101,21 @@ pub fn cell_to_string( if !col.is_valid(row) { // represent any null value with the string "NULL" Ok(NULL_STR.to_string()) + } else if is_pg_compatibility_test { + postgres_compatible_cell_to_string(col, row) } else { - if is_pg_compatibility_test { - postgres_compatible_cell_to_string(col, row) - } else { - match col.data_type() { - DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!( - array::LargeStringArray, - col, - row - ))), - DataType::Utf8 => { - Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))) - } - _ => arrow::util::display::array_value_to_string(col, row), + match col.data_type() { + DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!( + array::LargeStringArray, + col, + row + ))), + DataType::Utf8 => { + Ok(varchar_to_str(get_row_value!(array::StringArray, col, row))) } - .map_err(DFSqlLogicTestError::Arrow) + _ => arrow::util::display::array_value_to_string(col, row), } + .map_err(DFSqlLogicTestError::Arrow) } } diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs index 24ba3a037ecc..6853acdc620b 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -166,7 +166,7 @@ impl sqllogictest::AsyncDB for Postgres { row.columns() .iter() .enumerate() - .map(|(idx, column)| cell_to_string(&row, &column, idx)) + .map(|(idx, column)| cell_to_string(row, column, idx)) .collect::>() }) .collect::>(); diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index ab8fadad7103..557e73bcbc36 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -60,16 +60,14 @@ pub async fn main() -> Result<(), Box> { if options.complete_mode { run_complete_file(&path, file_name, is_pg_compatibility_test).await?; - } else { - if options.postgres_runner { - if is_pg_compatibility_test { - run_test_file_with_postgres(&path, file_name).await?; - } else { - debug!("Skipping test file {:?}", path); - } + } else if options.postgres_runner { + if is_pg_compatibility_test { + run_test_file_with_postgres(&path, file_name).await?; } else { - run_test_file(&path, file_name, is_pg_compatibility_test).await?; + debug!("Skipping test file {:?}", path); } + } else { + run_test_file(&path, file_name, is_pg_compatibility_test).await?; } } From 70aa1c98fcfee40491cc7d73b8a8750f7f206b73 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 21:36:37 +0100 Subject: [PATCH 12/19] Postgres step in github actions --- .github/workflows/rust.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c15615d59b08..f194cd9c5a8f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -227,6 +227,19 @@ jobs: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres + sqllogictest-postgres: + name: "Run sqllogictest with Postgres runner" + needs: [linux-build-lib] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Setup Rust toolchain + uses: ./.github/actions/setup-builder + - name: Run sqllogictest + run: PG_COMPAT=true cargo test -p datafusion --test sqllogictests + windows: name: cargo test (win64) runs-on: windows-latest From 9bee2a346961e26116edaaaedb446234762b63c2 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 22:18:34 +0100 Subject: [PATCH 13/19] Run sqllogictest with Postgres on plain ubuntu --- .github/workflows/rust.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f194cd9c5a8f..9ca93c242d13 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -232,11 +232,15 @@ jobs: needs: [linux-build-lib] runs-on: ubuntu-latest steps: + - name: Check docker + run: docker ps - uses: actions/checkout@v3 with: submodules: true - - name: Setup Rust toolchain - uses: ./.github/actions/setup-builder + - name: Setup toolchain + run: | + rustup toolchain install stable + rustup default stable - name: Run sqllogictest run: PG_COMPAT=true cargo test -p datafusion --test sqllogictests From 4de00daecdef415672285831527ecc04d62d6329 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 22:23:38 +0100 Subject: [PATCH 14/19] Update sqllogictest readme --- datafusion/core/tests/sqllogictests/README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/datafusion/core/tests/sqllogictests/README.md b/datafusion/core/tests/sqllogictests/README.md index f46ff13724be..b5ff8a4b8214 100644 --- a/datafusion/core/tests/sqllogictests/README.md +++ b/datafusion/core/tests/sqllogictests/README.md @@ -44,13 +44,18 @@ Run only the tests in `information_schema.slt`: cargo test -p datafusion --test sqllogictests -- information ``` -#### Running tests: Postgres compatibility mode +#### Running tests: Postgres compatibility -In this mode, `sqllogictests` runs the statements and queries in a `.slt` file, comparing outputs of postgres and datafusion. +Test files that start with prefix `pg_compat_` verify compatibility with Postgres. +Datafusion runs these test files during normal sqllogictest runs. +In order to run sqllogictests with Postgres execute: + +```shell +PG_COMPAT=true cargo test -p datafusion --test sqllogictests ``` -PG_COMPAT=true cargo test -p datafusion --test sqllogictests -``` + +This command requires a docker binary. Check that docker is properly installed with `which docker`. #### Updating tests: Completion Mode From 44bb1de6bb6b0d579caa47381f68972adab3047c Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 22:27:36 +0100 Subject: [PATCH 15/19] Revert unnecessary change --- datafusion/core/tests/sqllogictests/src/main.rs | 1 - datafusion/core/tests/sqllogictests/test_files/ddl.slt | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index 557e73bcbc36..1627b8d7201e 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -192,7 +192,6 @@ impl Options { let args: Vec<_> = std::env::args().collect(); let complete_mode = args.iter().any(|a| a == "--complete"); - // std::env::var("PG_COMPAT").map_or() let postgres_runner = match std::env::var("PG_COMPAT") { Ok(value) => { info!("PG_COMPAT value {}", value); diff --git a/datafusion/core/tests/sqllogictests/test_files/ddl.slt b/datafusion/core/tests/sqllogictests/test_files/ddl.slt index 43f411cc4bb2..bdce635a4364 100644 --- a/datafusion/core/tests/sqllogictests/test_files/ddl.slt +++ b/datafusion/core/tests/sqllogictests/test_files/ddl.slt @@ -311,8 +311,8 @@ CREATE EXTERNAL TABLE aggregate_test_100 ( c1 VARCHAR NOT NULL, c2 TINYINT NOT NULL, c3 SMALLINT NOT NULL, - c4 SMALLINT, - c5 INT, + c4 SMALLINT NOT NULL, + c5 INTEGER NOT NULL, c6 BIGINT NOT NULL, c7 SMALLINT NOT NULL, c8 INT NOT NULL, From b7b9e700796ae3fe0db1f4d359c75e6b10715043 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 22:58:32 +0100 Subject: [PATCH 16/19] Add license headers --- .../sqllogictests/src/engines/conversion.rs | 17 +++++++++++++++++ .../core/tests/sqllogictests/src/engines/mod.rs | 17 +++++++++++++++++ .../sqllogictests/src/engines/postgres/image.rs | 17 +++++++++++++++++ .../sqllogictests/src/engines/postgres/mod.rs | 4 ++++ 4 files changed, 55 insertions(+) diff --git a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs index f63c1bdd5317..9978e75264ae 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/conversion.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/conversion.rs @@ -1,3 +1,20 @@ +// 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 bigdecimal::BigDecimal; use half::f16; use rust_decimal::prelude::*; diff --git a/datafusion/core/tests/sqllogictests/src/engines/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/mod.rs index ed350bf36482..2d05e5d584a0 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/mod.rs @@ -1,3 +1,20 @@ +// 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. + mod conversion; pub mod datafusion; pub mod postgres; diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/image.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/image.rs index c285742fc6cd..e19705eed6c8 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/image.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/image.rs @@ -1,3 +1,20 @@ +// 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 testcontainers::core::WaitFor; use testcontainers::images::generic::GenericImage; diff --git a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs index 6853acdc620b..fa5c2e3ed2b8 100644 --- a/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs +++ b/datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs @@ -154,6 +154,10 @@ impl sqllogictest::AsyncDB for Postgres { || lower_sql.starts_with("show") || lower_sql.starts_with("with") || lower_sql.starts_with("describe") + || ((lower_sql.starts_with("insert") + || lower_sql.starts_with("update") + || lower_sql.starts_with("delete")) + && lower_sql.contains("returning")) }; if !is_query_sql { self.client.execute(sql, &[]).await?; From 8453ed1f3cf1ac5adbe7cc6d80a08e5bf9c88b6d Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Wed, 18 Jan 2023 23:04:16 +0100 Subject: [PATCH 17/19] Don't log PG_COMPAT value --- datafusion/core/tests/sqllogictests/src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index 1627b8d7201e..47829f8f30a7 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -107,7 +107,7 @@ async fn run_test_file_with_postgres( PG_USER, PG_PASSWORD, ) - .await?; + .await?; let mut postgres_runner = sqllogictest::Runner::new(postgres_client); postgres_runner.run_file_async(path).await?; @@ -193,10 +193,7 @@ impl Options { let complete_mode = args.iter().any(|a| a == "--complete"); let postgres_runner = match std::env::var("PG_COMPAT") { - Ok(value) => { - info!("PG_COMPAT value {}", value); - true - } + Ok(value) => true, Err(_) => false, }; From 5c2fc55cb38ce01c7756fbcff5a645a215395722 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Thu, 19 Jan 2023 18:34:58 +0100 Subject: [PATCH 18/19] clippy and fmt --- datafusion/core/tests/sqllogictests/src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/datafusion/core/tests/sqllogictests/src/main.rs b/datafusion/core/tests/sqllogictests/src/main.rs index 47829f8f30a7..7bbeea717b86 100644 --- a/datafusion/core/tests/sqllogictests/src/main.rs +++ b/datafusion/core/tests/sqllogictests/src/main.rs @@ -107,7 +107,7 @@ async fn run_test_file_with_postgres( PG_USER, PG_PASSWORD, ) - .await?; + .await?; let mut postgres_runner = sqllogictest::Runner::new(postgres_client); postgres_runner.run_file_async(path).await?; @@ -192,10 +192,7 @@ impl Options { let args: Vec<_> = std::env::args().collect(); let complete_mode = args.iter().any(|a| a == "--complete"); - let postgres_runner = match std::env::var("PG_COMPAT") { - Ok(value) => true, - Err(_) => false, - }; + let postgres_runner = std::env::var("PG_COMPAT").map_or(false, |_| true); // treat args after the first as filters to run (substring matching) let filters = if !args.is_empty() { From 4c7734d0564113ce522e64f439dbd25f402f3c18 Mon Sep 17 00:00:00 2001 From: Yevhenii Melnyk Date: Thu, 19 Jan 2023 20:08:55 +0100 Subject: [PATCH 19/19] remove whitespaces in readme --- datafusion/core/tests/sqllogictests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/core/tests/sqllogictests/README.md b/datafusion/core/tests/sqllogictests/README.md index b5ff8a4b8214..d83e0e4bba3f 100644 --- a/datafusion/core/tests/sqllogictests/README.md +++ b/datafusion/core/tests/sqllogictests/README.md @@ -52,7 +52,7 @@ Datafusion runs these test files during normal sqllogictest runs. In order to run sqllogictests with Postgres execute: ```shell -PG_COMPAT=true cargo test -p datafusion --test sqllogictests +PG_COMPAT=true cargo test -p datafusion --test sqllogictests ``` This command requires a docker binary. Check that docker is properly installed with `which docker`.