This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new abbf73dbbc Support compound identifier when parsing tuples (#16225)
abbf73dbbc is described below

commit abbf73dbbc84fef2b1235a0f9dc5a8e144ca34ea
Author: hozan23 <119854621+hoza...@users.noreply.github.com>
AuthorDate: Wed Jun 4 22:21:59 2025 +0200

    Support compound identifier when parsing tuples (#16225)
---
 datafusion/sql/src/expr/mod.rs                |  4 +++-
 datafusion/sqllogictest/test_files/struct.slt | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/datafusion/sql/src/expr/mod.rs b/datafusion/sql/src/expr/mod.rs
index d29ccdc6a7..eadf66a91e 100644
--- a/datafusion/sql/src/expr/mod.rs
+++ b/datafusion/sql/src/expr/mod.rs
@@ -644,7 +644,9 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
         values: Vec<SQLExpr>,
     ) -> Result<Expr> {
         match values.first() {
-            Some(SQLExpr::Identifier(_)) | Some(SQLExpr::Value(_)) => {
+            Some(SQLExpr::Identifier(_))
+            | Some(SQLExpr::Value(_))
+            | Some(SQLExpr::CompoundIdentifier(_)) => {
                 self.parse_struct(schema, planner_context, values, vec![])
             }
             None => not_impl_err!("Empty tuple not supported yet"),
diff --git a/datafusion/sqllogictest/test_files/struct.slt 
b/datafusion/sqllogictest/test_files/struct.slt
index 46e15a4d6d..95eeffc319 100644
--- a/datafusion/sqllogictest/test_files/struct.slt
+++ b/datafusion/sqllogictest/test_files/struct.slt
@@ -271,12 +271,33 @@ select a from values where (a, c) = (1, 'a');
 ----
 1
 
+query I
+select a from values as v where (v.a, v.c) = (1, 'a');
+----
+1
+
+query I
+select a from values as v where (v.a, v.c) != (1, 'a');
+----
+2
+3
+
+query I
+select a from values as v where (v.a, v.c) = (1, 'b');
+----
+
 query I
 select a from values where (a, c) IN ((1, 'a'), (2, 'b'));
 ----
 1
 2
 
+query I
+select a from values as v where (v.a, v.c) IN ((1, 'a'), (2, 'b'));
+----
+1
+2
+
 statement ok
 drop table values;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@datafusion.apache.org
For additional commands, e-mail: commits-h...@datafusion.apache.org

Reply via email to