Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(sql): split type checking into CoreExpr modules#19829

Merged
forsaken628 merged 75 commits into
databendlabs:mainfrom
forsaken628:core-expr
May 20, 2026
Merged

refactor(sql): split type checking into CoreExpr modules#19829
forsaken628 merged 75 commits into
databendlabs:mainfrom
forsaken628:core-expr

Conversation

@forsaken628
Copy link
Copy Markdown
Collaborator

@forsaken628 forsaken628 commented May 9, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Refactor SQL type checking to lower AST expressions into CoreExpr first, then resolve them through module-specific type-check implementations. This splits the old monolithic
type_check.rs into focused modules for aggregate, scalar, special functions, UDF, column, variant, window, in-list, SRF, and related behavior.

Also narrows runtime/catalog/UDF/session dependencies behind the type-check adapter boundary, while preserving existing behavior for edge cases such as IN-list rewrite
thresholds, SRF restrictions, aggregate/window legality, UDF resolution, variant virtual columns, and vector function fallback.

Tests were reorganized to match the implementation module split and expanded with golden behavior coverage for the refactored paths.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions Bot added the pr-feature this PR introduces a new feature to the codebase label May 9, 2026
@forsaken628 forsaken628 changed the title feat(binder): Core expr refactor(sql): split type checking into CoreExpr modules May 13, 2026
@github-actions github-actions Bot added the pr-refactor this PR changes the code base without new features or bugfix label May 13, 2026
@forsaken628 forsaken628 marked this pull request as ready for review May 13, 2026 08:21
@forsaken628 forsaken628 requested a review from sundy-li May 14, 2026 06:24
Comment thread src/query/sql/src/planner/semantic/type_check/date.rs Outdated
Comment thread src/query/sql/src/planner/semantic/type_check/adapter.rs Outdated
@forsaken628 forsaken628 added this pull request to the merge queue May 20, 2026
Merged via the queue into databendlabs:main with commit f6c1e0c May 20, 2026
204 of 208 checks passed
@forsaken628 forsaken628 deleted the core-expr branch May 20, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase pr-refactor this PR changes the code base without new features or bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants