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

[1/2] Resolve functions from the catalog #1584

Merged
merged 2 commits into from
Sep 19, 2024
Merged

[1/2] Resolve functions from the catalog #1584

merged 2 commits into from
Sep 19, 2024

Conversation

RCHowell
Copy link
Member

@RCHowell RCHowell commented Sep 16, 2024

Relevant Issues

#1496

Description

This Part 1 of 2 – the second part will remove SqlFnProvider entirely.

This PR removes direct calls to the SqlFnProvider for lookup ONLY as a piecewise step towards implementing the PartiQL-PATH in which we search the session PATH for the function names. The implementations are still provided via lookup by specific.

Names

  • Routines are the what SQL describes as "callable" objects.
  • Function is an interface for scalar routines.
  • Aggregation is an interface for aggregation routines.
  • Procedure does NOT exist yet, but could be added later, as it is a type of routine defined by SQL.

The following changes are incremental,

  • The Env now searches for functions/aggregations via the Catalog.
  • Resolution/matching is still dependent upon FnSignature
  • Removing FnSignature will be a BIG diff, so I am setting everything up beforehand.

I have a follow-up issue for recent discussion points, #1585.

Other Information

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

github-actions bot commented Sep 16, 2024

CROSS-ENGINE Conformance Report ❌

BASE (EVAL-D13D683) TARGET (LEGACY-D13D683) +/-
% Passing 94.20% 89.67% -4.53% ⭕
Passing 5554 5287 -267 ⭕
Failing 75 609 534 ⭕
Ignored 267 0 -267 ✅
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: d13d683
  • Base Engine: EVAL
  • Target Commit: d13d683
  • Target Engine: LEGACY

Result Details

  • ❌ REGRESSION DETECTED. See Now Failing Tests. ❌
  • Passing in both: 5019
  • Failing in both: 74
  • PASSING in BASE but now FAILING in TARGET: 535
  • FAILING in BASE but now PASSING in TARGET: 1

Now Failing Tests ❌

The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

Now Passing Tests

The following 1 test(s) were previously FAILING in BASE but are now PASSING in TARGET. Before merging, confirm they are intended to pass:

Click here to see
  1. MYSQL_SELECT_29, compileOption: LEGACY

CROSS-COMMIT-EVAL Conformance Report ✅

BASE (EVAL-8E0AFFF) TARGET (EVAL-D13D683) +/-
% Passing 94.20% 94.20% 0.00% ✅
Passing 5554 5554 0 ✅
Failing 75 75 0 ✅
Ignored 267 267 0 ✅
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: 8e0afff
  • Base Engine: EVAL
  • Target Commit: d13d683
  • Target Engine: EVAL

Result Details

  • Passing in both: 5554
  • Failing in both: 75
  • PASSING in BASE but now FAILING in TARGET: 0
  • FAILING in BASE but now PASSING in TARGET: 0

CROSS-COMMIT-LEGACY Conformance Report ✅

BASE (LEGACY-8E0AFFF) TARGET (LEGACY-D13D683) +/-
% Passing 89.67% 89.67% 0.00% ✅
Passing 5287 5287 0 ✅
Failing 609 609 0 ✅
Ignored 0 0 0 ✅
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: 8e0afff
  • Base Engine: LEGACY
  • Target Commit: d13d683
  • Target Engine: LEGACY

Result Details

  • Passing in both: 5287
  • Failing in both: 609
  • PASSING in BASE but now FAILING in TARGET: 0
  • FAILING in BASE but now PASSING in TARGET: 0

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (v1@8e0afff). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v1    #1584   +/-   ##
=====================================
  Coverage      ?   77.26%           
  Complexity    ?     2470           
=====================================
  Files         ?      253           
  Lines         ?    18571           
  Branches      ?     3491           
=====================================
  Hits          ?    14349           
  Misses        ?     3196           
  Partials      ?     1026           
Flag Coverage Δ
EXAMPLES 80.03% <ø> (?)
LANG 77.18% <ø> (?)

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

@alancai98 alancai98 left a comment

Choose a reason for hiding this comment

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

Just a small nit and question. Refactor looks good otherwise

Comment on lines +67 to +72
* Returns a collection of scalar functions in this catalog with the given name, or an empty list if none.
*/
public fun getFunctions(session: Session, name: String): Collection<Function> = SqlFnProvider.lookupFn(name)

/**
* Returns a collection of aggregation functions in this catalog with the given name, or an empty list if none.
Copy link
Member

Choose a reason for hiding this comment

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

nit: collection vs list

Suggested change
* Returns a collection of scalar functions in this catalog with the given name, or an empty list if none.
*/
public fun getFunctions(session: Session, name: String): Collection<Function> = SqlFnProvider.lookupFn(name)
/**
* Returns a collection of aggregation functions in this catalog with the given name, or an empty list if none.
* Returns a collection of scalar functions in this catalog with the given name, or an empty collection if none.
*/
public fun getFunctions(session: Session, name: String): Collection<Function> = SqlFnProvider.lookupFn(name)
/**
* Returns a collection of aggregation functions in this catalog with the given name, or an empty collection if none.

Comment on lines +25 to +28
/**
* TODO REMOVE ME ??
*/
public fun getSpecific(): String
Copy link
Member

Choose a reason for hiding this comment

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

Will this be kept for v1 or is it just used as part of the refactoring process?

Copy link
Member Author

Choose a reason for hiding this comment

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

Part of refactoring, removed in next PR

@RCHowell RCHowell merged commit 4fa1a76 into v1 Sep 19, 2024
14 checks passed
@RCHowell RCHowell deleted the v1-fn-path branch September 19, 2024 19:23
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