Skip to content

Commit a821c81

Browse files
committed
fix tests
1 parent 3bd8b55 commit a821c81

File tree

1 file changed

+3
-28
lines changed
  • rust/cubesql/cubesql/src/compile

1 file changed

+3
-28
lines changed

rust/cubesql/cubesql/src/compile/mod.rs

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14633,36 +14633,11 @@ ORDER BY "source"."str0" ASC
1463314633
}
1463414634
init_testing_logger();
1463514635

14636-
let query_plan = convert_select_to_query_plan(
14637-
"
14638-
SELECT DATEADD(DAY, 7, order_date) AS d
14639-
FROM KibanaSampleDataEcommerce AS k
14640-
GROUP BY 1
14641-
ORDER BY 1 DESC
14642-
"
14643-
.to_string(),
14644-
DatabaseProtocol::PostgreSQL,
14645-
)
14646-
.await;
14647-
14648-
let physical_plan = query_plan.as_physical_plan().await.unwrap();
14649-
println!(
14650-
"Physical plan: {}",
14651-
displayable(physical_plan.as_ref()).indent()
14652-
);
14653-
14654-
let logical_plan = query_plan.as_logical_plan();
14655-
assert!(logical_plan
14656-
.find_cube_scan_wrapped_sql()
14657-
.wrapped_sql
14658-
.sql
14659-
.contains("DATEADD(day, 7,"));
14660-
1466114636
// BigQuery
1466214637
let bq_templates = vec![("functions/DATE_ADD".to_string(), "{% if date_part|upper in ['YEAR', 'MONTH', 'QUARTER'] %}TIMESTAMP(DATETIME_ADD(DATETIME({{ args[2] }}), INTERVAL {{ interval }} {{ date_part }})){% else %}TIMESTAMP_ADD({{ args[2] }}, INTERVAL {{ interval }} {{ date_part }}){% endif %}".to_string())];
1466314638
let query_plan = convert_select_to_query_plan_customized(
1466414639
"
14665-
SELECT DATEADD(DAY, 7, order_date) AS d
14640+
SELECT DATE_ADD(DAY, 7, order_date) AS d
1466614641
FROM KibanaSampleDataEcommerce AS k
1466714642
GROUP BY 1
1466814643
ORDER BY 1 DESC
@@ -14687,7 +14662,7 @@ ORDER BY "source"."str0" ASC
1468714662

1468814663
let query_plan = convert_select_to_query_plan_customized(
1468914664
"
14690-
SELECT DATEADD(MONTH, 7, order_date) AS d
14665+
SELECT DATE_ADD(MONTH, 7, order_date) AS d
1469114666
FROM KibanaSampleDataEcommerce AS k
1469214667
GROUP BY 1
1469314668
ORDER BY 1 DESC
@@ -14713,7 +14688,7 @@ ORDER BY "source"."str0" ASC
1471314688
// Postgres
1471414689
let query_plan = convert_select_to_query_plan_customized(
1471514690
"
14716-
SELECT DATEADD(DAY, 7, order_date) AS d
14691+
SELECT DATE_ADD(DAY, 7, order_date) AS d
1471714692
FROM KibanaSampleDataEcommerce AS k
1471814693
GROUP BY 1
1471914694
ORDER BY 1 DESC

0 commit comments

Comments
 (0)