xiedeyantu commented on code in PR #21715:
URL: https://github.com/apache/datafusion/pull/21715#discussion_r3189372323
##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -2431,7 +2434,14 @@ impl SubqueryAlias {
// Requalify fields with the new `alias`.
let fields = plan.schema().fields().clone();
let meta_data = plan.schema().metadata().clone();
- let func_dependencies =
plan.schema().functional_dependencies().clone();
+ // Recursive queries do not expose the anchor's functional
dependencies to
+ // the outer schema — the recursive term can produce rows that violate
+ // those dependencies, so they are intentionally dropped here.
+ let func_dependencies = if is_recursive_query {
+ FunctionalDependencies::empty()
+ } else {
+ plan.schema().functional_dependencies().clone()
+ };
Review Comment:
Sure, I have added a test.
--
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]