Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions python/benchmarks/bench_eval_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ def peakmem_worker(self, *args):
class _ArrowBatchedBenchMixin:
"""Provides ``_write_scenario`` for SQL_ARROW_BATCHED_UDF.

Writes the extra ``input_type`` (StructType JSON) that the wire protocol
requires before the UDF payload.
Passes the ``input_type`` (StructType JSON) through ``EvalConf``, which the
non-legacy and legacy paths both read via ``eval_conf.input_type``.
"""

# Row-by-row processing is ~100x slower than columnar Arrow UDFs,
Expand Down Expand Up @@ -486,15 +486,12 @@ def _write_scenario(self, scenario, udf_name, buf):
if ret_type is None:
ret_type = schema.fields[0].dataType

def write_udf(b):
MockProtocolWriter.write_utf8(schema.json(), b)
MockProtocolWriter.write_udf_payload(udf_func, ret_type, arg_offsets, b)

MockProtocolWriter.write_worker_input(
PythonEvalType.SQL_ARROW_BATCHED_UDF,
write_udf,
lambda b: MockProtocolWriter.write_udf_payload(udf_func, ret_type, arg_offsets, b),
lambda b: MockProtocolWriter.write_data_payload(iter(batches), b),
buf,
eval_conf={"input_type": schema.json()},
)


Expand Down