duongcongtoai commented on issue #14554: URL: https://github.com/apache/datafusion/issues/14554#issuecomment-2730673982
From this [PR](https://github.com/apache/datafusion/pull/6457), there are several types of query mentioned that need support 1. In Subquery contains limit/order by ``` select students where student_id in ( select e.student_id from exams order by score limit 10 ) ``` 2. Scalar subquery contains limit/order by ``` select * from student s where s.last_semester_avg_score > ( select avg(score) from ( select score from exam e where e.student_id=s.student_id order by timestamp limit 3 ) ) ``` 3. There is union in subquery (the initial proposal of this issue) ``` select * from student s where (select avg(score) from exam e where e.student_id = s.student_id or e.student_name=s.student_name) > 0.5 ``` 4. Correlated expressions are in join condition ``` select * from students s join exam e on s.last_semester_avg_score > ( select avg(score) from exam e2 where e2.class_id=e.class_id ) ``` 5. Correlated expressions are in aggregation expressions ``` SELECT * from students s where 5 < ( SELECT max(student.last_semester_avg_score+b.score) as max_adjusted_score FROM bonus b ); ``` 6. Correlated expressions are in window expressions This i cannot find any example query I'll start thinking about implementing unnesting for all these usecases -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
