jayzhan211 commented on code in PR #11896: URL: https://github.com/apache/datafusion/pull/11896#discussion_r1712441624
########## datafusion/sql/src/expr/mod.rs: ########## @@ -695,6 +696,23 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { not_impl_err!("Struct not supported by ExprPlanner: {create_struct_args:?}") } + fn parse_tuple( + &self, + schema: &DFSchema, + planner_context: &mut PlannerContext, + values: Vec<SQLExpr>, + ) -> Result<Expr> { + match values.first() { + Some(SQLExpr::Identifier(_)) | Some(SQLExpr::Value(_)) => { + self.parse_struct(schema, planner_context, values, vec![]) + } + None => not_impl_err!("Empty tuple not supported yet"), + _ => { Review Comment: ```rust query error DataFusion error: This feature is not implemented: Only identifiers and literals are supported in tuples select a from values where (a, c) IN ((abs(a), 1)); ``` Query success in duckdb ``` D select a from t where (a, b) in ((1, abs(a))); ┌────────┐ │ a │ │ int32 │ ├────────┤ │ 0 rows │ └────────┘ ``` We could support `abs()` and other complex type in tuple in follow PR, but we should check not only `first` element of the values but all the values in this PR ########## datafusion/sql/src/expr/mod.rs: ########## @@ -695,6 +696,23 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { not_impl_err!("Struct not supported by ExprPlanner: {create_struct_args:?}") } + fn parse_tuple( + &self, + schema: &DFSchema, + planner_context: &mut PlannerContext, + values: Vec<SQLExpr>, + ) -> Result<Expr> { + match values.first() { Review Comment: check all -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org