mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Disable parameters for non direct executable user defined functions
This commit is contained in:
parent
f2b665a799
commit
aff66742e7
@ -148,6 +148,9 @@ ExternalLoader::LoadablePtr ExternalUserDefinedExecutableFunctionsLoader::create
|
||||
String command_value = config.getString(key_in_config + ".command");
|
||||
std::vector<UserDefinedExecutableFunctionParameter> parameters = extractParametersFromCommand(command_value);
|
||||
|
||||
if (!execute_direct && !parameters.empty())
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "Parameters are not supported if executable user defined function is not direct");
|
||||
|
||||
std::vector<String> command_arguments;
|
||||
|
||||
if (execute_direct)
|
||||
|
@ -13,18 +13,4 @@
|
||||
<command>cd /; clickhouse-local --input-format TabSeparated --output-format TabSeparated --structure 'x UInt64, y UInt64' --query "SELECT x + y FROM table"</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>
|
||||
<argument>
|
||||
<type>UInt64</type>
|
||||
</argument>
|
||||
<format>TabSeparated</format>
|
||||
<command>cd /; clickhouse-local --input-format TabSeparated --output-format TabSeparated --structure 'x UInt64, y UInt64' --query "SELECT x + y + {test_parameter : UInt64} FROM table"</command>
|
||||
<execute_direct>0</execute_direct>
|
||||
</function>
|
||||
</functions>
|
||||
|
@ -1,2 +0,0 @@
|
||||
5
|
||||
5
|
@ -1,6 +0,0 @@
|
||||
SELECT test_function_with_parameter('test')(1, 2); --{serverError 53}
|
||||
SELECT test_function_with_parameter(2, 2)(1, 2); --{serverError 36}
|
||||
SELECT test_function_with_parameter(1, 2); --{serverError 36}
|
||||
|
||||
SELECT test_function_with_parameter(2)(1, 2);
|
||||
SELECT test_function_with_parameter('2')(1, 2);
|
Loading…
Reference in New Issue
Block a user