diff --git a/Cargo.lock b/Cargo.lock index 177fa8b3b..8a768a93b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2248,7 +2248,7 @@ dependencies = [ [[package]] name = "datafusion" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "arrow-ipc 55.2.0", @@ -2302,7 +2302,7 @@ dependencies = [ [[package]] name = "datafusion-catalog" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "async-trait", @@ -2327,7 +2327,7 @@ dependencies = [ [[package]] name = "datafusion-catalog-listing" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "async-trait", @@ -2349,7 +2349,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "ahash 0.8.12", "arrow", @@ -2372,7 +2372,7 @@ dependencies = [ [[package]] name = "datafusion-common-runtime" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "futures", "log", @@ -2382,7 +2382,7 @@ dependencies = [ [[package]] name = "datafusion-datasource" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "async-compression", @@ -2417,7 +2417,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-csv" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "async-trait", @@ -2441,7 +2441,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-json" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "async-trait", @@ -2465,7 +2465,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-parquet" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "async-trait", @@ -2495,12 +2495,12 @@ dependencies = [ [[package]] name = "datafusion-doc" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" [[package]] name = "datafusion-execution" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "dashmap", @@ -2518,7 +2518,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "chrono", @@ -2538,7 +2538,7 @@ dependencies = [ [[package]] name = "datafusion-expr-common" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "datafusion-common", @@ -2550,7 +2550,7 @@ dependencies = [ [[package]] name = "datafusion-functions" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "arrow-buffer 55.2.0", @@ -2578,7 +2578,7 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "ahash 0.8.12", "arrow", @@ -2598,7 +2598,7 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate-common" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "ahash 0.8.12", "arrow", @@ -2621,7 +2621,7 @@ dependencies = [ [[package]] name = "datafusion-functions-nested" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "arrow-ord 55.2.0", @@ -2641,7 +2641,7 @@ dependencies = [ [[package]] name = "datafusion-functions-table" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "async-trait", @@ -2656,7 +2656,7 @@ dependencies = [ [[package]] name = "datafusion-functions-window" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "datafusion-common", "datafusion-doc", @@ -2672,7 +2672,7 @@ dependencies = [ [[package]] name = "datafusion-functions-window-common" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "datafusion-common", "datafusion-physical-expr-common", @@ -2681,7 +2681,7 @@ dependencies = [ [[package]] name = "datafusion-macros" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "datafusion-expr", "quote", @@ -2691,7 +2691,7 @@ dependencies = [ [[package]] name = "datafusion-optimizer" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "chrono", @@ -2709,7 +2709,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "ahash 0.8.12", "arrow", @@ -2730,7 +2730,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr-common" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "ahash 0.8.12", "arrow", @@ -2743,7 +2743,7 @@ dependencies = [ [[package]] name = "datafusion-physical-optimizer" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "datafusion-common", @@ -2761,7 +2761,7 @@ dependencies = [ [[package]] name = "datafusion-physical-plan" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "ahash 0.8.12", "arrow", @@ -2790,7 +2790,7 @@ dependencies = [ [[package]] name = "datafusion-session" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "async-trait", @@ -2813,7 +2813,7 @@ dependencies = [ [[package]] name = "datafusion-sql" version = "47.0.0" -source = "git+https://github.com/Embucket/datafusion.git?rev=185dc7dcfcf1e94501959e53584a22f4f0878c35#185dc7dcfcf1e94501959e53584a22f4f0878c35" +source = "git+https://github.com/Embucket/datafusion.git?rev=d2f0bc60afc515007e5235ce890529ec338c4402#d2f0bc60afc515007e5235ce890529ec338c4402" dependencies = [ "arrow", "bigdecimal", diff --git a/Cargo.toml b/Cargo.toml index 60cac2285..7a1043702 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,12 +89,12 @@ uuid = { version = "1.10.0", features = ["v4", "serde"] } validator = { version = "0.20.0", features = ["derive"] } [patch.crates-io] -datafusion = { git = "https://github.com/Embucket/datafusion.git", rev = "185dc7dcfcf1e94501959e53584a22f4f0878c35" } -datafusion-common = { git = "https://github.com/Embucket/datafusion.git", rev = "185dc7dcfcf1e94501959e53584a22f4f0878c35" } -datafusion-expr = { git = "https://github.com/Embucket/datafusion.git", rev = "185dc7dcfcf1e94501959e53584a22f4f0878c35" } -datafusion-physical-plan = { git = "https://github.com/Embucket/datafusion.git", rev = "185dc7dcfcf1e94501959e53584a22f4f0878c35" } -datafusion-doc = { git = "https://github.com/Embucket/datafusion.git", rev = "185dc7dcfcf1e94501959e53584a22f4f0878c35" } -datafusion-macros = { git = "https://github.com/Embucket/datafusion.git", rev = "185dc7dcfcf1e94501959e53584a22f4f0878c35" } +datafusion = { git = "https://github.com/Embucket/datafusion.git", rev = "d2f0bc60afc515007e5235ce890529ec338c4402" } +datafusion-common = { git = "https://github.com/Embucket/datafusion.git", rev = "d2f0bc60afc515007e5235ce890529ec338c4402" } +datafusion-expr = { git = "https://github.com/Embucket/datafusion.git", rev = "d2f0bc60afc515007e5235ce890529ec338c4402" } +datafusion-physical-plan = { git = "https://github.com/Embucket/datafusion.git", rev = "d2f0bc60afc515007e5235ce890529ec338c4402" } +datafusion-doc = { git = "https://github.com/Embucket/datafusion.git", rev = "d2f0bc60afc515007e5235ce890529ec338c4402" } +datafusion-macros = { git = "https://github.com/Embucket/datafusion.git", rev = "d2f0bc60afc515007e5235ce890529ec338c4402" } [workspace.lints.clippy] all = { level = "deny", priority = -1 } diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_basic.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_basic.snap index 345027f62..10d00acb6 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_basic.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_basic.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT *\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (jan, feb, mar, apr))\n ORDER BY empid;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,21 +8,21 @@ Ok( "+-------+-------------+-------+-------+", "| empid | dept | month | sales |", "+-------+-------------+-------+-------+", - "| 1 | electronics | jan | 100 |", - "| 1 | electronics | feb | 200 |", - "| 1 | electronics | mar | 300 |", - "| 1 | electronics | apr | 100 |", - "| 2 | clothes | jan | 100 |", - "| 2 | clothes | feb | 300 |", - "| 2 | clothes | mar | 150 |", - "| 2 | clothes | apr | 200 |", - "| 3 | cars | jan | 200 |", - "| 3 | cars | feb | 400 |", - "| 3 | cars | mar | 100 |", - "| 3 | cars | apr | 50 |", - "| 4 | appliances | jan | 100 |", - "| 4 | appliances | mar | 100 |", - "| 4 | appliances | apr | 50 |", + "| 1 | electronics | JAN | 100 |", + "| 1 | electronics | FEB | 200 |", + "| 1 | electronics | MAR | 300 |", + "| 1 | electronics | APR | 100 |", + "| 2 | clothes | JAN | 100 |", + "| 2 | clothes | FEB | 300 |", + "| 2 | clothes | MAR | 150 |", + "| 2 | clothes | APR | 200 |", + "| 3 | cars | JAN | 200 |", + "| 3 | cars | FEB | 400 |", + "| 3 | cars | MAR | 100 |", + "| 3 | cars | APR | 50 |", + "| 4 | appliances | JAN | 100 |", + "| 4 | appliances | MAR | 100 |", + "| 4 | appliances | APR | 50 |", "+-------+-------------+-------+-------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_partial_columns.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_partial_columns.snap index 365afb22e..2d59ddc6f 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_partial_columns.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_partial_columns.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT *\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (jan, mar))\n ORDER BY empid;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,14 +8,14 @@ Ok( "+-------+-------------+-----+-----+-------+-------+", "| empid | dept | feb | apr | month | sales |", "+-------+-------------+-----+-----+-------+-------+", - "| 1 | electronics | 200 | 100 | jan | 100 |", - "| 1 | electronics | 200 | 100 | mar | 300 |", - "| 2 | clothes | 300 | 200 | jan | 100 |", - "| 2 | clothes | 300 | 200 | mar | 150 |", - "| 3 | cars | 400 | 50 | jan | 200 |", - "| 3 | cars | 400 | 50 | mar | 100 |", - "| 4 | appliances | | 50 | jan | 100 |", - "| 4 | appliances | | 50 | mar | 100 |", + "| 1 | electronics | 200 | 100 | JAN | 100 |", + "| 1 | electronics | 200 | 100 | MAR | 300 |", + "| 2 | clothes | 300 | 200 | JAN | 100 |", + "| 2 | clothes | 300 | 200 | MAR | 150 |", + "| 3 | cars | 400 | 50 | JAN | 200 |", + "| 3 | cars | 400 | 50 | MAR | 100 |", + "| 4 | appliances | | 50 | JAN | 100 |", + "| 4 | appliances | | 50 | MAR | 100 |", "+-------+-------------+-----+-----+-------+-------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_select_specific_columns.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_select_specific_columns.snap index 9948a45a6..107aee50b 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_select_specific_columns.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_select_specific_columns.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT dept, month, sales\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (jan, feb, mar, apr))\n ORDER BY dept;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,21 +8,21 @@ Ok( "+-------------+-------+-------+", "| dept | month | sales |", "+-------------+-------+-------+", - "| appliances | jan | 100 |", - "| appliances | mar | 100 |", - "| appliances | apr | 50 |", - "| cars | jan | 200 |", - "| cars | feb | 400 |", - "| cars | mar | 100 |", - "| cars | apr | 50 |", - "| clothes | jan | 100 |", - "| clothes | feb | 300 |", - "| clothes | mar | 150 |", - "| clothes | apr | 200 |", - "| electronics | jan | 100 |", - "| electronics | feb | 200 |", - "| electronics | mar | 300 |", - "| electronics | apr | 100 |", + "| appliances | JAN | 100 |", + "| appliances | MAR | 100 |", + "| appliances | APR | 50 |", + "| cars | JAN | 200 |", + "| cars | FEB | 400 |", + "| cars | MAR | 100 |", + "| cars | APR | 50 |", + "| clothes | JAN | 100 |", + "| clothes | FEB | 300 |", + "| clothes | MAR | 150 |", + "| clothes | APR | 200 |", + "| electronics | JAN | 100 |", + "| electronics | FEB | 200 |", + "| electronics | MAR | 300 |", + "| electronics | APR | 100 |", "+-------------+-------+-------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_aggregation.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_aggregation.snap index a060ff0eb..e79736842 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_aggregation.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_aggregation.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT month, SUM(sales) as total_sales\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (jan, feb, mar, apr))\n GROUP BY month\n ORDER BY month;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,10 +8,10 @@ Ok( "+-------+-------------+", "| month | total_sales |", "+-------+-------------+", - "| apr | 400 |", - "| feb | 900 |", - "| jan | 500 |", - "| mar | 650 |", + "| APR | 400 |", + "| FEB | 900 |", + "| JAN | 500 |", + "| MAR | 650 |", "+-------+-------------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_cte.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_cte.snap index 26b86278e..fbc3aabdb 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_cte.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_cte.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"WITH sales_data AS (\n SELECT * FROM monthly_sales WHERE empid < 3\n)\nSELECT *\n FROM sales_data\n UNPIVOT (sales FOR month IN (jan, feb, mar, apr))\n ORDER BY empid;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,14 +8,14 @@ Ok( "+-------+-------------+-------+-------+", "| empid | dept | month | sales |", "+-------+-------------+-------+-------+", - "| 1 | electronics | jan | 100 |", - "| 1 | electronics | feb | 200 |", - "| 1 | electronics | mar | 300 |", - "| 1 | electronics | apr | 100 |", - "| 2 | clothes | jan | 100 |", - "| 2 | clothes | feb | 300 |", - "| 2 | clothes | mar | 150 |", - "| 2 | clothes | apr | 200 |", + "| 1 | electronics | JAN | 100 |", + "| 1 | electronics | FEB | 200 |", + "| 1 | electronics | MAR | 300 |", + "| 1 | electronics | APR | 100 |", + "| 2 | clothes | JAN | 100 |", + "| 2 | clothes | FEB | 300 |", + "| 2 | clothes | MAR | 150 |", + "| 2 | clothes | APR | 200 |", "+-------+-------------+-------+-------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_filtering.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_filtering.snap index e5aaf8549..e0f45a451 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_filtering.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_filtering.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT *\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (jan, feb, mar, apr))\n WHERE sales > 100\n ORDER BY empid;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,13 +8,13 @@ Ok( "+-------+-------------+-------+-------+", "| empid | dept | month | sales |", "+-------+-------------+-------+-------+", - "| 1 | electronics | feb | 200 |", - "| 1 | electronics | mar | 300 |", - "| 2 | clothes | feb | 300 |", - "| 2 | clothes | mar | 150 |", - "| 2 | clothes | apr | 200 |", - "| 3 | cars | jan | 200 |", - "| 3 | cars | feb | 400 |", + "| 1 | electronics | FEB | 200 |", + "| 1 | electronics | MAR | 300 |", + "| 2 | clothes | FEB | 300 |", + "| 2 | clothes | MAR | 150 |", + "| 2 | clothes | APR | 200 |", + "| 3 | cars | JAN | 200 |", + "| 3 | cars | FEB | 400 |", "+-------+-------------+-------+-------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_having.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_having.snap index 51a2df644..9f65bb490 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_having.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_having.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT month, SUM(sales) as total_sales\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (jan, feb, mar, apr))\n GROUP BY month\n HAVING SUM(sales) > 400\n ORDER BY month;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,9 +8,9 @@ Ok( "+-------+-------------+", "| month | total_sales |", "+-------+-------------+", - "| feb | 900 |", - "| jan | 500 |", - "| mar | 650 |", + "| FEB | 900 |", + "| JAN | 500 |", + "| MAR | 650 |", "+-------+-------------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_include_nulls.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_include_nulls.snap index b5021d773..ffc71d76c 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_include_nulls.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_include_nulls.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT *\n FROM monthly_sales\n UNPIVOT INCLUDE NULLS (sales FOR month IN (jan, feb, mar, apr))\n ORDER BY empid;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,22 +8,22 @@ Ok( "+-------+-------------+-------+-------+", "| empid | dept | month | sales |", "+-------+-------------+-------+-------+", - "| 1 | electronics | jan | 100 |", - "| 1 | electronics | feb | 200 |", - "| 1 | electronics | mar | 300 |", - "| 1 | electronics | apr | 100 |", - "| 2 | clothes | jan | 100 |", - "| 2 | clothes | feb | 300 |", - "| 2 | clothes | mar | 150 |", - "| 2 | clothes | apr | 200 |", - "| 3 | cars | jan | 200 |", - "| 3 | cars | feb | 400 |", - "| 3 | cars | mar | 100 |", - "| 3 | cars | apr | 50 |", - "| 4 | appliances | jan | 100 |", - "| 4 | appliances | feb | |", - "| 4 | appliances | mar | 100 |", - "| 4 | appliances | apr | 50 |", + "| 1 | electronics | JAN | 100 |", + "| 1 | electronics | FEB | 200 |", + "| 1 | electronics | MAR | 300 |", + "| 1 | electronics | APR | 100 |", + "| 2 | clothes | JAN | 100 |", + "| 2 | clothes | FEB | 300 |", + "| 2 | clothes | MAR | 150 |", + "| 2 | clothes | APR | 200 |", + "| 3 | cars | JAN | 200 |", + "| 3 | cars | FEB | 400 |", + "| 3 | cars | MAR | 100 |", + "| 3 | cars | APR | 50 |", + "| 4 | appliances | JAN | 100 |", + "| 4 | appliances | FEB | |", + "| 4 | appliances | MAR | 100 |", + "| 4 | appliances | APR | 50 |", "+-------+-------------+-------+-------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_join.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_join.snap index 6100fae72..6dc47312c 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_join.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_join.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT e.empid, e.dept, u.month, u.sales\n FROM monthly_sales e\n JOIN (\n SELECT empid, month, sales\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (jan, feb, mar, apr))\n ) u ON e.empid = u.empid\n WHERE u.sales > 200\n ORDER BY e.empid, u.month;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,9 +8,9 @@ Ok( "+-------+-------------+-------+-------+", "| empid | dept | month | sales |", "+-------+-------------+-------+-------+", - "| 1 | electronics | mar | 300 |", - "| 2 | clothes | feb | 300 |", - "| 3 | cars | feb | 400 |", + "| 1 | electronics | MAR | 300 |", + "| 2 | clothes | FEB | 300 |", + "| 3 | cars | FEB | 400 |", "+-------+-------------+-------+-------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_subquery.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_subquery.snap index 89329d943..3ddede144 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_subquery.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_subquery.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT *\n FROM (\n SELECT empid, dept, jan, feb, mar\n FROM monthly_sales\n WHERE dept IN ('electronics', 'clothes')\n )\n UNPIVOT (sales FOR month IN (jan, feb, mar))\n ORDER BY empid;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,12 +8,12 @@ Ok( "+-------+-------------+-------+-------+", "| empid | dept | month | sales |", "+-------+-------------+-------+-------+", - "| 1 | electronics | jan | 100 |", - "| 1 | electronics | feb | 200 |", - "| 1 | electronics | mar | 300 |", - "| 2 | clothes | jan | 100 |", - "| 2 | clothes | feb | 300 |", - "| 2 | clothes | mar | 150 |", + "| 1 | electronics | JAN | 100 |", + "| 1 | electronics | FEB | 200 |", + "| 1 | electronics | MAR | 300 |", + "| 2 | clothes | JAN | 100 |", + "| 2 | clothes | FEB | 300 |", + "| 2 | clothes | MAR | 150 |", "+-------+-------------+-------+-------+", ], ) diff --git a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_union.snap b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_union.snap index 818d55c0e..5984f4a5a 100644 --- a/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_union.snap +++ b/crates/core-executor/src/tests/sql/commands/snapshots/unpivot/query_unpivot_with_union.snap @@ -1,5 +1,5 @@ --- -source: crates/embucket-functions/src/tests/sql/commands/unpivot.rs +source: crates/core-executor/src/tests/sql/commands/unpivot.rs description: "\"SELECT *\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (jan, feb))\n UNION ALL\nSELECT *\n FROM monthly_sales\n UNPIVOT (sales FOR month IN (mar, apr))\n ORDER BY empid, month;\"" info: "Setup queries: CREATE OR REPLACE TABLE monthly_sales(\n empid INT,\n dept TEXT,\n jan INT,\n feb INT,\n mar INT,\n apr INT); INSERT INTO monthly_sales VALUES\n (1, 'electronics', 100, 200, 300, 100),\n (2, 'clothes', 100, 300, 150, 200),\n (3, 'cars', 200, 400, 100, 50),\n (4, 'appliances', 100, NULL, 100, 50);" --- @@ -8,21 +8,21 @@ Ok( "+-------+-------------+-----+-----+-------+-------+", "| empid | dept | mar | apr | month | sales |", "+-------+-------------+-----+-----+-------+-------+", - "| 1 | electronics | 100 | 200 | apr | 100 |", - "| 1 | electronics | 300 | 100 | feb | 200 |", - "| 1 | electronics | 300 | 100 | jan | 100 |", - "| 1 | electronics | 100 | 200 | mar | 300 |", - "| 2 | clothes | 100 | 300 | apr | 200 |", - "| 2 | clothes | 150 | 200 | feb | 300 |", - "| 2 | clothes | 150 | 200 | jan | 100 |", - "| 2 | clothes | 100 | 300 | mar | 150 |", - "| 3 | cars | 200 | 400 | apr | 50 |", - "| 3 | cars | 100 | 50 | feb | 400 |", - "| 3 | cars | 100 | 50 | jan | 200 |", - "| 3 | cars | 200 | 400 | mar | 100 |", - "| 4 | appliances | 100 | | apr | 50 |", - "| 4 | appliances | 100 | 50 | jan | 100 |", - "| 4 | appliances | 100 | | mar | 100 |", + "| 1 | electronics | 100 | 200 | APR | 100 |", + "| 1 | electronics | 300 | 100 | FEB | 200 |", + "| 1 | electronics | 300 | 100 | JAN | 100 |", + "| 1 | electronics | 100 | 200 | MAR | 300 |", + "| 2 | clothes | 100 | 300 | APR | 200 |", + "| 2 | clothes | 150 | 200 | FEB | 300 |", + "| 2 | clothes | 150 | 200 | JAN | 100 |", + "| 2 | clothes | 100 | 300 | MAR | 150 |", + "| 3 | cars | 200 | 400 | APR | 50 |", + "| 3 | cars | 100 | 50 | FEB | 400 |", + "| 3 | cars | 100 | 50 | JAN | 200 |", + "| 3 | cars | 200 | 400 | MAR | 100 |", + "| 4 | appliances | 100 | | APR | 50 |", + "| 4 | appliances | 100 | 50 | JAN | 100 |", + "| 4 | appliances | 100 | | MAR | 100 |", "+-------+-------------+-----+-----+-------+-------+", ], )