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

Fixes aggregations of attribute references to values of union types #1383

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

johnedquinn
Copy link
Member

@johnedquinn johnedquinn commented Mar 6, 2024

Relevant Issues

  • None

Description

  • Fixes aggregations of attribute references to values of union types
  • Before, in TypeEnv, we would assert, when looking up an attribute on a value, that the value were a StructType -- even though it could be a union of StructTypes. Or a union of other types. This PR handles this scenario.
  • This PR does NOT handle heterogeneous data for aggregation functions. See the new, disabled test in PlanTyperTestsPorted.
  • For the purposes of better error reporting, modified the definition of UndefinedVariable. See the CHANGELOG.

Open Questions (Not addressed in this PR)

  • What should AVG return? I've pasted a snippet from SQL:1999 which shows that we are conformant, however, I'm not sold.

Other Information

  • Updated Unreleased Section in CHANGELOG: YES
  • Any backward-incompatible changes? YES
    • Yes, but not API incompatible changes. See the CHANGELOG.
  • 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 Mar 6, 2024

Conformance comparison report

Base (92cc57a) 161fca0 +/-
% 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 (92cc57a) but now fail: 0

Number failing in Base (92cc57a) but now pass: 0

@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.14%. Comparing base (92cc57a) to head (d767d08).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1383   +/-   ##
=========================================
  Coverage     73.14%   73.14%           
  Complexity     2393     2393           
=========================================
  Files           247      247           
  Lines         17623    17623           
  Branches       3176     3176           
=========================================
  Hits          12890    12890           
  Misses         3856     3856           
  Partials        877      877           
Flag Coverage Δ
CLI 11.82% <ø> (ø)
EXAMPLES 80.07% <ø> (ø)
LANG 81.04% <ø> (ø)

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 force-pushed the fix-count-agg branch 4 times, most recently from 6cac376 to 91443cd Compare March 21, 2024 19:04
@johnedquinn johnedquinn marked this pull request as ready for review March 21, 2024 19:07
override fun visitRelOpAggregateCall(node: Rel.Op.Aggregate.Call, ctx: ProblemCallback): org.partiql.plan.Rel.Op.Aggregate.Call {
val agg = when (val agg = node.agg) {
is Agg.Unresolved -> {
val name = agg.identifier.toNormalizedString()
Copy link
Member

Choose a reason for hiding this comment

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

For error messaging, perhaps we leave the casing "as-is"

@johnedquinn johnedquinn merged commit db1c85b into main Apr 2, 2024
10 checks passed
@johnedquinn johnedquinn deleted the fix-count-agg branch April 2, 2024 20:37
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