You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/27 19:45:26 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #2352: Add SQL query planner support for IN subqueries

alamb commented on code in PR #2352:
URL: https://github.com/apache/arrow-datafusion/pull/2352#discussion_r860184293


##########
datafusion/core/src/sql/planner.rs:
##########
@@ -4311,4 +4327,41 @@ mod tests {
         );
         quick_test(sql, &expected);
     }
+
+    #[test]
+    fn in_subquery_uncorrelated() {
+        let sql = "SELECT id FROM person p WHERE id IN \
+            (SELECT id FROM person)";
+
+        let subquery_expected = "Subquery: Projection: #person.id\
+        \n  TableScan: person projection=None";
+
+        let expected = format!(
+            "Projection: #p.id\
+            \n  Filter: #p.id IN ({})\
+            \n    SubqueryAlias: p\
+            \n      TableScan: person projection=None",
+            subquery_expected
+        );
+        quick_test(sql, &expected);
+    }
+
+    #[test]

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org