mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 01:00:48 +00:00
ExecutableUserDefinedFunction prevent function execution during query analysis
This commit is contained in:
parent
09c04e4993
commit
2a8e479277
@ -112,6 +112,8 @@
|
|||||||
M(CompileExpressionsMicroseconds, "Total time spent for compilation of expressions to LLVM code.") \
|
M(CompileExpressionsMicroseconds, "Total time spent for compilation of expressions to LLVM code.") \
|
||||||
M(CompileExpressionsBytes, "Number of bytes used for expressions compilation.") \
|
M(CompileExpressionsBytes, "Number of bytes used for expressions compilation.") \
|
||||||
\
|
\
|
||||||
|
M(ExecuteShellCommand, "Number of shell command executions.") \
|
||||||
|
\
|
||||||
M(ExternalSortWritePart, "") \
|
M(ExternalSortWritePart, "") \
|
||||||
M(ExternalSortMerge, "") \
|
M(ExternalSortMerge, "") \
|
||||||
M(ExternalAggregationWritePart, "") \
|
M(ExternalAggregationWritePart, "") \
|
||||||
|
@ -29,6 +29,11 @@ namespace
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ProfileEvents
|
||||||
|
{
|
||||||
|
extern const int ExecuteShellCommand;
|
||||||
|
}
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -158,6 +163,7 @@ std::unique_ptr<ShellCommand> ShellCommand::executeImpl(
|
|||||||
const Config & config)
|
const Config & config)
|
||||||
{
|
{
|
||||||
logCommand(filename, argv);
|
logCommand(filename, argv);
|
||||||
|
ProfileEvents::increment(ProfileEvents::ExecuteShellCommand);
|
||||||
|
|
||||||
#if !defined(USE_MUSL)
|
#if !defined(USE_MUSL)
|
||||||
/** Here it is written that with a normal call `vfork`, there is a chance of deadlock in multithreaded programs,
|
/** Here it is written that with a normal call `vfork`, there is a chance of deadlock in multithreaded programs,
|
||||||
|
@ -57,6 +57,10 @@ public:
|
|||||||
|
|
||||||
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count) const override
|
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count) const override
|
||||||
{
|
{
|
||||||
|
/// Do not start user defined script during query analysis. Because user script startup could be heavy.
|
||||||
|
if (input_rows_count == 0)
|
||||||
|
return result_type->createColumn();
|
||||||
|
|
||||||
auto coordinator = executable_function->getCoordinator();
|
auto coordinator = executable_function->getCoordinator();
|
||||||
const auto & coordinator_configuration = coordinator->getConfiguration();
|
const auto & coordinator_configuration = coordinator->getConfiguration();
|
||||||
const auto & configuration = executable_function->getConfiguration();
|
const auto & configuration = executable_function->getConfiguration();
|
||||||
|
Loading…
Reference in New Issue
Block a user