fix(core): fix RLAC for model with an alias#1245
Conversation
WalkthroughThe changes update the logical plan generation for models with row-level security (RLS) filters by inserting a projection after the filter to align with DataFusion's planning behavior. Additionally, an asynchronous test is added to verify correct SQL transformation and alias handling when RLS is applied to models. Test snapshots in both Rust and Python are updated to reflect the new nested subquery structure for RLAC filters. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant LogicalPlanBuilder
participant RLSFilter
participant Projection
User->>LogicalPlanBuilder: Build model plan with RLS
LogicalPlanBuilder->>RLSFilter: Apply RLS filter
RLSFilter->>Projection: Insert projection selecting all columns
Projection->>LogicalPlanBuilder: Return updated plan
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learningswren-core-py/tests/test_modeling_core.py (1)⏰ Context from checks skipped due to timeout of 90000ms (8)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thanks @goldmedal |
DataFusion plan a filter in the subquery to the plan like
We need to follow the pattern to build our custom plan for datafusion unparsing.
Summary by CodeRabbit
Bug Fixes
Tests