You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Epic]: Google Summer of Code 2025 Correlated Subquery Support #16059
Is your feature request related to a problem or challenge?
DataFusion currently has limited support for correlated subqueries. This project aims to implement comprehensive support for correlated subqueries in Apache DataFusion by applying Hyper's 'Unnesting Arbitrary
Queries' framework.
May 8 - June 1: Community Bonding Period | GSoC contributors get to know mentors, read documentation, get up to speed to begin working on their projects
changed the title [-][Epic]: Enhance Correlated Subquery Support[/-][+][Epic]: Google Summer of Code 2025 Correlated Subquery Support[/+]on May 15, 2025
@irenjj could you attach your GSOC proposal to this issue so it is public? I think you did quite a good job on that and it would be great to make it more public
Let's plan to use this ticket for high level project planning / coordination, and will use other tickets for specific technical work
I update the description on this ticket with some more detail and the GOSC timeline, along with some other related work I know about. If anyone else has suggested readings we can add to the list that would be great
@irenjj and I had a discussion today and covered the following items:
It is likely that supporting multiple subquery decorrelation (e.g. arbitrary levels of correlation) will require a more general subquery decorrelation framework (which we will discuss in more detail on related tickets)
One of the major lessons for working with DataFusion and open source is figuring out how to work with the broader community (among other things, you never know who is reading an issue or who might be interested in an update)
Would it be possible to summarize how things are going and what you are planning to do in the near future?
It's runnable and have passed half of tests in subquery.slt in my local branch, but haven't submitted the PR yet. and most operators are supported now(except union and cte), currently we are focusing on metadata layer issues.
Hi @alamb and @irenjj, I would like to understand how to implement the Correlated Subquery feature in DataFusion. Is there a timeline organized by feature milestones and corresponding Pull Requests that I can refer to in order to study the relevant code?
Hi @Standing-Man -- that is a great question. @irenjj perhaps this would be a good exercise for the next weekly update -- make an "Epic" style description of the steps needed and how many you have completed / are working on
COMPLETED WORK
Simple implementation of decorrelation framework - algorithm implementation for converting correlated subqueries with three main components:
DependentJoinRewriter - Converts subqueries into dependent joins
DependentJoinDecorrelator - Removes correlations using advanced unnesting
Fix corner cases in existing tests - Ensure all previously passing tests in subquery.slt work with the new decorrelation framework, including edge cases that currently fail
Add configuration variable - Implement a config variable to manually enable/disable the decorrelate_general functionality, allowing users to toggle between old and new subquery processing
Add complex test cases - Implement support for more sophisticated scenarios that the original system couldn't handle (e.g., TPC-DS benchmark queries and other complex correlated subquery patterns)
Activity
[-][Epic]: Enhance Correlated Subquery Support[/-][+][Epic]: Google Summer of Code 2025 Correlated Subquery Support[/+]alamb commentedon May 15, 2025
@irenjj could you attach your GSOC proposal to this issue so it is public? I think you did quite a good job on that and it would be great to make it more public
alamb commentedon May 18, 2025
Let's plan to use this ticket for high level project planning / coordination, and will use other tickets for specific technical work
I update the description on this ticket with some more detail and the GOSC timeline, along with some other related work I know about. If anyone else has suggested readings we can add to the list that would be great
@irenjj and I had a discussion today and covered the following items:
alamb commentedon Jul 25, 2025
👋 @irenjj and @duongcongtoai , I hope things are well with you
It seems as though you have been working on @duongcongtoai 's fork which is a great idea: https://github.com/duongcongtoai/arrow-datafusion/pulls?q=is%3Apr
Would it be possible to summarize how things are going and what you are planning to do in the near future?
irenjj commentedon Jul 25, 2025
It's runnable and have passed half of tests in
subquery.sltin my local branch, but haven't submitted the PR yet. and most operators are supported now(except union and cte), currently we are focusing on metadata layer issues.alamb commentedon Jul 25, 2025
Awesome -- thank you @irenjj
Maybe once you have a PR, you can ping me and I can give it a high level look and hear what you plan next.
Standing-Man commentedon Jul 29, 2025
Hi @alamb and @irenjj, I would like to understand how to implement the Correlated Subquery feature in DataFusion. Is there a timeline organized by feature milestones and corresponding Pull Requests that I can refer to in order to study the relevant code?
alamb commentedon Jul 29, 2025
Hi @Standing-Man -- that is a great question. @irenjj perhaps this would be a good exercise for the next weekly update -- make an "Epic" style description of the steps needed and how many you have completed / are working on
irenjj commentedon Aug 10, 2025
Hi @Standing-Man here is a runnable version #17110 (but still has some issues), and i wrote a simple doc to explain how it works.
cc @alamb @duongcongtoai
alamb commentedon Sep 10, 2025
@irenjj now that GSOC 2025 is coming to a close, perhaps you can briefly summarize the state of the project and we can close down this ticket?
irenjj commentedon Sep 11, 2025
Here is a brief summarize of the project:
COMPLETED WORK
Simple implementation of decorrelation framework - algorithm implementation for converting correlated subqueries with three main components:
REMAINING WORK
alamb commentedon Sep 12, 2025
the PR to add correlated subquery support is here:
I think with that let's claim this project is done.
Thank you for all your effort @irenjj