alamb commented on code in PR #3336:
URL: https://github.com/apache/arrow-datafusion/pull/3336#discussion_r961593470
##########
datafusion/expr/src/utils.rs:
##########
@@ -681,12 +681,7 @@ pub fn expr_as_column_expr(expr: &Expr, plan:
&LogicalPlan) -> Result<Expr> {
let field = plan.schema().field_from_column(col)?;
Ok(Expr::Column(field.qualified_column()))
}
- _ => {
- // we should not be trying to create a name for the expression
- // based on the input schema but this is the current behavior
- // see https://github.com/apache/arrow-datafusion/issues/2456
Review Comment:
Looks like https://github.com/apache/arrow-datafusion/issues/2456 could be
closed too, perhaps
##########
datafusion/expr/src/expr.rs:
##########
@@ -962,18 +907,31 @@ fn create_name(e: &Expr, input_schema: &DFSchema) ->
Result<String> {
}
/// Create a comma separated list of names from a list of expressions
-fn create_names(exprs: &[Expr], input_schema: &DFSchema) -> Result<String> {
+fn create_names(exprs: &[Expr]) -> Result<String> {
Ok(exprs
.iter()
- .map(|e| create_name(e, input_schema))
+ .map(create_name)
.collect::<Result<Vec<String>>>()?
.join(", "))
}
#[cfg(test)]
mod test {
use crate::expr_fn::col;
- use crate::lit;
+ use crate::{case, lit};
+ use datafusion_common::{Result, ScalarValue};
+
+ #[test]
+ fn format_case_when() -> Result<()> {
Review Comment:
❤️
--
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]