You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/08/07 17:29:21 UTC
[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #7218: Add `Expr::field`, `Expr::index`, and `Expr::slice`, add docs
alamb commented on code in PR #7218:
URL: https://github.com/apache/arrow-datafusion/pull/7218#discussion_r1286191009
##########
datafusion/sql/src/expr/identifier.rs:
##########
@@ -136,12 +136,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
)));
}
let nested_name = nested_names[0].to_string();
- Ok(Expr::GetIndexedField(GetIndexedField::new(
- Box::new(Expr::Column(field.qualified_column())),
- GetFieldAccess::NamedStructField {
- name: ScalarValue::Utf8(Some(nested_name)),
- },
- )))
+ Ok(Expr::Column(field.qualified_column()).field(nested_name))
Review Comment:
This shows the kind of API cleanup that is possible using this new API
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org