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

Adds support for dynamic dispatch in evaluation #1347

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

johnedquinn
Copy link
Member

Relevant Issues

  • None

Description

  • Adds support for dynamic dispatch in evaluation
  • As all of the logic for matching function resides in the planner, I updated the plan representation of dynamic dispatch to hold the expected argument types for each candidate function. This should make our implementation faster, as the checks are minute.
  • As the function pathing is still being worked on, I added a temporary deprecated API to help load in functions for execution. This will be removed once pathing is added.

Other Information

  • Updated Unreleased Section in CHANGELOG: NO
  • Any backward-incompatible changes? YES
    • The modelling of dynamic dispatch has changed slightly in the plan representation.
  • Any new external dependencies? NO
  • Do your changes comply with the Contributing Guidelines
    and Code Style Guidelines? 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

github-actions bot commented Jan 24, 2024

Conformance comparison report-Cross Engine

Base (legacy) eval +/-
% Passing 92.54% 22.10% -70.44%
✅ Passing 5384 1286 -4098
❌ Failing 434 4532 4098
🔶 Ignored 0 0 0
Total Tests 5818 5818 0
Number passing in both: 1269

Number failing in both: 417

Number passing in legacy engine but fail in eval engine: 4115

Number failing in legacy engine but pass in eval engine: 17
⁉️ CONFORMANCE REPORT REGRESSION DETECTED ⁉️
The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.
17 test(s) were failing in legacy but now pass in eval. Before merging, confirm they are intended to pass.
The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

Conformance comparison report-Cross Commit-LEGACY

Base (23961f3) 162a313 +/-
% 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 (23961f3) but now fail: 0

Number failing in Base (23961f3) but now pass: 0

Conformance comparison report-Cross Commit-EVAL

Base (23961f3) 162a313 +/-
% Passing 21.59% 22.10% 0.52%
✅ Passing 1256 1286 30
❌ Failing 4562 4532 -30
🔶 Ignored 0 0 0
Total Tests 5818 5818 0
Number passing in both: 1256

Number failing in both: 4532

Number passing in Base (23961f3) but now fail: 0

Number failing in Base (23961f3) but now pass: 30
30 test(s) were previously failing but now pass. Before merging, confirm they are intended to pass
The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

candidate.eval(actualArgs)
}
}
return missingValue()
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of returning missingValue, maybe we should consider throw a exception here for now. So we be consistent with our handling mechanism.

Copy link
Member Author

Choose a reason for hiding this comment

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

In this situation, we need to return missing:

All functions return MISSING when they input data whose types do not conform to the input argument
types.

-- PartiQL Spec, Section 7.1

So, if a function hasn't been resolved to any of the candidates, we need to return missing.

* @see ExprCallDynamic
*/
internal class Candidate @OptIn(PartiQLValueExperimental::class, PartiQLFunctionExperimental::class) constructor(
val types: Array<PartiQLValueType>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
val types: Array<PartiQLValueType>,
val parameters: Array<PartiQLValueType>,

@johnedquinn johnedquinn force-pushed the partiql-plugin-dynamic-dispatch branch from 9c8e335 to 7dd1063 Compare January 25, 2024 00:55
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (partiql-plugin-impl@23961f3). Click here to learn what that means.

Additional details and impacted files
@@                  Coverage Diff                   @@
##             partiql-plugin-impl    #1347   +/-   ##
======================================================
  Coverage                       ?   49.27%           
  Complexity                     ?     1046           
======================================================
  Files                          ?      166           
  Lines                          ?    13395           
  Branches                       ?     2504           
======================================================
  Hits                           ?     6600           
  Misses                         ?     6138           
  Partials                       ?      657           
Flag Coverage Δ
CLI 11.86% <0.00%> (?)
EXAMPLES 80.28% <0.00%> (?)
LANG 54.71% <0.00%> (?)

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.

@johnedquinn johnedquinn requested a review from yliuuuu January 25, 2024 16:42
Copy link
Contributor

@yliuuuu yliuuuu left a comment

Choose a reason for hiding this comment

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

LGTM

@johnedquinn johnedquinn merged commit 101c19b into partiql-plugin-impl Jan 25, 2024
10 checks passed
@johnedquinn johnedquinn deleted the partiql-plugin-dynamic-dispatch branch January 25, 2024 18:48
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