Skip to content

fix(core): expand the wildcard before Wren rewrite rules #1145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 10, 2025

Conversation

goldmedal
Copy link
Contributor

@goldmedal goldmedal commented Apr 10, 2025

The result of the following SQL is wrong:

select * from "Order_items" where "Order_id" in ('03c83b31dbc387f83f1b5579b53182fb', '08cbb1d4cd574b126569b208fd4b26ea')

The generated SQL will miss the columns because Wren Core only collects the column in the filter.
Since the ExpandWildcardRule will be removed from the latest DataFusion branch. To align this change, I apply the rule before all rules. This behavior is similar to expanding the wildcard in the logical plan builder.

Summary by CodeRabbit

  • Refactor

    • Updated internal processing to prioritize key transformation steps, ensuring consistent behavior.
  • Tests

    • Enhanced SQL query validations with additional nested query checks.
    • Introduced a new test case to validate wildcard filtering.
    • Added new queries in the test suite to verify accurate data retrieval for order items.
    • Modified expected outputs in existing test cases to reflect new SQL structures and data types.

@github-actions github-actions bot added core rust Pull requests that update Rust code labels Apr 10, 2025
@goldmedal goldmedal requested a review from douenergy April 10, 2025 04:13
Copy link

coderabbitai bot commented Apr 10, 2025

Walkthrough

The pull request updates the rule application order in two functions by preemptively adding an ExpandWildcardRule with an accompanying comment. In addition, several SQL query assertions in the test module have been restructured with additional nested SELECT statements and modified column orders, along with the addition of a new test (test_wildcard_where). The SQL logic test file now includes two new queries (labeled RIITRTTT) to validate conditions on the Order_items table. No public entity declarations were altered.

Changes

File(s) Change Summary
wren-core/.../mdl/context.rs Modified the functions analyze_rule_for_local_runtime and analyze_rule_for_unparsing to prepend an instantiation of ExpandWildcardRule with a clarifying comment to ensure its prioritized execution.
wren-core/.../mdl/mod.rs Updated SQL query assertions in test functions (test_uppercase_catalog_schema and test_access_model) by adding extra nested SELECT statements and reordering columns; added new test function test_wildcard_where.
wren-core/.../sqllogictest/test_files/model.slt Added two new SQL queries labeled RIITRTTT to test Order_items table conditions using an IN clause and an equality check.
ibis-server/.../test_query.py Modified expected output in test_query and test_query_with_connection_url functions to reflect new data structures and types.
wren-core-py/.../test_modeling_core.py Updated SQL assertion in test_session_context to include an additional layer of subquerying in the SQL structure.
wren-core/.../bin/sqllogictests.rs Simplified error handling in the run_tests function by replacing nested match statements with direct error retrieval.

Suggested reviewers

  • douenergy

Poem

I'm a nimble rabbit, hopping through the code,
With new rules on board, in a sequence finely bestowed.
SQL queries twirl in nested dance,
Tests validate each rhythmic chance.
Code leaps forward with a joyful tone,
Celebrating changes in every stone! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ced721 and 709cb40.

📒 Files selected for processing (3)
  • ibis-server/tests/routers/v3/connector/postgres/test_query.py (2 hunks)
  • wren-core-py/tests/test_modeling_core.py (1 hunks)
  • wren-core/sqllogictest/bin/sqllogictests.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: cargo test (amd64)
  • GitHub Check: clippy
  • GitHub Check: check Cargo.toml formatting
  • GitHub Check: cargo test (win64)
  • GitHub Check: cargo test (macos)
  • GitHub Check: ci
  • GitHub Check: cargo test (macos-aarch64)
  • GitHub Check: test
🔇 Additional comments (4)
wren-core/sqllogictest/bin/sqllogictests.rs (1)

120-120: Code simplification improves readability.

The change improves error handling by directly returning thread_result.err() which will yield Some(error) if there was an error or None if successful. This streamlines the code by leveraging Rust's Option type and works well with flat_map to filter out successful results.

wren-core-py/tests/test_modeling_core.py (1)

93-93: Appropriate query transformation assertion updated to reflect expanded wildcard behavior.

The updated assertion correctly reflects the new query transformation behavior where the wildcard is expanded before other rewrite rules, resulting in an additional subquery layer in the transformed SQL. This change aligns perfectly with the PR objective of fixing incorrect SQL query results by expanding wildcards earlier in the processing pipeline.

