Skip to content

Bind MaxCompute Arrow schemas outside the batch loop

The MaxCompute SDK and StreamFusion use separate Arrow Java namespaces. The source resolves the requested columns to SDK vector ordinals and validates the wire layout on the first batch of each distinct schema. The sink resolves output ordinals and its wire layout once per writer session. Subsequent batches reuse those bindings and retain the corresponding value, offset and validity buffers. A change in wire schema triggers a new bind before the source borrows buffers.

A JDK 17 Flight Recorder diagnostic used a 32,768-row emulator fixture with a projected BIGINT, STRING calculation and an append-only Storage API sink. Before caching, 18 allocation samples and three CPU samples in source fetches passed through Arrow schema JSON. After caching, one allocation sample passed through JSON at schema bind and no source fetch CPU samples did. The writer profile placed schema work in writer initialization. These sample counts describe allocation and CPU stacks in the diagnostic run.

Release-mode read and write profile

Five timed trials per route used the same 32,768 rows, one Flink subtask, and two warmup trials per route. The query projected two of three source columns, added one to the ID and wrote an append-only table. Each trial used a fresh target and checked the resulting row count. The measurements include SQL submission, the local Flink job, and service I/O. The host was an Apple M4 with JDK 17 and a release-mode Rust library. Docker ran the pinned Linux AMD64 emulator locally.

Route Median Trial range
Stock Flink 4.005 s 3.839–4.226 s
StreamFusion calculation with stock ODPS perimeters 4.042 s 3.962–4.343 s
StreamFusion with Arrow ODPS perimeters 3.987 s 3.920–4.291 s

The ranges overlap. This fixture did not establish an end-to-end speedup.

Separate Flight Recorder trials recorded 43 allocation samples and two CPU samples on StreamFusion's row/Arrow transpose stacks with stock perimeters. The native perimeter run recorded no samples on those stacks or the stock Arrow row writer. Native source and sink write frames appeared in 11 and 13 allocation samples respectively. Arrow schema JSON appeared in none of the three release profiles. The timings excluded these profiling trials.

Run the benchmark locally using a fresh loopback emulator from the connector's verification setup.

mvn -Pflink-1.18,odps,bench,benchmarks -pl streamfusion-odps -am test \
  -Dtest=OdpsReadWriteBenchmark -Dsurefire.failIfNoSpecifiedTests=false \
  -Demulator.endpoint=http://127.0.0.1:8080

Full-row readback for the projected append profile

On Flink 1.18.1 and JDK 17, the release profile used 8,192 rows, one subtask, two warmups and three measured trials per route. Each trial checked every output ID and its UTF-8 value through a separate Tunnel read outside the timer. The native SQL plan retained Arrow from the projected read through calculation and the Storage append.

Route Median Trial range
Stock Flink 1.256 s 1.255–1.299 s
StreamFusion calculation with stock MaxCompute perimeters 1.319 s 1.260–1.341 s
StreamFusion with Arrow MaxCompute perimeters 1.286 s 1.268–1.290 s

The trial ranges overlap. In separate profiling trials, JFR sampled 42 allocations and two CPU samples on transpose stacks with stock perimeters. The Arrow perimeter profile had 18 allocation samples on source stacks and seven on writer stacks, with zero transpose samples.

Default coordinated Tunnel append

Set -Dodps.benchmark.tunnel=true to run the same projected append with the coordinated Tunnel sink and leave the Arrow writer option unset. In the Flink 1.18.1 release build, one warmup and three measured trials per route uploaded 8,192 rows and checked every ID and string by Tunnel readback.

Route Median Trial range
Stock Flink 1.325 s 1.319–1.326 s
StreamFusion calculation with stock MaxCompute perimeters 1.310 s 1.292–1.332 s
StreamFusion with Arrow MaxCompute perimeters 1.293 s 1.291–1.312 s

Separate recordings sampled 65 allocations and three CPU stacks on the transpose path when only the calculation was native. The native-perimeter recording sampled 11 allocations on reader stacks, six on Arrow writer stacks, and zero on transpose stacks. The measured trials include job startup and emulator I/O.

Bounded source planning

A Flink 1.18.1 release-build comparison explained the same projected, filtered batch query against a three-column MaxCompute table. Each route had 20 measured plans, including ten in a separate JDK 17 recording. Every plan used the native source. Catalog requests per plan dropped from four to three. The unprofiled medians were 34.3 ms and 32.8 ms, with overlapping ranges. JFR sampled nine allocations on the stock scan-provider stack during boundary translation before the change and none afterward. This measurement covers planning only.

Compressed upstream reads

The emulator's upstream SQL matrix exercises uncompressed, ZSTD, and LZ4 frame Arrow reads. The graph verifier checks the scan in the INSERT job for all 15 matrix cases. A 22-second JDK 17 recording during the matrix sampled 38 allocations and one CPU sample on native reader stacks. A separate 25-second recording during the writer-mode cases sampled 66 native reader allocations and 12 Tunnel Arrow writer allocations. These recordings include Flink startup and the released record writer cases in the upstream matrix.

File-cached Tunnel profile

