Skip to content

test(compliance): M7 tests the default NULL placement on the rank only - #775

Open
MrBlack1995 wants to merge 1 commit into
apache:mainfrom
MrBlack1995:test/portability-m7-review-notes
Open

MrBlack1995 wants to merge 1 commit into
apache:mainfrom
MrBlack1995:test/portability-m7-review-notes

Conversation

@MrBlack1995

@MrBlack1995 MrBlack1995 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the two review notes on #700, which merged before I got to them.

  • NULL placement. LAG and the running SUM ordered by order_date without NULLS FIRST or NULLS LAST, so they relied on the OSSIE_SQL_2026 default (feat(core-spec): default NULL placement in window ORDER BY #587) just like the rank, and losing the default showed on all three M7 elements. Both now write ORDER BY order_date NULLS LAST, like the spec's RANK() example, so only amount_rank relies on the default and the rung tests it on one element.
  • Name. prior_day_amount becomes prior_order_amount: LAG(amount) OVER (ORDER BY order_date) returns the previous order's amount, which can be from the same day.

Fixture and manifest only. The grader is unchanged.

Validation

  • validate.py passes on the fixture.
  • Grader tests: 57 passed.
  • Graded the fixture against three returns: unchanged (all M7 elements PORTABLE), NULLS LAST dropped from both (cosmetic, since it is the default), and flipped to NULLS FIRST (needs review). The rank stays PORTABLE in all three.

Related Issues

Follow-up to #700.

Review notes on apache#700:

- LAG and the running SUM write ORDER BY order_date NULLS LAST, so only the rank
  relies on the OSSIE_SQL_2026 default placement (apache#587) and losing the default
  shows on that one element.
- prior_day_amount becomes prior_order_amount: LAG returns the previous order's
  amount, which can be from the same day.

Co-authored-by: Isaac <no-reply@databricks.com>
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.

1 participant