ibis-server/tests/routers/v3/connector/postgres/test_query.py (2)

114-119: Reordered result data to align with new column order from expanded wildcard.

The reordering of expected test values properly reflects the changes in how columns are now ordered after applying the ExpandWildcardRule before other rewrite rules. This change is consistent with the PR objective that fixes how wildcards are expanded in SQL queries.


215-215: Updated assertion to check correct first column value.

The assertion now correctly checks for an integer value (orderkey) as the first column, which is the expected behavior after fixing the wildcard expansion order. This change ensures that the test properly validates the correct column ordering resulting from the PR's fix.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

coderabbitai bot commented Apr 10, 2025

Walkthrough

The changes update the rule analysis in the context.rs file by injecting an ExpandWildcardRule at the beginning of the rules vector in both the local runtime and unparsing functions. In the mod.rs file, the SQL query assertions for customer and artist data have been restructured to use nested subqueries, and a new test function (test_wildcard_where) has been added. Additionally, two new SQL queries labeled RIITRTTT have been added to the SQL logic test file, targeting specific filters on the Order_items table. No public API declarations were altered.

Changes

File Change Summary
wren-core/core/src/mdl/context.rs Prefixed the returned rules in both analyze_rule_for_local_runtime and analyze_rule_for_unparsing with a comment and Arc::new(ExpandWildcardRule::new()).
wren-core/core/src/mdl/mod.rs Restructured SQL query assertions with nested subqueries for customer and artist queries; added a new test function test_wildcard_where to verify wildcard filtering.
wren-core/sqllogictest/test_files/model.slt Introduced two new SQL queries (RIITRTTT) filtering Order_items by specific Order_id values with detailed expected outputs.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Client
    participant Context as Rule Analyzer
    participant Rules as Rule List
    Caller->>Context: Invoke analyze_rule_for_local_runtime/unparsing
    Context->>Rules: Prepend ExpandWildcardRule (Arc::new(...))
    Rules-->>Context: Rule list updated
    Context->>Caller: Return updated rule vector
Loading

Possibly related PRs

Suggested reviewers

  • douenergy

Poem

I'm a rabbit with a joyful hop,
Coding through changes that never stop.
I've nested queries and rules anew,
With ExpandWildcardRule leading the crew!
Hop along in lines of code so bright,
Celebrating progress in every byte.
Let's bounce ahead into a future so light!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1d19e8 and 1ced721.

