From 64e10f84e14c041fa5d68d04a0eaff5e0a59df51 Mon Sep 17 00:00:00 2001 From: Andrew Duffy Date: Wed, 17 Jul 2024 14:13:03 +0100 Subject: [PATCH] convert TPC-H to use Utf8View --- Cargo.lock | 68 ++++---------------------- Cargo.toml | 47 ++++++++++++------ bench-vortex/src/bin/tpch_benchmark.rs | 19 +++---- bench-vortex/src/tpch/mod.rs | 33 +++++++++++++ bench-vortex/src/tpch/schema.rs | 66 ++++++++++++------------- bench-vortex/tpch/q7.sql | 2 +- bench-vortex/tpch/q8.sql | 2 +- bench-vortex/tpch/q9.sql | 2 +- 8 files changed, 120 insertions(+), 119 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 535df48fcc..4615c1924d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,8 +115,6 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "arrow" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6127ea5e585a12ec9f742232442828ebaf264dfa5eefdd71282376c599562b77" dependencies = [ "arrow-arith", "arrow-array", @@ -137,8 +135,6 @@ dependencies = [ [[package]] name = "arrow-arith" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7add7f39210b7d726e2a8efc0083e7bf06e8f2d15bdb4896b564dce4410fbf5d" dependencies = [ "arrow-array", "arrow-buffer", @@ -152,8 +148,6 @@ dependencies = [ [[package]] name = "arrow-array" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81c16ec702d3898c2f5cfdc148443c6cd7dbe5bac28399859eb0a3d38f072827" dependencies = [ "ahash", "arrow-buffer", @@ -169,8 +163,6 @@ dependencies = [ [[package]] name = "arrow-buffer" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae6970bab043c4fbc10aee1660ceb5b306d0c42c8cc5f6ae564efcd9759b663" dependencies = [ "bytes", "half", @@ -180,8 +172,6 @@ dependencies = [ [[package]] name = "arrow-cast" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c7ef44f26ef4f8edc392a048324ed5d757ad09135eff6d5509e6450d39e0398" dependencies = [ "arrow-array", "arrow-buffer", @@ -201,8 +191,6 @@ dependencies = [ [[package]] name = "arrow-csv" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f843490bd258c5182b66e888161bb6f198f49f3792f7c7f98198b924ae0f564" dependencies = [ "arrow-array", "arrow-buffer", @@ -220,8 +208,6 @@ dependencies = [ [[package]] name = "arrow-data" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a769666ffac256dd301006faca1ca553d0ae7cffcf4cd07095f73f95eb226514" dependencies = [ "arrow-buffer", "arrow-schema", @@ -232,8 +218,6 @@ dependencies = [ [[package]] name = "arrow-ipc" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf9c3fb57390a1af0b7bb3b5558c1ee1f63905f3eccf49ae7676a8d1e6e5a72" dependencies = [ "arrow-array", "arrow-buffer", @@ -247,8 +231,6 @@ dependencies = [ [[package]] name = "arrow-json" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654e7f3724176b66ddfacba31af397c48e106fbe4d281c8144e7d237df5acfd7" dependencies = [ "arrow-array", "arrow-buffer", @@ -267,8 +249,6 @@ dependencies = [ [[package]] name = "arrow-ord" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8008370e624e8e3c68174faaf793540287106cfda8ad1da862fdc53d8e096b4" dependencies = [ "arrow-array", "arrow-buffer", @@ -282,8 +262,6 @@ dependencies = [ [[package]] name = "arrow-row" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5e3a6b7fda8d9fe03f3b18a2d946354ea7f3c8e4076dbdb502ad50d9d44824" dependencies = [ "ahash", "arrow-array", @@ -291,14 +269,11 @@ dependencies = [ "arrow-data", "arrow-schema", "half", - "hashbrown", ] [[package]] name = "arrow-schema" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab1c12b40e29d9f3b699e0203c2a73ba558444c05e388a4377208f8f9c97eee" dependencies = [ "bitflags 2.5.0", ] @@ -306,8 +281,6 @@ dependencies = [ [[package]] name = "arrow-select" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e80159088ffe8c48965cb9b1a7c968b2729f29f37363df7eca177fc3281fe7c3" dependencies = [ "ahash", "arrow-array", @@ -320,8 +293,6 @@ dependencies = [ [[package]] name = "arrow-string" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fd04a6ea7de183648edbcb7a6dd925bbd04c210895f6384c780e27a9b54afcd" dependencies = [ "arrow-array", "arrow-buffer", @@ -931,11 +902,12 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.3" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown", "lock_api", "once_cell", @@ -945,8 +917,6 @@ dependencies = [ [[package]] name = "datafusion" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9d55a9cd2634818953809f75ebe5248b00dd43c3227efb2a51a2d5feaad54e" dependencies = [ "ahash", "arrow", @@ -999,8 +969,6 @@ dependencies = [ [[package]] name = "datafusion-common" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def66b642959e7f96f5d2da22e1f43d3bd35598f821e5ce351a0553e0f1b7367" dependencies = [ "ahash", "arrow", @@ -1021,8 +989,6 @@ dependencies = [ [[package]] name = "datafusion-common-runtime" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f104bb9cb44c06c9badf8a0d7e0855e5f7fa5e395b887d7f835e8a9457dc1352" dependencies = [ "tokio", ] @@ -1030,8 +996,6 @@ dependencies = [ [[package]] name = "datafusion-execution" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac0fd8b5d80bbca3fc3b6f40da4e9f6907354824ec3b18bbd83fee8cf5c3c3e" dependencies = [ "arrow", "chrono", @@ -1051,8 +1015,6 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2103d2cc16fb11ef1fa993a6cac57ed5cb028601db4b97566c90e5fa77aa1e68" dependencies = [ "ahash", "arrow", @@ -1070,10 +1032,10 @@ dependencies = [ [[package]] name = "datafusion-functions" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a369332afd0ef5bd565f6db2139fb9f1dfdd0afa75a7f70f000b74208d76994f" dependencies = [ "arrow", + "arrow-buffer", + "arrow-string", "base64", "blake2", "blake3", @@ -1096,8 +1058,6 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92718db1aff70c47e5abf9fc975768530097059e5db7c7b78cd64b5e9a11fc77" dependencies = [ "ahash", "arrow", @@ -1114,8 +1074,6 @@ dependencies = [ [[package]] name = "datafusion-functions-array" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bb80f46ff3dcf4bb4510209c2ba9b8ce1b716ac8b7bf70c6bf7dca6260c831" dependencies = [ "arrow", "arrow-array", @@ -1135,8 +1093,6 @@ dependencies = [ [[package]] name = "datafusion-optimizer" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82f34692011bec4fdd6fc18c264bf8037b8625d801e6dd8f5111af15cb6d71d3" dependencies = [ "arrow", "async-trait", @@ -1155,8 +1111,6 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45538630defedb553771434a437f7ca8f04b9b3e834344aafacecb27dc65d5e5" dependencies = [ "ahash", "arrow", @@ -1185,8 +1139,6 @@ dependencies = [ [[package]] name = "datafusion-physical-expr-common" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8a72b0ca908e074aaeca52c14ddf5c28d22361e9cb6bc79bb733cd6661b536" dependencies = [ "ahash", "arrow", @@ -1199,8 +1151,6 @@ dependencies = [ [[package]] name = "datafusion-physical-plan" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b504eae6107a342775e22e323e9103f7f42db593ec6103b28605b7b7b1405c4a" dependencies = [ "ahash", "arrow", @@ -1233,8 +1183,6 @@ dependencies = [ [[package]] name = "datafusion-sql" version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5db33f323f41b95ae201318ba654a9bf11113e58a51a1dff977b1a836d3d889" dependencies = [ "arrow", "arrow-array", @@ -2523,8 +2471,6 @@ dependencies = [ [[package]] name = "parquet" version = "52.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f22ba0d95db56dde8685e3fadcb915cdaadda31ab8abbe3ff7f0ad1ef333267" dependencies = [ "ahash", "arrow-array", @@ -4762,3 +4708,7 @@ dependencies = [ "cc", "pkg-config", ] + +[[patch.unused]] +name = "arrow-flight" +version = "52.1.0" diff --git a/Cargo.toml b/Cargo.toml index f9679c5221..c428ea30fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,15 +35,15 @@ rust-version = "1.76" ahash = "0.8.11" allocator-api2 = "0.2.16" arrayref = "0.3.7" -arrow = { version = "52.0.0", features = ["pyarrow"] } -arrow-array = "52.0.0" -arrow-buffer = "52.0.0" -arrow-cast = "52.0.0" -arrow-csv = "52.0.0" -arrow-data = "52.0.0" -arrow-ipc = "52.0.0" -arrow-schema = "52.0.0" -arrow-select = "52.0.0" +arrow = { version = "52.1.0", features = ["pyarrow"] } +arrow-array = "52.1.0" +arrow-buffer = "52.1.0" +arrow-cast = "52.1.0" +arrow-csv = "52.1.0" +arrow-data = "52.1.0" +arrow-ipc = "52.1.0" +arrow-schema = "52.1.0" +arrow-select = "52.1.0" async-trait = "0.1" bindgen = "0.69.4" bytes = "1.6.0" @@ -53,12 +53,14 @@ criterion = { version = "0.5.1", features = ["html_reports"] } croaring = "2.0.0" csv = "1.3.0" object_store = "0.10.1" -datafusion = "40.0.0" -datafusion-common = "40.0.0" -datafusion-execution = "40.0.0" -datafusion-expr = "40.0.0" -datafusion-physical-expr = "40.0.0" -datafusion-physical-plan = "40.0.0" + +datafusion = { path = "/Volumes/Code/datafusion/datafusion/core" } +datafusion-common = { path = "/Volumes/Code/datafusion/datafusion/common" } +datafusion-execution = { path = "/Volumes/Code/datafusion/datafusion/execution" } +datafusion-expr = { path = "/Volumes/Code/datafusion/datafusion/expr" } +datafusion-physical-expr = { path = "/Volumes/Code/datafusion/datafusion/physical-expr" } +datafusion-physical-plan = { path = "/Volumes/Code/datafusion/datafusion/physical-plan" } + divan = "0.1.14" duckdb = "1.0.0" enum-iterator = "2.0.0" @@ -115,3 +117,18 @@ warnings = "deny" [workspace.lints.clippy] all = { level = "deny", priority = -1 } or_fun_call = "deny" + +[patch.crates-io] +arrow = { path = "/Volumes/Code/arrow-rs/arrow" } +arrow-array = { path = "/Volumes/Code/arrow-rs/arrow-array" } +arrow-buffer = { path = "/Volumes/Code/arrow-rs/arrow-buffer" } +arrow-cast = { path = "/Volumes/Code/arrow-rs/arrow-cast" } +arrow-csv = { path = "/Volumes/Code/arrow-rs/arrow-csv" } +arrow-data = { path = "/Volumes/Code/arrow-rs/arrow-data" } +arrow-ipc = { path = "/Volumes/Code/arrow-rs/arrow-ipc" } +arrow-schema = { path = "/Volumes/Code/arrow-rs/arrow-schema" } +arrow-select = { path = "/Volumes/Code/arrow-rs/arrow-select" } +arrow-string = { path = "/Volumes/Code/arrow-rs/arrow-string" } +arrow-ord = { path = "/Volumes/Code/arrow-rs/arrow-ord" } +arrow-flight = { path = "/Volumes/Code/arrow-rs/arrow-flight" } +parquet = { path = "/Volumes/Code/arrow-rs/parquet" } diff --git a/bench-vortex/src/bin/tpch_benchmark.rs b/bench-vortex/src/bin/tpch_benchmark.rs index d230214021..84a2153858 100644 --- a/bench-vortex/src/bin/tpch_benchmark.rs +++ b/bench-vortex/src/bin/tpch_benchmark.rs @@ -19,13 +19,13 @@ async fn main() { // The formats to run against (vs the baseline) let formats = [ Format::Arrow, - Format::Parquet, - Format::Vortex { - disable_pushdown: false, - }, - Format::Vortex { - disable_pushdown: true, - }, + // Format::Parquet, + // Format::Vortex { + // disable_pushdown: false, + // }, + // Format::Vortex { + // disable_pushdown: true, + // }, ]; // Load datasets @@ -53,8 +53,8 @@ async fn main() { // Send back a channel with the results of Row. let (rows_tx, rows_rx) = sync::mpsc::channel(); for i in 1..=22 { - if i == 15 { - continue; + if vec![2, 7, 8, 9, 10, 15, 18, 21].contains(&i) { + continue } let _ctxs = ctxs.clone(); let _tx = rows_tx.clone(); @@ -123,6 +123,7 @@ async fn main() { .push(Cell::new(&format!("{} us", measure.as_micros())).style_spec(style_spec)); } + println!("QUERY {i} complete"); _tx.send((i, Row::new(cells))).unwrap(); }); } diff --git a/bench-vortex/src/tpch/mod.rs b/bench-vortex/src/tpch/mod.rs index 809ddcb183..0dd101def0 100644 --- a/bench-vortex/src/tpch/mod.rs +++ b/bench-vortex/src/tpch/mod.rs @@ -120,6 +120,7 @@ async fn register_arrow( .collect() .await?; + // Convert to StringView for all of the relevant columns let mem_table = MemTable::try_new(Arc::new(schema.clone()), vec![record_batches])?; session.register_table(name, Arc::new(mem_table))?; @@ -212,3 +213,35 @@ pub fn tpch_query(query_idx: usize) -> String { .join(format!("q{}.sql", query_idx)); fs::read_to_string(manifest_dir).unwrap() } + +#[cfg(test)] +mod test { + use crate::tpch::{load_datasets, tpch_query, Format}; + + #[tokio::test] + async fn test_schema() { + println!("TEST START"); + let session_ctx = load_datasets( + "/Volumes/Code/vortex/bench-vortex/data/tpch/1", + Format::Arrow, + ) + .await + .unwrap(); + println!("DATA LOADED"); + + // get access to session context + let logical_plan = session_ctx + .state() + .create_logical_plan(&tpch_query(7)) + .await + .unwrap(); + println!("LOGICAL PLAN: {}", logical_plan.display_indent()); + session_ctx + .sql(&tpch_query(1)) + .await + .unwrap() + .show() + .await + .unwrap(); + } +} diff --git a/bench-vortex/src/tpch/schema.rs b/bench-vortex/src/tpch/schema.rs index 13dcd65f56..7b89bcf413 100644 --- a/bench-vortex/src/tpch/schema.rs +++ b/bench-vortex/src/tpch/schema.rs @@ -7,37 +7,37 @@ use lazy_static::lazy_static; lazy_static! { pub static ref NATION: Schema = Schema::new(vec![ Field::new("n_nationkey", DataType::Int64, false), - Field::new("n_name", DataType::Utf8, false), + Field::new("n_name", DataType::Utf8View, false), Field::new("n_regionkey", DataType::Int64, false), - Field::new("n_comment", DataType::Utf8, true), + Field::new("n_comment", DataType::Utf8View, true), ]); pub static ref REGION: Schema = Schema::new(vec![ Field::new("r_regionkey", DataType::Int64, false), - Field::new("r_name", DataType::Utf8, false), - Field::new("r_comment", DataType::Utf8, true), + Field::new("r_name", DataType::Utf8View, false), + Field::new("r_comment", DataType::Utf8View, true), ]); pub static ref PART: Schema = Schema::new(vec![ Field::new("p_partkey", DataType::Int64, false), - Field::new("p_name", DataType::Utf8, false), - Field::new("p_mfgr", DataType::Utf8, false), - Field::new("p_brand", DataType::Utf8, false), - Field::new("p_type", DataType::Utf8, false), + Field::new("p_name", DataType::Utf8View, false), + Field::new("p_mfgr", DataType::Utf8View, false), + Field::new("p_brand", DataType::Utf8View, false), + Field::new("p_type", DataType::Utf8View, false), Field::new("p_size", DataType::Int32, false), - Field::new("p_container", DataType::Utf8, false), + Field::new("p_container", DataType::Utf8View, false), Field::new("p_retailprice", DataType::Float64, false), - Field::new("p_comment", DataType::Utf8, false), + Field::new("p_comment", DataType::Utf8View, false), ]); pub static ref SUPPLIER: Schema = Schema::new(vec![ Field::new("s_suppkey", DataType::Int64, false), - Field::new("s_name", DataType::Utf8, false), - Field::new("s_address", DataType::Utf8, false), + Field::new("s_name", DataType::Utf8View, false), + Field::new("s_address", DataType::Utf8View, false), Field::new("s_nationkey", DataType::Int32, false), - Field::new("s_phone", DataType::Utf8, false), + Field::new("s_phone", DataType::Utf8View, false), Field::new("s_acctbal", DataType::Float64, false), - Field::new("s_comment", DataType::Utf8, false), + Field::new("s_comment", DataType::Utf8View, false), ]); pub static ref PARTSUPP: Schema = Schema::new(vec![ @@ -45,31 +45,31 @@ lazy_static! { Field::new("ps_suppkey", DataType::Int64, false), Field::new("ps_availqty", DataType::Int64, false), Field::new("ps_supplycost", DataType::Float64, false), - Field::new("ps_comment", DataType::Utf8, false), + Field::new("ps_comment", DataType::Utf8View, false), ]); pub static ref CUSTOMER: Schema = Schema::new(vec![ Field::new("c_custkey", DataType::Int64, false), - Field::new("c_name", DataType::Utf8, false), - Field::new("c_address", DataType::Utf8, false), + Field::new("c_name", DataType::Utf8View, false), + Field::new("c_address", DataType::Utf8View, false), Field::new("c_nationkey", DataType::Int64, false), - Field::new("c_phone", DataType::Utf8, false), + Field::new("c_phone", DataType::Utf8View, false), Field::new("c_acctbal", DataType::Float64, false), - Field::new("c_mktsegment", DataType::Utf8, false), - Field::new("c_comment", DataType::Utf8, false), + Field::new("c_mktsegment", DataType::Utf8View, false), + Field::new("c_comment", DataType::Utf8View, false), ]); pub static ref ORDERS: Schema = Schema::new(vec![ Field::new("o_orderkey", DataType::Int64, false), Field::new("o_custkey", DataType::Int64, false), - Field::new("o_orderstatus", DataType::Utf8, false), + Field::new("o_orderstatus", DataType::Utf8View, false), Field::new("o_totalprice", DataType::Float64, false), - Field::new("o_orderdate", DataType::Utf8, false), - Field::new("o_orderpriority", DataType::Utf8, false), - Field::new("o_clerk", DataType::Utf8, false), + Field::new("o_orderdate", DataType::Utf8View, false), + Field::new("o_orderpriority", DataType::Utf8View, false), + Field::new("o_clerk", DataType::Utf8View, false), Field::new("o_shippriority", DataType::Int32, false), - Field::new("o_comment", DataType::Utf8, false), + Field::new("o_comment", DataType::Utf8View, false), ]); pub static ref LINEITEM: Schema = Schema::new(vec![ @@ -81,15 +81,15 @@ lazy_static! { Field::new("l_extendedprice", DataType::Float64, false), Field::new("l_discount", DataType::Float64, false), Field::new("l_tax", DataType::Float64, false), - Field::new("l_returnflag", DataType::Utf8, false), - Field::new("l_linestatus", DataType::Utf8, false), + Field::new("l_returnflag", DataType::Utf8View, false), + Field::new("l_linestatus", DataType::Utf8View, false), // NOTE: We don't support Arrow DATE type, but YYYY-MM-DD is lexicographically ordered // so we can just use Utf8 and adjust any queries that rely on date functions. - Field::new("l_shipdate", DataType::Utf8, false), - Field::new("l_commitdate", DataType::Utf8, false), - Field::new("l_receiptdate", DataType::Utf8, false), - Field::new("l_shipinstruct", DataType::Utf8, false), - Field::new("l_shipmode", DataType::Utf8, false), - Field::new("l_comment", DataType::Utf8, false), + Field::new("l_shipdate", DataType::Utf8View, false), + Field::new("l_commitdate", DataType::Utf8View, false), + Field::new("l_receiptdate", DataType::Utf8View, false), + Field::new("l_shipinstruct", DataType::Utf8View, false), + Field::new("l_shipmode", DataType::Utf8View, false), + Field::new("l_comment", DataType::Utf8View, false), ]); } diff --git a/bench-vortex/tpch/q7.sql b/bench-vortex/tpch/q7.sql index 512e5be55a..2ac76a462e 100644 --- a/bench-vortex/tpch/q7.sql +++ b/bench-vortex/tpch/q7.sql @@ -8,7 +8,7 @@ from select n1.n_name as supp_nation, n2.n_name as cust_nation, - extract(year from l_shipdate) as l_year, + extract(year from CAST(l_shipdate AS date)) as l_year, l_extendedprice * (1 - l_discount) as volume from supplier, diff --git a/bench-vortex/tpch/q8.sql b/bench-vortex/tpch/q8.sql index 6ddb2a6747..cd3acb48b2 100644 --- a/bench-vortex/tpch/q8.sql +++ b/bench-vortex/tpch/q8.sql @@ -7,7 +7,7 @@ select from ( select - extract(year from o_orderdate) as o_year, + extract(year from CAST(o_orderdate AS date)) as o_year, l_extendedprice * (1 - l_discount) as volume, n2.n_name as nation from diff --git a/bench-vortex/tpch/q9.sql b/bench-vortex/tpch/q9.sql index 587bbc8a20..02724762d3 100644 --- a/bench-vortex/tpch/q9.sql +++ b/bench-vortex/tpch/q9.sql @@ -6,7 +6,7 @@ from ( select n_name as nation, - extract(year from o_orderdate) as o_year, + extract(year from CAST(o_orderdate AS DATE)) as o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount from part,