You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let table_scan = table_scan(Some("customer"),&schema,Some(vec![0,1]))?.build()?;
1729
+
1730
+
let plan = LogicalPlanBuilder::from(table_scan)
1731
+
.alias("customer")?
1732
+
.project(vec![
1733
+
col("customer.c_custkey"),
1734
+
cast(col("customer.c_custkey"),DataType::Int64)
1735
+
.add(lit(1))
1736
+
.alias("custkey_plus"),
1737
+
col("customer.c_name"),
1738
+
])?
1739
+
.alias("customer")?
1740
+
.project(vec![
1741
+
col("customer.c_custkey"),
1742
+
col("customer.c_name"),
1743
+
col("customer.custkey_plus"),
1744
+
])?
1745
+
.alias("customer_view")?
1746
+
.build()?;
1747
+
1748
+
let unparser = Unparser::default();
1749
+
let sql = unparser.plan_to_sql(&plan)?;
1750
+
let expected = "SELECT customer_view.c_custkey, customer_view.c_name, customer_view.custkey_plus FROM (SELECT customer.c_custkey, (CAST(customer.c_custkey AS BIGINT) + 1) AS custkey_plus, customer.c_name FROM (SELECT customer.c_custkey, customer.c_name FROM customer AS customer) AS customer) AS customer_view";
0 commit comments