Skip to content
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

Isolates local variable resolution logic #1344

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Isolates local variable resolution logic #1344

merged 1 commit into from
Jan 23, 2024

Conversation

RCHowell
Copy link
Member

Description

While working towards unifying our resolution logic for catalog identifiers, I began cleaning up the Env.kt. This cleans up local resolution (isolating all logic to TypeEnv for easy testing). It also appropriately prioritizes known schema matches over open schema matches (known vs not known).

This matches what is defined in our specification for locals resolution, but there's a possible extension to discuss. We may consider matching longest locals paths. If you read p38 carefully, it indicates we only match the path root for locals (that's what in this PR) — but I believe we should consider matching longest local variable paths as well.

Other Information

  • Updated Unreleased Section in CHANGELOG: [YES/NO]
    No

  • Any backward-incompatible changes? [YES/NO]
    No

  • Any new external dependencies? [YES/NO]
    No

  • Do your changes comply with the Contributing Guidelines
    and Code Style Guidelines? [YES/NO]
    Yes

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

Conformance comparison report

Base (d37369e) dd27e38 +/-
% Passing 92.54% 92.54% 0.00%
✅ Passing 5384 5384 0
❌ Failing 434 434 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0

Number passing in both: 5384

Number failing in both: 434

Number passing in Base (d37369e) but now fail: 0

Number failing in Base (d37369e) but now pass: 0

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d37369e) 72.15% compared to head (8ad5436) 72.15%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1344   +/-   ##
=========================================
  Coverage     72.15%   72.15%           
  Complexity     2095     2095           
=========================================
  Files           221      221           
  Lines         15984    15984           
  Branches       2896     2896           
=========================================
  Hits          11534    11534           
  Misses         3641     3641           
  Partials        809      809           
Flag Coverage Δ
CLI 11.86% <ø> (ø)
EXAMPLES 80.28% <ø> (ø)
LANG 80.78% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@johnedquinn johnedquinn left a comment

Choose a reason for hiding this comment

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

Very interesting. I like the consolidation of local typing into the TypeEnv while utilizing the normal visitor for the PlanTyper to type the rest of the produced path. It's a subtle difference, but it makes for a nice flow.

Looks good to me!

@RCHowell RCHowell merged commit 89d38df into main Jan 23, 2024
10 checks passed
@RCHowell RCHowell deleted the local-resolution branch January 23, 2024 22:23
yliuuuu added a commit that referenced this pull request Jan 24, 2024
* Isolates local variable resolution logic (#1344)

---------

Co-authored-by: R. C. Howell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants