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
Include data types in logical plans of inferred prepare statements (apache#16019)
* draft commit to rolledback changes on function naming and include prepare clause on the infer types tests
* include data types in plan when it is not included in the prepare statement
* fix: prepare statement error
* Update datafusion/sql/src/statement.rs
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* remove infer types from prepare statement
the infer data type changes in statement will be introduced in a new PR
* fix to show correct output message
* include data types on logical plans of prepare statements without explicit type declaration
* fix using clippy sugestions
* explicitly get the data types using the placeholder id to avoid sorting
* Restore the original tests too
* update set data type routine to be more rust idiomatic
Co-authored-by: Tommy shu <qstommyshu@gmail.com>
* update set datatype routine
* fix formatting in sql_integration
---------
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Tommy shu <qstommyshu@gmail.com>
Projection: person.id AS id, person.first_name AS first_name, person.last_name AS last_name, $1 AS age, person.state AS state, person.salary AS salary, person.birth_date AS birth_date, person.😀 AS 😀
let param_values = vec![ScalarValue::Int32(Some(42)),ScalarValue::UInt32(Some(1))];
4961
+
let plan_with_params = plan.with_param_values(param_values).unwrap();
4962
+
4963
+
assert_snapshot!(
4964
+
plan_with_params,
4965
+
@r"
4966
+
Dml: op=[Update] table=[person]
4967
+
Projection: person.id AS id, person.first_name AS first_name, person.last_name AS last_name, Int32(42) AS age, person.state AS state, person.salary AS salary, person.birth_date AS birth_date, person.😀 AS 😀
Projection: column1 AS id, column2 AS first_name, column3 AS last_name, CAST(NULL AS Int32) AS age, CAST(NULL AS Utf8) AS state, CAST(NULL AS Float64) AS salary, CAST(NULL AS Timestamp(Nanosecond, None)) AS birth_date, CAST(NULL AS Int32) AS 😀
let plan_with_params = plan.with_param_values(param_values).unwrap();
5041
+
assert_snapshot!(
5042
+
plan_with_params,
5043
+
@r#"
5044
+
Dml: op=[Insert Into] table=[person]
5045
+
Projection: column1 AS id, column2 AS first_name, column3 AS last_name, CAST(NULL AS Int32) AS age, CAST(NULL AS Utf8) AS state, CAST(NULL AS Float64) AS salary, CAST(NULL AS Timestamp(Nanosecond, None)) AS birth_date, CAST(NULL AS Int32) AS 😀
5046
+
Values: (UInt32(1) AS $1, Utf8("Alan") AS $2, Utf8("Turing") AS $3)
0 commit comments