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

Enable Eval Test Suites #1340

Merged
merged 10 commits into from
Jan 25, 2024
Merged

Enable Eval Test Suites #1340

merged 10 commits into from
Jan 25, 2024

Conversation

yliuuuu
Copy link
Contributor

@yliuuuu yliuuuu commented Jan 17, 2024

Relevant Issues

  • [Closes/Related To] N/A

Description

  • Set up the conformance base line for Eval Engine.
  • The modeling are not finalized, many pieces are now hardcoded for the purpose of running the conformance test. Apis are subject to change.

Other Information

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

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

    • N/A Not released.
  • 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

github-actions bot commented Jan 17, 2024

Conformance comparison report-Cross Engine

Base (legacy) eval +/-
% Passing 92.54% 21.59% -70.95%
✅ Passing 5384 1256 -4128
❌ Failing 434 4562 4128
🔶 Ignored 0 0 0
Total Tests 5818 5818 0
Number passing in both: 1249

Number failing in both: 427

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

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

Click here to see
  • null comparison{sql:"MISSING = NULL",result:missing::null}, compileOption: LEGACY

  • null comparison{sql:"NULL = MISSING",result:missing::null}, compileOption: LEGACY

  • null comparison{sql:"null.null = MISSING",result:missing::null}, compileOption: LEGACY

  • nullif valid cases{first:"missing",second:"missing",result:missing}, compileOption: PERMISSIVE

  • nullif valid cases{first:"missing",second:"missing",result:missing}, compileOption: LEGACY

  • equality of scalar missing, compileOption: LEGACY

  • missing and true, compileOption: PERMISSIVE

Conformance comparison report-Cross Commit-LEGACY

Base (57496a9) f48fd6c +/-
% 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 (57496a9) but now fail: 0

Number failing in Base (57496a9) but now pass: 0

Conformance comparison report-Cross Commit-EVAL

Base (57496a9) f48fd6c +/-
% Passing 3.01% 21.59% 18.58%
✅ Passing 175 1256 1081
❌ Failing 5644 4562 -1082
🔶 Ignored 0 0 0
Total Tests 5819 5818 -1
Number passing in both: 169

Number failing in both: 4556

Number passing in Base (57496a9) but now fail: 6

Number failing in Base (57496a9) but now pass: 1088
⁉️ CONFORMANCE REPORT REGRESSION DETECTED ⁉️. The following test(s) were previously passing but now fail:

Click here to see
  • equiv attribute value pair unpivot non-missing, compileOption: LEGACY
  • offset -1, compileOption: PERMISSIVE
  • offset -1, compileOption: LEGACY
  • offset 1-2, compileOption: LEGACY
  • offset , compileOption: LEGACY
  • offset >, compileOption: LEGACY
1088 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.

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@                  Coverage Diff                   @@
##             partiql-plugin-impl    #1340   +/-   ##
======================================================
  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.

Comment on lines 364 to 366
if (rootType is AnyType) {
val match = ResolvedVar.Local(StaticType.ANY, ordinal, rootType, listOf(pathPrefix) + path.steps)
matches.add(match)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To temporarily unblock the path access on any type. This behavior is probably incorrect.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting. I'm not sure we can resolve a variable if the type is ANY/UNKNOWN. I feel this should just be a path expression on the root

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need a refactor on PartiQLValueType before doing this.

Consider:

tbl : <<{'a' : 1, 'b': 2}>>

We now infer the tbl having PartiQLValueType of Bag, which is then converted to StaticType BAG(ANY).

So if we do SELECT tbl.a FROM tbl. Without this, the inferencer would fail.

Copy link
Member

Choose a reason for hiding this comment

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

I think this would break the defeasible reasoning paper (PartiQL Variable Resolution) written by @RCHowell .

If R is NOT known and S is KNOWN, then we must choose S. In this scenario, we wouldn't choose either due to ambiguity. I believe the recently merged PR #1344 solves this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pick the #1344. Removed the temporary work around.

@@ -19,7 +22,7 @@ import org.partiql.plan.PartiQLPlan
*/
public interface PartiQLEngine {

public fun prepare(plan: PartiQLPlan): PartiQLStatement<*>
public fun prepare(plan: PartiQLPlan, session: Session): PartiQLStatement<*>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

making this more akin to the Planner APIs.

@yliuuuu yliuuuu marked this pull request as ready for review January 17, 2024 19:59
@yliuuuu yliuuuu requested a review from RCHowell January 17, 2024 19:59
Comment on lines 38 to 41
public class Session @OptIn(PartiQLFunctionExperimental::class) constructor(
var bindings: MutableMap<String, ConnectorBindings> = mutableMapOf(),
val functions: MutableMap<String, List<PartiQLFunction>> = mutableMapOf()
)
Copy link
Member

Choose a reason for hiding this comment

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

At some point we'll need session variables passed during statement execution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a to-do note. Maybe we can do this after the work on Sql plugin is completed.

Comment on lines 364 to 366
if (rootType is AnyType) {
val match = ResolvedVar.Local(StaticType.ANY, ordinal, rootType, listOf(pathPrefix) + path.steps)
matches.add(match)
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. I'm not sure we can resolve a variable if the type is ANY/UNKNOWN. I feel this should just be a path expression on the root

@yliuuuu yliuuuu requested a review from RCHowell January 24, 2024 01:00
@yliuuuu yliuuuu merged commit 23961f3 into partiql-plugin-impl Jan 25, 2024
10 checks passed
@yliuuuu yliuuuu deleted the partiql-plugin-eval branch January 25, 2024 00:43
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.

4 participants