Skip to content

[GLUTEN-13733][FLINK][VL] Translate the Flink Deduplicate operator to velox - #13735

Open
zhang-jianq wants to merge 1 commit into
apache:mainfrom
zhang-jianq:Deduplicate_Flink
Open

zhang-jianq wants to merge 1 commit into
apache:mainfrom
zhang-jianq:Deduplicate_Flink

Conversation

@zhang-jianq

@zhang-jianq zhang-jianq commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Fixes GLUTEN-13733 (companion bigo-sg/velox#106, bigo-sg/velox4j#84):

  • StreamExecDeduplicate translates keyed/global Deduplicate with rowtime/proc-time, keep-first/keep-last, and the Flink generateUpdateBefore / generateInsert changelog gating. Mini-batch with compact-changes is rejected fail-loud.
  • GlutenOneInputOperator persists native operator checkpoint records in ListState<byte[]> and passes them back on initializeState; it constructs KeyedStateBackendParameters from the subtask's runtime key-group range.
  • GlutenSourceFunction and GlutenStreamingFileWriterOperator use the same byte[][] checkpoint channel.
  • GlutenStatefulRecordSerializer writes raw Presto frame bytes with snapshot version 2; v1 Base64 snapshots fail loud.
  • gluten-flink/velox4j-ref.txt pins 360bbcacec7b1a8b9963a5193aefcc53f8e83270, the head of companion bigo-sg/velox4j#84; CI clones the matching velox4j branch until the dependent PRs merge.

How was this patch tested?

  • DeduplicateFunctionsTest: 9/9.
  • GlutenStatefulRecordSerializerTest: 5/5 (byte[] wire, old Base64 fail-loud, v1/v2 snapshot compatibility).
  • GlutenStreamingFileWriterOperatorTest: 2/2 on the byte[][] channel.
  • E2E dual-run vs native Flink 1.19.2 with fixed filesystem inputs and print sink: 8/8 jobs FINISHED; 8/8 normalized changelog match; 4/8 exact. The four strict mismatches are only the print sink's TIMESTAMP(3) .000 suffix; after removing the suffix the final result sets are identical.
  • The E2E scenarios cover keyed/global × rowtime/proc-time × keep-first/keep-last.

… velox

Translate Flink Deduplicate to the velox stateful backend:

- StreamExecDeduplicate: keyed/global, rowtime/proc-time, keep-first/keep-last, generateUpdateBefore / generateInsert gating, and fail-loud rejection of mini-batch compact-changes.
- GlutenOneInputOperator persists native operator checkpoint records in ListState<byte[]> and passes them back on initializeState; it constructs KeyedStateBackendParameters with the subtask's key-group range so native state ownership matches the key-group shuffle.
- GlutenSourceFunction / GlutenStreamingFileWriterOperator use the same byte[][] checkpoint channel.
- GlutenStatefulRecordSerializer writes raw Presto frame bytes with snapshot version 2; v1 Base64 snapshots are rejected fail-loud.
- Pin gluten-flink/velox4j-ref.txt at the companion velox4j dedup commit; CI clones the matching velox4j branch until the change lands upstream.

Tests: GlutenStatefulRecordSerializerTest 5 cases, GlutenStreamingFileWriterOperatorTest 2 cases, DeduplicateFunctionsTest 9 cases; e2e dual-run vs native Flink 8/8 jobs FINISHED, 8/8 normalized changelog match (4/8 exact; the remaining four differ only by the print sink's TIMESTAMP(3) `.000` suffix).

Signed-off-by: zhangjianqiu <1726110962@qq.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FLINK][VL] Support the Flink Deduplicate operator on the velox stateful backen

1 participant