MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / tryFindInputFunctionImpl

Function tryFindInputFunctionImpl

src/Parsers/ASTInsertQuery.cpp:162–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160
161
162static void tryFindInputFunctionImpl(const ASTPtr & ast, ASTPtr & input_function)
163{
164 if (!ast)
165 return;
166 for (const auto & child : ast->children)
167 tryFindInputFunctionImpl(child, input_function);
168
169 if (const auto * table_function_ast = ast->as<ASTFunction>())
170 {
171 if (table_function_ast->name == "input")
172 {
173 if (input_function)
174 throw Exception(ErrorCodes::INVALID_USAGE_OF_INPUT, "You can use the `input` function only once in a query.");
175 input_function = ast;
176 }
177 }
178}
179
180
181void ASTInsertQuery::tryFindInputFunction(ASTPtr & input_function) const

Callers 1

tryFindInputFunctionMethod · 0.85

Calls 1

ExceptionClass · 0.50

Tested by

no test coverage detected