A separate Flight Recorder trial per route used the same query with coordinated file caching. With stock perimeters, 36 allocation samples crossed the Arrow-to-row bridge and 50 crossed the row-to-Arrow bridge. Neither bridge appeared with native ODPS perimeters. The native cache's Arrow IPC serializer appeared in three allocation samples and one CPU sample. Flink's row cache serializer appeared in one allocation sample with stock perimeters and two in stock Flink. The run checked the output row count and the native file-cache plan. The upstream suite was running concurrently, so this probe provides stack evidence only. A standalone JVM check also found two idle partition-creation workers left after a grouped file-cache job. The Arrow adapter now closes those workers on teardown. The same test completed and its JVM exited after the change.

To reproduce the profiling trials, add these flags to the benchmark command and point the paths to writable scratch directories.

-Dodps.benchmark.samples=0 -Dodps.benchmark.warmups=0 \
  -Dodps.benchmark.profiles=/tmp/odps-profiles \
  -Dodps.benchmark.file-cache=/tmp/odps-cache

Tunnel partition routing

The Tunnel router compares adjacent partition keys directly in Arrow's validity, offset and value buffers. It builds a partition string once per equal-key run. A batch with one run forwards its original buffers without allocating the route array or calling Rust to gather.

A JDK 17 Flight Recorder probe exercised 1,500 batches of 1,024 rows with a repeated UTF-8 partition key after 250 warmup batches. The original router recorded 1,123 allocation samples and 28 CPU samples on grouping stacks. With the direct comparison it recorded two allocation samples and three CPU samples. Both versions verified the same partition and original vectors for every batch. This probe isolated grouping from Flink and service I/O.

For batches that start with a short partition run, the Tunnel router also remembers up to eight representative Arrow positions. A repeated key reuses its destination ID without decoding a string. The router resolves unfamiliar values through the partition spec, which still merges aliased destinations. The ninth distinct key activates a bounded hash table for up to 64 Arrow positions. A hash match still checks the original keys in the vectors. Eight consecutive runs that cannot be cached return the rest of the batch to direct partition-spec resolution.

A JDK 17 release diagnostic compared 240 prebuilt batches of 4,096 rows per trial, with three warmups and seven measured trials per workload. It checked each partition and every routed ID before timing, then consumed the same per-destination checksum on each trial. Times cover routing and batch teardown.

Tunnel partition workload Previous median (range) With reused keys (range)
Four interleaved UTF-8 destinations 117.386 ms (115.183–122.482) 47.641 ms (46.368–51.083)
64 destinations in consecutive runs 13.132 ms (13.028–15.184) 13.440 ms (13.192–17.105)

JFR recorded 434 allocation samples inside partition-spec construction before the change and 29 afterward. The 64-destination control ranges overlap.

Run the diagnostic with -Dtest=OdpsArrowRouteBenchmark#measureTunnelPartitionKeys and the release benchmark settings below.

The bounded hash lookup was compared with the previous router in four release build JVM forks, ordered previous, current, current, previous. Each fork used three warmups and seven measured trials per workload. Each fork checked every routed ID against its target partition before timing. Each measured trial routed 240 batches of 4,096 Arrow rows and checked the destination checksum. The JVM thread counter measures allocated heap bytes during routing and batch teardown.

Workload Previous median (range) Current median (range) Previous / current median heap allocation
Four interleaved partitions 47.2 ms (45.8–48.5) 47.9 ms (47.5–48.9) 17.63 / 17.62 MiB
64 interleaved partitions 184.5 ms (174.9–192.9) 100.9 ms (99.9–107.5) 503.85 / 179.15 MiB
64 partitions in consecutive runs 14.0 ms (13.8–14.3) 14.2 ms (14.0–15.2) 41.08 / 41.08 MiB

The accompanying Flink 1.18.1 SQL benchmark used one subtask and 8,192 rows striped across 16 dynamic Tunnel partitions. It projected three of four columns and verified every ID, string and partition through separate Tunnel readback. Each route had six timed jobs per revision. Whole-job medians were 1,705 ms and 1,688 ms for stock Flink, 1,710 ms and 1,707 ms for native calculation with stock MaxCompute operators, and 1,676 ms and 1,663 ms for native calculation with Arrow MaxCompute operators. The trial ranges overlap. The recordings from the two previous native runs sampled 12 allocations while building partition specs. The two current native recordings sampled zero on those stacks. Both native revisions recorded zero row/Arrow transpose samples. This measures a local emulator, including job startup and I/O.

Add -Dodps.benchmark.partitions=16 -Dodps.benchmark.rows=8192 to the read/write benchmark command to reproduce the partitioned SQL workload.

Contiguous destination slices

The Tunnel partition router and primary-key bucket router number destination groups in order of first occurrence. When those numbers never decrease, the router gives each destination a retained Arrow slice. The slice keeps the value buffers alive after the original batch closes. Shifted offsets or validity bits can require new buffers. Scattered destinations use the Rust gather and keep the same order of rows within each destination.

A JDK 17 release-build profile compared the two routing paths in the same JVM. Each trial routed 240 prebuilt batches of 4,096 rows across four destinations, with BIGINT IDs and nullable 308-byte UTF-8 values. Seven measured trials alternated path order after three warmup rounds. Both paths checked the full output outside timing and consumed the same per-destination checksum during each trial.

Routing path Median Range
Rust Arrow gather 164.740 ms 157.641–170.636 ms
Retained Arrow slices 1.112 ms 0.967–1.610 ms

JFR recorded 108 JVM allocation samples on the gather stack and 14 on the slice stack. These measurements cover routing and destination-batch teardown.

mvn -Pflink-1.18,odps,bench,benchmarks -pl streamfusion-odps -am test \
  -Dtest=OdpsArrowRouteBenchmark -Dodps.benchmark.routing=true \
  -Dsurefire.failIfNoSpecifiedTests=false

Batch partition grouping

The Storage append writer can send several partitions in a single Arrow batch. Tunnel append and full-row batch upsert route partitions directly from Arrow keys. For these paths, the planner can remove Flink's generated grouping sort even if compute lowering has already converted it to a blocking native sort. The sink's grouping flag distinguishes this request from ordering specified in the query. Explicit ordering, limits, offsets and exchanges remain.

A Flink 1.18.1 release build on JDK 17 read 16,384 rows, projected three of four columns, added one to the ID and wrote eight interleaved partitions through the coordinated Arrow Tunnel route. Every trial read back and checked each ID, string value and destination partition. Two warmups and three timed trials per route measured whole-job medians of 2,717 ms for stock Flink (2,709–2,734 ms), 2,738 ms for the prior adapter with the stock grouping sort between native MaxCompute operators (2,715–2,756 ms), and 2,685 ms for the native batch pipeline without the grouping sort (2,670–2,705 ms).

The prior adapter's separate JFR trial sampled 54 allocations and four CPU events on transpose stacks and five allocation and five CPU events on sort stacks. The new trial sampled four allocations and one CPU event on Arrow partition grouping, with no sort or transpose samples. This comparison includes local scheduling and emulator I/O.

The pinned emulator's dynamic Storage append case preserved all four rows across three partitions, including the default partition for a null key. The submitted graph went from one blocking native sort to zero. The catalog SQL fixture also checks the selected partition when an ordered limit determines which row is written.

A JDK 17 recording across 38 focused SQL invocations captured 94 allocation samples on native ODPS reader stacks, 43 on the Storage writer, 12 on the Tunnel Arrow writer and three on the shared upsert writer. SDK socket polling accounted for five of six native-method samples under the Storage writer. The recording includes planning, fixture startup, and the stock SQL cases.

Grouped primary-key upserts

A Flink 1.18.1 release build on JDK 17 read 8,192 interleaved rows, projected three of four columns, added one to the quantity and updated eight partitions with two writers. Every trial replaced a seeded key in each partition and verified every stored key and value. Both native variants kept the partition shuffle in Arrow.

After two warmups, three timed jobs per route gave medians of 15,863 ms for stock Flink's grouped Tunnel upsert (15,861–15,876 ms), 3,353 ms for the prior native Storage writer with the partition sort (3,338–3,397 ms), and 3,301 ms for native Storage without the sort (3,293–3,309 ms). The stock recording includes end-of-input waits and a 4.95-second park in the Tunnel commit coordinator. Both native variants use the same Storage writer.

Writer batch row limits

The append writers pass an input batch through as-is when its row count fits the configured Arrow limit. A larger input is written as consecutive slices. The buffer test verifies numeric and UTF-8 value addresses in the shaded SDK, the row order and nulls, and the alignment of primary-key operations after slicing. Arrow can rebuild offsets or validity bits for a slice whose first row changes.

A JDK 17 recording across 25 focused checks sampled 100 reader allocations, 25 on the real-time Storage writer, 36 on the Tunnel Arrow writer and eight on the cached writer. No sample on those writer stacks included the slice method. The run included startup, the delayed 10,032-row Tunnel upload and nested types.

Grouped Tunnel writes with typed partition keys

A Flink 1.18.1 release build on JDK 17 read 8,192 rows, projected away one column, added one to the ID, and appended through two Tunnel writers. The input alternated between BIGINT keys -4294967296 and 4294967296 to exercise the Rust Arrow gather. The emulator stored the partition names as strings and the test supplied BIGINT catalog metadata to the SDK. A separate readback verified each row's ID, text value and destination partition.

Two warmup trials and three timed trials per route gave whole-job medians of 1,555 ms for stock Flink (1,537–1,605 ms), 1,548 ms for native calculation with stock MaxCompute operators (1,536–1,558 ms), and 1,543 ms with both native MaxCompute operators (1,538–1,547 ms). The ranges overlap. The native plan kept Arrow through the partition shuffle. In a separate JFR trial, the native path recorded 34 allocation samples on the Arrow reader, six on the Tunnel writer and 18 on the shared Rust gather's Java call stack. The profile includes job startup and emulator I/O.

Partitioned real-time writes

When null or empty partition keys trigger a rewrite, the writer fills the new vector from one direct view of the source Arrow value buffer. It uses the same copy path for unchanged values when width clipping requires a rewrite. Values whose byte length exceeds the declared character width still go through the Unicode clipping check. Unchanged compatible columns retain their buffers.

A release-build Java diagnostic normalized 240 batches of 4,096 rows per trial. The input mixed null, empty, and 60-byte partition values. Each fork checked every row before timing and checked the output byte count in each trial. The previous and current revisions ran in alternating order with two forks per revision, three warmups and seven timed trials per fork.

Normalization measurement Previous median (range) Current median (range)
Elapsed time 14.9 ms (12.2–20.1) 11.4 ms (7.9–15.8)
JVM thread heap allocation 68.74 MiB (68.74–68.75) 0.62 MiB (0.62–0.63)

The corresponding Flink 1.18.1 SQL workload used 8,192 rows on the pinned emulator. Half the rows used null or empty partition values and the Storage writer routed them to the configured default. Each timed job was verified by separate Tunnel readback for every ID, value, and destination. Across six timed jobs per route and revision, median times were 1,523 ms and 1,524 ms for stock Flink, 1,527 ms and 1,543 ms for native calculation with stock MaxCompute operators, and 1,524 ms and 1,533 ms for native calculation with Arrow MaxCompute operators. The whole-job ranges overlapped. Separate recordings sampled one allocation during partition normalization before the change and zero afterward. Both native revisions recorded zero row/Arrow transpose samples.

Run the isolated case with -Dtest=OdpsArrowRouteBenchmark#measureStoragePartitionDefaults and the release routing benchmark settings above. Add -Dodps.benchmark.partition-defaults=true -Dodps.benchmark.partitions=2 -Dodps.benchmark.rows=8192 to the read/write benchmark settings to run the SQL workload.

A release-build Flink 1.18.1 and JDK 17 SQL job projected 8,192 rows and appended to two partitions through the emulator's real-time Storage API. The input mixed null, empty and populated partition keys. The configured default default-long resolved to defa under the four-character SQL type. A separate readback checked every ID, string value and destination.

After two warmups, three whole-job trials per route gave medians of 1,499 ms for stock Flink (1,491–1,509 ms), 1,507 ms for native calculation with stock connector operators (1,494–1,523 ms), and 1,487 ms for the native source and sink (1,481–1,497 ms). The ranges overlap. A separate JFR trial sampled five allocations and one CPU event on transpose stacks with stock perimeters. The native trial sampled three reader allocations, 28 writer allocations and zero transpose events. JFR sampled no allocation in partition normalization in that trial.

A release-build Flink 1.18.1 SQL pipeline read 8,192 rows from the emulator and sent them to two Storage writers. The receiver decoded the SDK's compressed Arrow IPC and verified every key, value, partition and operation. The native submission kept Arrow batches through partition and bucket routing and into the writer. The previous mixed plan converted the native scan to rows before the stock writer.

After one warmup and three alternating trials per route, whole-job medians were 408 ms for stock Flink (404–427 ms), 416 ms for the Arrow source with the stock writer (393–428 ms), and 412 ms for the native source and sink (408–417 ms). The native JFR trial sampled the Storage writer and no row conversion operators. The local receiver acknowledged the writes. Persisted mutations and service throughput require live tests.

Checkpointed upsert profile

Two small JDK 17 Flight Recorder runs exercised checkpointed Arrow upserts against the emulator, including grouped partitions, a Flink DELETE and a lost commit response. The staged sink stacks contained three to six SDK Arrow writer allocation samples and zero samples in the row writer or StreamFusion's row/Arrow conversion. Both SQL plans assert the native source and sink and check for the absence of conversion operators.

SDK client initialization accounted for most sampled allocations on the checkpointed path. Partition writers and committers now open the client on their first nonempty batch or commit. This avoids client setup on idle subtasks. The short correctness runs provide stack evidence.

A separate JDK 17 recording covered three stock and native upsert comparisons with omitted nullable warehouse columns. It sampled 15 allocations on Arrow reader stacks and three CPU stacks in the staged Arrow writer. The native job graphs had no transpose operators, and the recording sampled no runtime transpose. Before deferring fallback setup, the batch planner built the conversion schema before selecting the connector's Arrow reader.

Shared batch upsert profile

A JDK 17 Flight Recorder run covered the static and dynamic partition fixtures with two bucket writers, a blocking commit-manifest exchange and a lost commit response. The sink and coordinator stacks contained 17 allocation and two CPU samples. Nine allocation samples included the SDK Arrow writer. The runtime recorded no row/Arrow transpose stacks. The planner still resolved the stock scan's metadata while explaining the native source. This short correctness workload provides stack evidence.

A 25-second JDK 17 recording during the emulator adapter suite sampled 28 allocations on native reader stacks, 57 on append writer stacks and 204 on staged upsert writer stacks. The bucket shuffle capture included two allocation samples for the temporary logical-type enum array used to identify string keys. Direct type comparisons remove that allocation from each non-null scalar key check. Routing parity checks use the released partition and bucket selector.

Fixed-partition bucket routing

For a fixed partition, the router caches the released selector's destination for each bucket on the first batch. It stores one integer per bucket. Dynamic partition routing keeps its checkpoint-aware assignment protocol.

A warmed JDK 17 allocation diagnostic routed 4,194,304 BIGINT keys per trial in 65,536-row Arrow batches across 257 buckets and seven writers. In three trials per version, median routing-thread allocations fell from 251,712,512 to 117,456,896 bytes, or about 60 to 28 bytes per key. The destination checksum matched in every trial. JFR sampled 92 object arrays and three partition/bucket keys on the original routing stack. The lookup capture sampled neither. The separate emulator capture sampled 15 native read and 21 native write allocations across five primary-key SQL cases.

Dynamic-partition bucket routing

The primary-key router compares adjacent dynamic partition values directly in Arrow and builds the partition name once per run of equal values. It compares only periodically after eight consecutive changes and resumes adjacent comparisons when a probe finds a repeated value. Bucket hashing, assignment, and checkpoint statistics still run for every row.

A warmed JDK 17 diagnostic alternated the previous and current router in separate JVMs. Each of six trials per router processed 1,048,576 keys in 4,096-row batches across 257 buckets and seven writers. With 512 consecutive rows per partition, median allocated bytes per key fell from 418 to 37 and median routing time fell from 139.6 to 66.1 ms. With alternating partitions, allocated bytes stayed at 418 per key and median routing time was 146.2 ms before and 150.1 ms after. Both input layouts produced identical destination checksums. The diagnostic exercises the router in isolation.

Shared streaming upsert profile

A short JDK 17 Flight Recorder run covered two-bucket writes, periodic checkpoints, and a writer restart after earlier commits had published rows. The shared path appeared in 323 allocation and nine CPU samples. SDK Arrow writing appeared in 132 allocation samples, and reservation of the next checkpoint session appeared in 86. No writer or coordinator stack included a row/Arrow transpose. The periodic-input fixture maps a Flink sequence to rows before the ODPS sink. These counts describe sampled stacks in a correctness run.

Dynamic partition session profile

A JDK 17 Flight Recorder run covered the static and dynamic checkpoint fixtures, including a delayed Storage session reply and a writer restart. The source reader appeared in seven allocation samples and one CPU sample. The staged Arrow writer appeared in 332 allocation samples and eight CPU samples across both paths. Six allocation samples and thirteen thread parks included the writer's session RPC. The session RPC only runs when the writer opens a partition stream. Neither the native source nor the shared sink stacks included a row/Arrow transpose. The two paced recovery inputs use a Flink row source before the Arrow sink. The profile includes fault-injection delays and measures sampled stacks during correctness tests.

A separate release-build comparison used 32,768 rows across four dynamic partitions, two Flink subtasks, and aligned checkpoints every 700 ms. The query read two data columns and one partition column from ODPS, added one to the ID, and upserted into a primary-key table. Each trial used a fresh target and checked 8,192 rows in each partition. The same job ran with stock Flink, the previous StreamFusion planner with the stock ODPS sink, and native Arrow throughout. The trials alternated route order after one warmup per route. They include SQL submission and service I/O on an Apple M4, JDK 17, and the pinned Linux AMD64 emulator.

Route Median Trial range
Stock Flink 30.285 s 29.927–30.526 s
Previous StreamFusion planner 30.242 s 29.894–31.061 s
Shared Arrow Storage sessions 11.264 s 11.236–11.270 s

The separate profiles recorded 16 Tunnel session-close monitor waits in each baseline. In the previous StreamFusion plan, 19 allocation and two CPU samples included a row/Arrow transpose. The native profile recorded 61 source and 22 staged Arrow writer allocation samples. No row/Arrow transpose appeared in those stacks. The writer parked twice on the session RPC. These are sampled stacks from the emulator, where the baseline waits include the legacy SDK's session shutdown.

Unaligned checkpoint profile

A release-build run used 16,384 rows across four dynamic partitions, two Flink subtasks and a 700 ms checkpoint interval. The same projected ODPS query added one to each key and upserted into a fresh target. It verified 4,096 rows in each partition after every completed job. Three measured trials alternated route order after one warmup per route. The timings include SQL submission and service I/O on an Apple M4, JDK 17 and the pinned Linux AMD64 emulator.

Route Median Trial range
Stock Flink, aligned 24.614 s 24.480–24.765 s
StreamFusion Arrow, aligned 5.849 s 5.832–5.903 s
StreamFusion Arrow, unaligned 5.873 s 5.860–5.890 s

The released connector aborted the forced-unaligned stock trials at its first checkpoint. The previous StreamFusion route, using the native source and that connector's sink, also failed its bounded release check. The aligned native and unaligned native timing ranges overlap.

A separate recording in a fresh JVM for the unaligned Arrow job found 52 source allocation samples, 31 staged Arrow writer samples, 10 Arrow IPC exchange samples, and four Flink channel-state samples. No row/Arrow transposes appeared in the recording or the submitted job graph.

File-cached primary-key upsert

The checkpointed Storage writer uses one Arrow IPC stream per active spill file. It writes the schema once and streams record batches directly to the file by default. When it drains a file, it transfers the Arrow reader's buffers to the existing partition writer. The Storage SDK performs its usual wire encoding. A synchronous retry preserves that encoded batch buffer and its stream offset.

A release-build comparison used 16,384 rows across four dynamic partitions, two Flink subtasks, 700 ms aligned checkpoints and a 32 KiB roll size. Each trial read a projected ODPS table, added one to the key, upserted into a fresh target, checked 4,096 rows in each partition and verified cache cleanup. Three measured trials alternated after one warmup per route. The timings include SQL submission and service I/O on an Apple M4, JDK 17 and the pinned Linux AMD64 emulator.

Route Median Trial range
Stock Flink file cache 17.037 s 17.024–17.076 s
Previous StreamFusion with the stock sink 17.380 s 16.996–18.089 s
StreamFusion Arrow file cache 5.865 s 5.859–5.878 s
StreamFusion Arrow with the file cache disabled 5.827 s 5.808–5.868 s

The two Arrow routes had overlapping timing ranges. The native file-cache median was 38 ms above the uncached median for this fixture.

An isolated Flight Recorder run wrote and read 460,032 bytes across 12 Arrow spill files. The read and write byte totals matched. The recording contained 62 source allocation samples, 12 spill allocation samples and eight spill CPU samples. The submitted native plan and the recording showed zero row/Arrow transposes.

Coordinated writer validation

A short JDK 17 recording covered projected ODPS reads, append writes, and checkpointed primary-key writes. It recorded 57 allocation samples on the source fetch stack, mostly while opening SDK splits, four on the real-time Storage writer stack and 19 on the staged Storage writer stack. It sampled no row/Arrow conversion or Arrow schema JSON. The Arrow sink now applies the released connector's schema and partition-grouping checks during SQL planning.

A separate 10,032-row coordinated Tunnel fixture delayed session creation and verified every written value. Its recording contained 51 source allocation samples and seven Tunnel writer allocation samples. Two CPU samples reached the writer, including one when it bound the Arrow schema. No row/Arrow conversion appeared. The emulator delay was part of the fixture.

Dynamic partition limits

A short JDK 17 recording covered the same dynamic partition limit in stock SQL, native single-writer SQL, and native shared batch and streaming SQL. The successful grouped and ungrouped cases also exercised session reuse. The recording captured six allocation samples on the Arrow fetch stack, 78 on the staged Arrow writer, and 35 while opening shared sessions. Neither a transpose nor the limit check appeared in these sampled stacks. The limit is checked when a new session opens, using the number of active sessions already tracked by the writer or coordinator.

Coordinated upsert option compatibility

An 8,192-row JDK 17 fixture ran the same projected upsert with the five INSERT and DataStream options accepted by SQL. It checked every output value in stock Flink and StreamFusion, with and without file caching. Both native plans had no row/Arrow exchange. The recording captured 60 allocation samples on the Arrow reader stack and one CPU sample on the staged writer. It contained no row/Arrow transpose samples. This was a stack diagnostic.

At-least-once shared upserts

A JDK 17 recording used projected MaxCompute SQL input, two bucket writers, and 1,024 rows per selected partition. The allocation samples included 39 on the Arrow reader, 29 on the bucket router and 59 on the staged writer. No sample contained a row/Arrow transpose. The submitted SQL plans had no conversion operators. The concurrency recovery fixture separately used a paced Flink DataStream input, which is converted at the input edge.

Bounded row limits

A loopback wire probe ran SELECT id FROM src LIMIT 64 on 16,384 rows, with two row-offset splits and the payload column excluded by projection. The released stock Flink connector requested 8,192 rows per split. StreamFusion requested 64 per split. The two Storage read response bodies totaled 131,920 bytes in stock Flink and 1,584 bytes in StreamFusion. Both jobs returned 64 distinct IDs from the input. The proxy buffered responses for inspection, so these figures measure response bodies and carry no throughput claim.

A JDK 17 recording captured 43 allocation samples on the native Arrow reader stack and no read-side row iteration. Collecting the final SQL result used Flink rows at the output boundary. The checkpoint probe also captured a three-row limit restoring after one row, with a two-row SDK request at offset one.

Bounded bucket snapshots

A release build on Flink 1.18.1 and JDK 17 read 16,384 projected rows across two SDK bucket splits and wrote the calculated values to an emulator append table. The read endpoint was a loopback fixture that returned Arrow IPC at the split indices requested by the released SDK. Stock and native runs both verified every output value and bucket ID. The native job used the Arrow source, calculation and append sink without a row conversion.

After two warmups, five alternating trials per route had whole-job medians of 1,872 ms for stock Flink (1,849–1,932 ms), 1,861 ms for the stock source with the native sink (1,845–1,862 ms), and 1,863 ms with both native operators (1,845–1,977 ms). The previous route with a stock source and native sink had seven allocation samples in the row-to-Arrow operator. The fully native plan removed that operator and its JFR trial contained zero conversion samples. A native repeat sampled HTTP setup, Arrow schema binding, and the SDK's Arrow IPC upload buffer. These measurements describe the local SQL pipeline and append emulator. Physical bucket planning and service throughput need live qualification.

Continuous version discovery

A release build on Flink 1.18.1 and JDK 17 processed 8,192 ordered CDC events across two version windows and verified the key, value and row kind of every event. A loopback fixture supplied the version number and Storage CDC payload. The released connector ran its SQL version lookups, split assignment and Arrow readers. Each route ran one warmup, three alternating timed trials and a separate JFR trial. Medians from SQL submission through collection of the last event were 617 ms for stock Flink (610–630 ms), 633 ms with the stock source and native planner (620–645 ms), and 629 ms with the native source (622–652 ms).

The previous route had 32 allocation samples in row-to-Arrow conversion. The native source fed the calculation directly in Arrow and had zero row-to-Arrow samples. JFR sampled conversions at the Flink SQL collection boundary. The run describes local pipeline behavior. Live MaxCompute CDC and service throughput require separate qualification.

Latest-partition handoff

A release-build Flink 1.18.1 SQL job verified 4,096 projected records from each of two published partitions. The emulator supplied the catalog and a loopback endpoint supplied the Storage cutoff and CDC payload. Stock Flink, StreamFusion with the stock source, and StreamFusion with the Arrow source each waited about 29.8 seconds from publication to the first read of the new partition under the connector's 30-second discovery interval. The profile ran once per route and describes the local handoff.

The prior stock-source route had 34 row-to-Arrow allocation samples before native calculation. The Arrow source had zero. Both native-calculation routes used row conversion at the SQL collection boundary. Production partition discovery and service throughput remain separate measurements.

Bounded change windows

A release build on Flink 1.18.1 and JDK 17 projected 8,192 ordered CDC records from one fixed version window. The loopback Storage endpoint supplied the Arrow payload. Each route verified every projected value and the insert row kind assigned by Flink batch projection. After one warmup and three alternating timed trials per route, medians from SQL submission through result collection were 507 ms for stock Flink (506–510 ms), 508 ms with the stock source and native planner (505–509 ms), and 519 ms with the native source (508–531 ms).

The stock source with native calculation had 27 row-to-Arrow allocation samples. The native source and calculation had zero. Arrow-to-row samples were at the SQL collection boundary. This measures the local query and does not establish live MaxCompute throughput.

Source disk spill

Projected SQL reads with the SDK spill memory capacity set to zero produce the same append results in stock and native Flink. The native plan keeps Arrow through the calculation and into the Storage sink. A split-reader fixture keeps the first spilled batch alive through the Rust C Data round trip while draining either a 64-row split or a seven-row local limit. Both cases preserve the value buffer address, row order, final offset, and spill cleanup.

A six-second JDK 17 diagnostic across 13 focused tests captured four SDK Arrow IPC files. The SDK wrote 6,880 bytes and read 4,296 bytes. The limited split can leave part of its prefetched spool unread. The recording sampled 33 allocations on the native reader stack, 24 on the Storage writer stack, and two on the Tunnel writer stack.

Reader shutdown and partition switches

The Flink 1.18.1 reader stops the fetcher on close. The adapter tracks the Arrow batches still owned by that reader in one bounded deque. It releases those batches at teardown and transfers ownership to Flink as each batch is emitted. The spill regressions test both cancellation before the first output and cancellation with a retained downstream batch. A latest-partition switch regression drives the SDK snapshot reader with epoch events and holds the old availability future while the delegate is replaced.

The 10-second JDK 17 diagnostic across 22 focused source, buffer and SQL cases sampled 35 allocations on the native reader stack and 52 on the native writer stack. The tracking deque operates once per batch and the recording captured no monitor waits in its handoff operations.

The Flink 1.18.1 continuous recovery test also recorded the projected Arrow reader before and after a task failure. JDK 17 Flight Recorder sampled 55 allocations on the Arrow fetcher stacks and none on row-transpose stacks within the fetcher. The fixture uses loopback CDC responses.

Partition-only SQL declarations

A loopback probe ran a bounded scan and append with 8,192 rows in two partitions. The SQL source declared only the partition column ds. The MaxCompute table also stored a BIGINT ID and a 1 KiB string per row. The released stock connector sent an empty data projection and received 8,530,624 bytes of Storage read responses. StreamFusion requested only the ID and partition columns and received 108,592 bytes. Both sinks wrote 4,096 rows for each partition value.

The submitted native plan had no row/Arrow conversion operators. The JDK 17 recording sampled mostly sink initialization, and no sample contained a row/Arrow conversion operator. The proxy measured response body sizes.

Bucket metadata buffers

Metadata-only row-offset scans use the snapshot's exact split count and bucket metadata to emit Arrow batches without fetching data. The released SDK loopback fixture applies a three-row cap to a five-row split and verifies the emitted rows and zero payload requests across a serialized checkpoint restore. The emulator SQL fixture compares both metadata columns with stock Flink using row-offset and byte-size splits.

A release-build wire probe grouped both bucket metadata columns over 16,384 rows on Flink 1.18.1 and JDK 17. Across two warmups, five timed trials and one JFR trial per route, both routes opened eight read sessions and returned the same bucket values and row count. Stock Flink made eight payload requests and read 465,080 response bytes per job. The native scan made zero payload requests. Whole-job medians were 517 ms for stock Flink (499–522 ms) and 520 ms for StreamFusion (501–586 ms), including the aggregation and collection through the proxy. The batch aggregate used Flink rows. All 22 allocation samples on the native source's emit stack came from that Arrow-to-row boundary and downstream Flink operators.

The checkpoint fixture compared the Arrow data buffers for the bucket ID and the millisecond child of the bucket timestamp. For a one-row emitted batch, their combined capacity dropped from 48,136 bytes to 16 bytes. These figures exclude validity and the timestamp's nanosecond child. Row-offset and byte-size restore both preserved the metadata and returned the expected row IDs, including when the first SDK batch overlapped both the offset and the local limit.

A 65,536-row bounded SQL scan and append used the bucket timestamp in a filter and wrote the bucket ID. The JDK 17 recording went from 33 to 10 allocation samples under the metadata fill. The original recording sampled per-row timestamp accessor construction. Both runs wrote the expected IDs and bucket values. Their plans and recordings showed no row/Arrow transposes. These profiles sampled JVM stacks.

Event-time window read and write

A 12,288-row projected scan used computed epoch-millisecond rowtime and periodic watermarks, then ran a two-phase tumbling-window aggregation and appended all 8,192 results to MaxCompute. Stock and native output matched. The native plan used an Arrow exchange between window phases and contained no row/Arrow conversion operators. The JDK 17 recording included 20 allocation samples on the native read stack, 33 on the native window stacks and 15 on the native writer stack. The capture sampled JVM stacks.

On-event watermark batches

A 32,774-row SQL scan and append raised the event watermark early in the scan. The native reader emitted eight Arrow batches. Both engines wrote the same 8,195 window results after dropping the same late rows. The native plan had no row/Arrow conversion operators. A JDK 17 recording captured 29 allocation samples in the native reader and three in the native writer. The slice-building stack appeared in one CPU sample and one class-loading allocation sample.

Watermark alignment

A two-reader SQL profile scanned 12,288 rows, ran two-phase event-time window aggregation and checked all 8,192 append results in stock and native Flink. The two-hour drift control completed in both engines and the native plan carried Arrow batches through the shuffle. JFR captured nine CPU samples on the native reader stack and six allocation samples on the native writer stack. Alignment-related allocation samples in the combined recording were mostly Flink coordinator event serialization at the configured 20 ms update interval. A separate source operator test verified that the alignment wait preserves buffered Arrow output and its checkpoint position.

A per-split pause previously let the fetcher repeatedly allocate and return empty results. The fetcher now waits for a Flink wake-up before returning an empty result and processing the next control task. Only pause and wake-up control takes the monitor. A focused emulator test checks a wake-up both before and during the wait, then resumes with the same buffered Arrow slice and advances the offset from one to four. Before the change, the same test returned an empty result immediately. A 10-second JDK 17 recording across 14 checkpoint and SQL tests captured the 261 ms monitor wait in the regression. The recording sampled 25 allocations on the native reader stack and 68 on the native writer stack, including 61 during writer open. The SQL tests also checked that the native plans kept Arrow through the window shuffle and into the Storage sink.

With the same skew and a 100 ms drift, the stock probe reached its 45-second wait limit and the native probe reached its 24-second wait limit. This is consistent with the bounded-subtask alignment stall in FLINK-35157, which affects Flink 1.18.1.

Current-main integration profile

After integrating canonical main at 3bbe85689, a focused emulator run covered bounded projection, watermarks, source checkpoint offsets and upserts with Arrow shuffles. The JDK 17 recording included 32 allocation samples on native reader stacks, 93 on native writer stacks and 10 on the bucket router. The submitted graphs placed row conversion only at the SQL collection boundary in the six upstream source-option cases. The successful jobs writing to ODPS kept their payloads columnar.

A JDK 17 smoke test used packaged loader, core, adapter and released MaxCompute JARs with the pinned emulator. A projected bounded read and Storage API append wrote all 65,536 expected IDs with stock and accelerated MaxCompute perimeters. The installed planner discovered the Arrow adapter automatically and shared the vendor SDK class identity. With the vendor JAR absent, ordinary SQL still ran using native calc.

The native plan kept the payload in Arrow through the read, calculation and write. JFR sampled zero row conversion stacks. The same query with the stock MaxCompute JAR and StreamFusion core recorded 138 allocation samples on the row-to-Arrow stack and 95 on the Arrow-to-row stack. Some samples included both stacks through operator chaining. The native recording captured 14 allocation samples under the reader and 60 under the writer. Native-method samples under the writer predominantly showed SDK socket polling. These recordings include JVM startup and use a debug native library.

Full upstream native run

The archive-backed suite at 8a3335bea used JFR to record the test JVM for 20 seconds during the upstream writer-mode matrix. The recording sampled 25 allocations on the native reader stack, eight on the Storage writer stack, and 27 on the Tunnel Arrow writer stack. The sample includes local Flink job startup and the jobs using the released record writer. All 27 targeted case checks passed in the submitted job graphs.

Reader, writer and router allocation sample

A 35-second JDK 17 recording during the 70-case adapter run captured 10 allocation samples on source fetch stacks, 410 on writer stacks and 194 on router stacks. The common array-copy allocation sites on writer stacks came from the released SDK's HTTP requests, signing and Arrow IPC. Every sampled stack with both a row conversion and an ODPS router entered the router from RowDataToArrowOperator.flush upstream. The sampled connector operations received and forwarded Arrow batches. These counts include SDK and Flink activity and describe allocation sites.