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

Method parseArguments

src/TableFunctions/TableFunctionSQLite.cpp:73–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73void TableFunctionSQLite::parseArguments(const ASTPtr & ast_function, ContextPtr context)
74{
75 const auto & func_args = ast_function->as<ASTFunction &>();
76
77 if (!func_args.arguments)
78 throw Exception(ErrorCodes::BAD_ARGUMENTS, "Table function 'sqlite' must have arguments.");
79
80 ASTs & args = func_args.arguments->children;
81
82 if (args.size() != 2)
83 throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "SQLite database requires 2 arguments: database path, table name");
84
85 for (auto & arg : args)
86 arg = evaluateConstantExpressionOrIdentifierAsLiteral(arg, context);
87
88 database_path = checkAndGetLiteralArgument<String>(args[0], "database_path");
89 remote_table_name = checkAndGetLiteralArgument<String>(args[1], "table_name");
90
91 sqlite_db = openSQLiteDB(database_path, context);
92}
93
94}
95

Callers

nothing calls this directly

Calls 4

openSQLiteDBFunction · 0.85
ExceptionClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected