21135: fix: propagate errors for unsupported table function arguments instead of silently dropping them#291
21135: fix: propagate errors for unsupported table function arguments instead of silently dropping them#291martin-augment wants to merge 1 commit intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness of table function argument parsing by ensuring that invalid or unsupported argument types are no longer silently ignored or lead to ambiguous error messages. The changes allow for immediate and precise error reporting, improving the developer and user experience when interacting with DataFusion's SQL capabilities. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThe changes modify error handling in table function argument processing. The SQL relation module switches from deferred error handling via ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
🤖 Augment PR SummarySummary: Ensure unsupported table-function arguments surface as planning errors rather than being silently dropped. 🤖 Was this summary useful? React with 👍 or 👎 |
|
Test comment - please ignore |
|
placeholder |
There was a problem hiding this comment.
Code Review
This pull request refactors the processing of function arguments in SQL to relational plan conversion. It changes flat_map to map and introduces early error propagation using collect::<Result<Vec<_>>>()? when converting SQL expressions to logical expressions for function arguments. This ensures that unsupported function argument types correctly propagate specific error messages instead of generic or misleading ones. New integration tests and sqllogictests have been added to validate this improved error handling. There are no review comments to address.
|
Code Review - PR 21135: propagate errors for unsupported table function arguments This is a clean and correct bug fix. Here is my analysis: WHAT THE BUG WAS The original code used flat_map to process table function arguments. In Rust, Result implements IntoIterator: Ok(v) yields one item, but Err(e) yields zero items. This caused flat_map to silently discard the unsupported-argument error, leading to confusing downstream errors like 'requires 1 to 3 arguments' instead of the actual cause. THE FIX Changing to .map(...).collect() with Result propagation via the ? operator is the idiomatic Rust pattern. The first error short-circuits and is propagated immediately. POSITIVE ASPECTS
MINOR OBSERVATIONS (non-blocking)
SUMMARY The fix is correct, idiomatic, and well-tested. Ready to merge. |
21135: To review by AI