NGA-TRAN commented on code in PR #4490:
URL: https://github.com/apache/arrow-datafusion/pull/4490#discussion_r1042559049
##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -120,13 +138,44 @@ impl ExprSchemable for Expr {
ref right,
ref op,
}) => binary_operator_data_type(
- &left.get_type(schema)?,
+ &left.get_type_with_params(schema, param_data_types)?,
op,
- &right.get_type(schema)?,
+ &right.get_type_with_params(schema, param_data_types)?,
),
Expr::Like { .. } | Expr::ILike { .. } | Expr::SimilarTo { .. } =>
{
Ok(DataType::Boolean)
}
+ // Return the type of the corresponding param defined in
param_data_types of `PREPARE my_plan(param_data_types)`
+ Expr::Placeholder(param) => {
+ // param is $1, $2, $3, ...
+ // Let convert it to index: 0, 1, 2, ...
+ let index = param[1..].parse::<usize>();
Review Comment:
Since sqlparser only supports number after $ for now, I have verified this
when the earlier when we create the Expo::Placeholder and also added a test for
it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]