MCPcopy Create free account
hub / github.com/apache/impala / _setupDb

Function _setupDb

be/src/catalog/workload-management-init.cc:131–151  ·  view source on GitHub ↗

Equivalent to: CREATE DATABASE IF NOT EXISTS {{db}}.

Source from the content-addressed store, hash-verified

129
130/// Equivalent to: CREATE DATABASE IF NOT EXISTS {{db}}.
131static Status _setupDb(CatalogServiceIf* svc, const string& ip_addr, const string& db) {
132 TDdlExecResponse resp;
133 TDdlExecRequest req;
134 TCreateDbParams create_db;
135
136 create_db.__set_comment("System database for Impala introspection");
137 create_db.__set_db(db);
138 create_db.__set_if_not_exists(true);
139 create_db.__set_owner(FLAGS_workload_mgmt_maintenance_user);
140
141 TDdlQueryOptions t_query_opts;
142 t_query_opts.__set_sync_ddl(true);
143
144 req.__set_header(_getHeader(ip_addr));
145 req.__set_ddl_type(TDdlType::type::CREATE_DATABASE);
146 req.__set_create_db_params(create_db);
147 req.__set_query_options(t_query_opts);
148
149 svc->ExecDdl(resp, req);
150 return StatusFromThrift(resp.result.status);
151} // function _setupDb
152
153/// Loops through all workload management columns definied in FIELD_DEFINITIONS and builds
154/// a TColumn object for each column if the provided function returns true for that column

Callers 1

Calls 3

_getHeaderFunction · 0.85
StatusFromThriftFunction · 0.85
ExecDdlMethod · 0.45

Tested by

no test coverage detected