📒 Files selected for processing (3)
  • wren-core/core/src/mdl/context.rs (2 hunks)
  • wren-core/core/src/mdl/mod.rs (5 hunks)
  • wren-core/sqllogictest/test_files/model.slt (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
wren-core/core/src/mdl/mod.rs (5)
wren-core/core/src/mdl/context.rs (1)
  • new (232-235)
wren-core/core/src/logical_plan/analyze/plan.rs (6)
  • new (66-78)
  • new (104-117)
  • new (619-621)
  • new (735-829)
  • new (883-930)
  • new (989-991)
wren-core/core/src/mdl/lineage.rs (1)
  • new (26-37)
wren-core/core/src/logical_plan/analyze/model_anlayze.rs (3)
  • new (67-75)
  • new (788-796)
  • analyze (45-59)
wren-core/core/src/logical_plan/analyze/model_generation.rs (2)
  • new (33-38)
  • analyze (232-243)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: ci
  • GitHub Check: cargo test (win64)
  • GitHub Check: cargo test (macos)
  • GitHub Check: cargo check
  • GitHub Check: test
🔇 Additional comments (7)
wren-core/core/src/mdl/context.rs (2)

94-95: Fix ensures wildcard expansion before other rules in local runtime

The addition of ExpandWildcardRule at the beginning of the analyzer rules ensures that wildcards in SQL queries are expanded first, addressing the issue where the Wren Core only collects columns specified in filters. This aligns with the PR's objective to fix incorrect SQL query generation when using wildcards.

Note that this rule is being added as the first rule while still preserving the existing instance at line 111, which provides double coverage during this transition period.


123-124: Fix ensures wildcard expansion before other rules in unparsing

Similar to the change for local runtime, adding the ExpandWildcardRule as the first rule in the unparsing analyzer ensures consistent behavior across both execution paths. This is particularly important for maintaining correct SQL generation when wildcards are used in queries with filters.

The comment correctly explains the purpose of this change and its relationship to DataFusion changes.

wren-core/sqllogictest/test_files/model.slt (2)

74-80: Good test case for wildcard expansion with multiple ID filters

This added test is valuable as it directly tests the case mentioned in the PR objectives - selecting all columns from Order_items where Order_id matches specific values. The test includes the expected result set with all relevant columns, helping to verify that the wildcard is properly expanded before the filter is applied.

This test case specifically verifies that the IN clause with multiple values works correctly with wildcard expansion.


81-84: Good complementary test for single ID equality filter

This test adds coverage for the simpler but equally important case of filtering with a single equality condition. It ensures that wildcard expansion also works correctly in this scenario, providing more comprehensive test coverage for the fix.

Together with the previous test, these cases ensure wildcard expansion works in both simple equality and IN clause filtering scenarios.

wren-core/core/src/mdl/mod.rs (3)

1415-1440: Comprehensive unit test for wildcard expansion

This new test function provides valuable coverage for the core functionality being fixed - expanding wildcards in queries with filter conditions. The test verifies that when using SELECT * with a WHERE clause, all columns are properly included in the generated SQL.

The expected SQL output shows the correct nested structure with all columns from the customer table being selected, confirming that the wildcard expansion properly happens before the filter is applied.


621-622: SQL structure update aligns with wildcard expansion fix

This modification to the expected SQL output in the test_uppercase_catalog_schema test updates the query structure to reflect the changes in how wildcards are expanded with the new rule ordering. The nested structure ensures all columns are properly selected even when filters are present.

The change is necessary to maintain consistency with the updated analyzer rule ordering and supports the overall PR objective.


728-730: SQL structure update for Unicode column test case

Similar to the previous change, this updates the expected SQL output in the test_unicode_remote_column_name test to reflect the modified SQL generation behavior after the wildcard expansion rule change.

The updated nested structure ensures proper column selection even with Unicode column names and filters, maintaining consistency with the changes to the analyzer rule ordering.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

coderabbitai bot commented Apr 10, 2025

Walkthrough

The pull request introduces a new ExpandWildcardRule to both the local runtime and unparsing analyzer contexts by inserting it at the beginning of their rule vectors. Additionally, several SQL query assertions in the test module have been updated to nest subqueries for consistency, and a new test function (test_wildcard_where) has been added. Two new SQL queries have also been included in the SQL logic test file to extend test coverage for the Order_items table.

Changes

File(s) Change Summary
wren-core/.../context.rs Added two lines in analyze_rule_for_local_runtime and analyze_rule_for_unparsing to insert a new instance of ExpandWildcardRule at the beginning of the rules vector, aligning with DataFusion updates.
wren-core/.../mod.rs Modified SQL query assertions by restructuring queries using nested subqueries and reordering columns; added a new async test function test_wildcard_where.
wren-core/sqllogictest/.../model.slt Added two new SQL queries labeled RIITRTTT to retrieve records from the Order_items table based on different Order_id filters, enhancing test coverage.

Sequence Diagram(s)

sequenceDiagram
    participant Test as "Test Function"
    participant Analyzer as "Analyzer"
    participant ExpandRule as "ExpandWildcardRule"
    participant OtherRules as "Subsequent Rules"

    Test->>Analyzer: Invoke analyze_rule_for_local_runtime/unparsing
    Note right of Analyzer: Insert ExpandWildcardRule at start of rule chain
    Analyzer->>ExpandRule: Process wildcard expansion
    ExpandRule-->>Analyzer: Return expanded query fragment
    Analyzer->>OtherRules: Apply remaining analysis rules
    OtherRules-->>Analyzer: Return further modifications
    Analyzer-->>Test: Return final analyzed query
Loading

Suggested labels

dependencies

Suggested reviewers

  • douenergy

Poem

Oh, in the code fields I happily hop,
A new rule arrives that makes worries stop.
SQL queries dance in a nested swirl,
Tests bloom like flowers, giving life a twirl.
With bytes and carrots, I cheer the change non-stop!

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (2)
wren-core/core/src/mdl/context.rs (2)

111-111: 🛠️ Refactor suggestion

Consider removing this duplicate rule instance.

Since you've added the ExpandWildcardRule as the first rule (line 95), this second instance at line 111 appears redundant and might lead to confusion. Consider removing it if the rule doesn't need to be applied twice, or add a comment explaining why two instances are necessary.


140-140: 🛠️ Refactor suggestion

Consider removing this duplicate rule instance.

Since you've added the ExpandWildcardRule as the first rule (line 124), this second instance at line 140 appears redundant. Consider removing it if the rule doesn't need to be applied twice, or add a comment explaining why two instances are necessary.

🧹 Nitpick comments (2)
wren-core/core/src/mdl/context.rs (2)

94-95: Fix typo in the comment while adding necessary rule.

The comment has a typo "lastest" which should be "latest" and also contains a duplicate "this". More importantly, I notice that there's another instance of ExpandWildcardRule::new() at line 111. Please clarify the intention of having two instances of the same rule.

-        // To align the lastest change in datafusion, apply this this rule first.
+        // To align the latest change in datafusion, apply this rule first.

123-124: Fix typo in the comment while adding necessary rule.

Similar to the previous comment, the comment has a typo "lastest" which should be "latest" and also contains a duplicate "this". Also, there's a duplicate instance of this rule at line 140.

-        // To align the lastest change in datafusion, apply this this rule first.
+        // To align the latest change in datafusion, apply this rule first.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1d19e8 and 1ced721.

📒 Files selected for processing (3)
  • wren-core/core/src/mdl/context.rs (2 hunks)
  • wren-core/core/src/mdl/mod.rs (5 hunks)
  • wren-core/sqllogictest/test_files/model.slt (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
wren-core/core/src/mdl/mod.rs (4)
wren-core/core/src/mdl/context.rs (1)
  • new (232-235)
wren-core/core/src/logical_plan/analyze/plan.rs (6)
  • new (66-78)
  • new (104-117)
  • new (619-621)
  • new (735-829)
  • new (883-930)
  • new (989-991)
wren-core/core/src/logical_plan/analyze/model_anlayze.rs (3)
  • new (67-75)
  • new (788-796)
  • analyze (45-59)
wren-core/core/src/logical_plan/analyze/model_generation.rs (2)
  • new (33-38)
  • analyze (232-243)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: ci
  • GitHub Check: cargo test (win64)
  • GitHub Check: cargo test (macos)
  • GitHub Check: cargo check
  • GitHub Check: test
🔇 Additional comments (2)
wren-core/sqllogictest/test_files/model.slt (1)

75-84: Good test cases added for wildcard expansion with filtering.

These test cases effectively validate the fix for the issue mentioned in the PR description, where SQL queries with wildcards and filters were failing to include all necessary columns. The tests cover both multi-value (IN clause) and single-value equality filters.

wren-core/core/src/mdl/mod.rs (1)

1415-1440:

❓ Verification inconclusive

Good test function for validating wildcard expansion.

This test function properly validates that wildcards are expanded correctly when combined with filtering conditions. The test creates a simple model with two columns and verifies that the transformed SQL correctly expands the wildcard to include both columns while maintaining the filter condition.

Run the following script to verify that the new test passes with the changes:


🏁 Script executed:

#!/bin/bash
# Run the new test to verify that it passes with the changes

cd wren-core/core
cargo test --test-threads=1 mdl::test::test_wildcard_where -- --nocapture

Length of output: 191


Action: Manual Verification Required of the Rust Test Suite

The test function in wren-core/core/src/mdl/mod.rs (lines 1415–1440) properly validates that wildcard expansion works as intended when combined with filter conditions. However, the initial attempt to run the test failed due to the absence of Cargo in the execution environment. Please ensure you run the test in an environment with Cargo available by executing:

cd wren-core/core
cargo test --test-threads=1 mdl::test::test_wildcard_where -- --nocapture

Verify that the test passes and produces the expected SQL transformation output.

@github-actions github-actions bot added ibis python Pull requests that update Python code labels Apr 10, 2025
Copy link
Contributor

@douenergy douenergy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @goldmedal

@douenergy douenergy merged commit d5d8ae2 into Canner:main Apr 10, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core ibis python Pull requests that update Python code rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants