Skip to content

Conversation

@iajoiner
Copy link
Contributor

@iajoiner iajoiner commented Nov 21, 2025

Rationale for this change

We have a hidden bug, namely ProofExpr::get_column_references only makes sense if they are on a source table since in query_proof.rs that's how they are eventually used. Hence nothing other than TableExec, LegacyFilterExec and GroupByExec should actually be sources of these column references. In order to achieve that the first step is that we only allow deprecated proof plans, LegacyFilterExec and GroupByExec, to use ColumnFields of ProofExprs they use since these are actually reliably on source tables. Eventually get_column_references is scheduled to be removed everywhere since what datafusion and the planner consider to be in TableExecs are precisely the columns of source tables we need.

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 81.66667% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.69%. Comparing base (4cba4b0) to head (3c9d4e1).
⚠️ Report is 36 commits behind head on main.

Files with missing lines Patch % Lines
...roof-of-sql/src/sql/proof_exprs/inequality_expr.rs 0.00% 3 Missing ⚠️
.../proof-of-sql/src/sql/proof_exprs/subtract_expr.rs 0.00% 3 Missing ⚠️
...ates/proof-of-sql/src/sql/proof_exprs/cast_expr.rs 0.00% 2 Missing ⚠️
...of-of-sql/src/sql/proof_exprs/scaling_cast_expr.rs 0.00% 2 Missing ⚠️
...oof-of-sql/src/sql/proof_exprs/placeholder_expr.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1087      +/-   ##
==========================================
- Coverage   96.72%   96.69%   -0.04%     
==========================================
  Files         302      302              
  Lines       58840    58909      +69     
==========================================
+ Hits        56915    56961      +46     
- Misses       1925     1948      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@iajoiner iajoiner marked this pull request as ready for review November 23, 2025 02:45
Copilot AI review requested due to automatic review settings November 23, 2025 02:45
@iajoiner iajoiner enabled auto-merge (squash) November 23, 2025 02:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the ProofExpr trait to replace the get_column_references method with get_column_fields, addressing a hidden bug where column references only make sense when they're on source tables. The change separates the collection of column metadata (ColumnField) from the association with specific table references (ColumnRef).

Key changes:

  • Renamed ProofExpr::get_column_references to ProofExpr::get_column_fields with updated signature
  • Updated all expression implementations to collect ColumnField instead of ColumnRef
  • Modified LegacyFilterExec and GroupByExec to convert ColumnField to ColumnRef using table context

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
proof_expr.rs Updated trait method from get_column_references to get_column_fields, changing return type from ColumnRef to ColumnField with updated documentation
column_expr.rs Updated to use get_column_fields and insert ColumnField objects via get_column_field() helper
add_expr.rs, subtract_expr.rs, multiply_expr.rs Updated binary arithmetic expressions to use get_column_fields
and_expr.rs, or_expr.rs, not_expr.rs Updated logical expressions to use get_column_fields
equals_expr.rs, inequality_expr.rs Updated comparison expressions to use get_column_fields
cast_expr.rs, scaling_cast_expr.rs Updated cast expressions to use get_column_fields
literal_expr.rs, placeholder_expr.rs Updated leaf expressions with empty get_column_fields implementations
dyn_proof_expr.rs Added ColumnField to imports
legacy_filter_exec.rs Updated to collect ColumnFields and convert to ColumnRefs using table reference
group_by_exec.rs Updated to collect ColumnFields and convert to ColumnRefs using table reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@stuarttimwhite stuarttimwhite force-pushed the fix/remove-get-column-references branch from cb64b39 to 3c9d4e1 Compare December 1, 2025 15:45
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

This PR has been marked as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants