Host-exact builtins over the same upcall, with a faster pure-Rust opt-in¶
Applies to: REGEXP_EXTRACT, UPPER/LOWER, temporal parsing/formatting/arithmetic/casts
Builtins whose Rust implementation can diverge from the JVM's — REGEXP_EXTRACT (regex dialects),
UPPER/LOWER (locale case folding), DATE_FORMAT/EXTRACT over TIMESTAMP_LTZ (time-zone database
edges) — default to calling Flink's own implementation through the same batch upcall used for user
UDFs: byte parity, island preserved.
The pure-Rust path stays available behind allowIncompatible (see
Configuration) for callers who want the faster path and can accept the
divergence risk.
q21 measures the honest price of the guarantee: 0.76x via the upcall vs 1.57x pure-native. For the zone-aware datetime functions the two paths measure within noise of each other — the call itself isn't the bottleneck there.
Temporal expressions also use Flink's generated expression code through this bridge. Adjacent
temporal calls fuse into a single evaluator: for DATE_FORMAT(TO_TIMESTAMP(text), pattern),
only the input strings and final formatted result cross the bridge. The intermediate timestamp
stays in Flink's internal representation, preserving its full range without another upcall.
This expands coverage; isolated temporal projections have not demonstrated an end-to-end speedup.
See the temporal contract and
release measurements.