Skip to content

[SPARK-55702][SQL][FOLLOWUP] Clean up dead error code and fix flaky window filter test#54557

Closed
cloud-fan wants to merge 1 commit intoapache:masterfrom
cloud-fan:follow
Closed

[SPARK-55702][SQL][FOLLOWUP] Clean up dead error code and fix flaky window filter test#54557
cloud-fan wants to merge 1 commit intoapache:masterfrom
cloud-fan:follow

Conversation

@cloud-fan
Copy link
Contributor

@cloud-fan cloud-fan commented Feb 28, 2026

What changes were proposed in this pull request?

Follow-up to #54501. Two cleanups:

  1. Remove dead error code: The windowAggregateFunctionWithFilterNotSupportedError method in QueryCompilationErrors.scala and its _LEGACY_ERROR_TEMP_1030 error class in error-conditions.json were left behind after [SPARK-55702][SQL] Support filter predicate in window aggregate functions #54501 removed their only call site.

  2. Fix flaky first_value/last_value test: The window filter test used ORDER BY val_long with a ROWS frame, but val_long has duplicate values in the test data (e.g., three rows with val_long=1), making first_value/last_value results non-deterministic. Added val and cate as tiebreaker columns and used NULLS LAST so the output is both stable and meaningful (without NULLS LAST, the first matching 'a' row has val=NULL, making first_a always NULL).

Why are the changes needed?

  1. Dead code should be cleaned up.
  2. Non-deterministic tests can cause spurious failures.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Re-ran SQLQueryTestSuite for window.sql — all 4 tests pass across all config dimensions.

Was this patch authored or co-authored using generative AI tooling?

Yes. cursor

…indow filter test

Follow-up to apache#54501.

1. Remove the now-unused `windowAggregateFunctionWithFilterNotSupportedError`
   method and its `_LEGACY_ERROR_TEMP_1030` error class, which were left
   behind after the filter-in-window support was added.

2. Fix the `first_value`/`last_value` window filter test that used
   `ORDER BY val_long` — a column with duplicate values — making the
   ROWS-frame result non-deterministic. Add tiebreaker columns and
   use NULLS LAST so the output is both stable and meaningful.
@cloud-fan
Copy link
Contributor Author

@peter-toth @viirya

@yaooqinn yaooqinn closed this in 959cc95 Feb 28, 2026
@yaooqinn
Copy link
Member

Merged to master, thank you @cloud-fan and all

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.

5 participants