Files
Alexey MilovidovandClaude Opus 4.7 1c7876bff9 Address review: avoid throw from executable UDF candidate check
`UserDefinedExecutableFunctionFactory::tryGet` instantiates
`UserDefinedFunction` with empty parameters; its constructor throws
`BAD_ARGUMENTS` for any UDF that declares command parameters. Because
the bare-function rewrite-candidate check ran before column/alias
resolution, an unqualified identifier matching a parameterised
executable UDF would fail with `BAD_ARGUMENTS` before the column/alias
lookup could even take place — breaking the documented
"column/alias names take priority" contract.

Mirror the `has`-first pattern already used for WebAssembly UDFs and
swallow `BAD_ARGUMENTS` around `tryGet`: parameterised executable
UDFs are not eligible for the lambda rewrite anyway (we have no
parameters to supply), so dropping the candidate and falling through
to identifier resolution is the right behaviour. Add a regression test
using a new `test_function_with_parameter` executable UDF.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-12 10:21:58 +00:00

32 lines
1004 B
XML

<functions>
<function>
<type>executable</type>
<name>test_function</name>
<return_type>UInt64</return_type>
<argument>
<type>UInt64</type>
</argument>
<argument>
<type>UInt64</type>
</argument>
<format>TabSeparated</format>
<command>awk -F'\t' '{print $1 + $2}'</command>
<execute_direct>0</execute_direct>
</function>
<function>
<type>executable</type>
<name>test_function_with_parameter</name>
<return_type>UInt64</return_type>
<argument>
<type>UInt64</type>
</argument>
<format>TabSeparated</format>
<command>awk</command>
<command_argument>-F\t</command_argument>
<command_argument>-v</command_argument>
<command_argument>p={param:UInt64}</command_argument>
<command_argument>{ print $1 + p }</command_argument>
<execute_direct>1</execute_direct>
</function>
</functions>