Martijn Visser created FLINK-41767:
--------------------------------------
Summary: User-defined functions that keep an internal-type
argument can return wrong results with object reuse
Key: FLINK-41767
URL: https://issues.apache.org/jira/browse/FLINK-41767
Project: Flink
Issue Type: Bug
Components: Table SQL / Planner
Reporter: Martijn Visser
A scalar or table function that takes an internal-type argument, such as
{{StringData}} via {{@DataTypeHint(bridgedTo = StringData.class)}}, and keeps
it beyond the call, can later read data that the source has overwritten. Batch
jobs always run with object reuse, also with {{pipeline.object-reuse}} set to
false, and streaming jobs do once it is set to true. Reading a Parquet file in
batch mode on master, such a function returned fragments of other rows at the
edges of the vectorized reader's 2048-row batches. With a {{String}} argument
the results are correct.
The UDF docs don't say that an internal-type argument must not be kept. We
should copy internal-type arguments of user-defined functions before the call,
like the planner already does for buffered aggregate input. FLINK-26016 fixed
the same problem for the Hive lookup function.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)