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

Method HandleDropDataSource

be/src/exec/catalog-op-executor.cc:266–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266void CatalogOpExecutor::HandleDropDataSource(const TDropDataSourceParams& request) {
267 DCHECK(fe_ != NULL) << "FE tests should not be calling this";
268 // Can only be called after successfully processing a catalog update.
269 DCHECK(catalog_update_result_ != NULL);
270
271 // Lookup in the local catalog the metadata for the data source.
272 TCatalogObject obj;
273 obj.type = TCatalogObjectType::DATA_SOURCE;
274 obj.data_source.name = request.data_source;
275 obj.__isset.data_source = true;
276
277 TCatalogObject ds;
278 Status status = fe_->GetCatalogObject(obj, &ds);
279 if (!status.ok()) {
280 // This can happen if the data source was dropped by another impalad.
281 VLOG_QUERY << "Could not lookup data source catalog object: "
282 << apache::thrift::ThriftDebugString(request);
283 return;
284 }
285 // This data source may have been dropped and re-created. To avoid removing the
286 // re-created data source's entry from the cache verify the existing data source has a
287 // catalog version <= the dropped version. This may happen if the update from the
288 // statestore gets applied *before* the result of a direct-DDL drop data source
289 // command.
290 if (ds.catalog_version <= catalog_update_result_->version) {
291 LibCache::instance()->RemoveEntry(ds.data_source.hdfs_location);
292 }
293}
294
295void CatalogOpExecutor::SetTableStats(const TTableSchema& tbl_stats_schema,
296 const TRowSet& tbl_stats_data, const vector<TPartitionStats>& existing_part_stats,

Callers

nothing calls this directly

Calls 4

ThriftDebugStringFunction · 0.85
RemoveEntryMethod · 0.80
GetCatalogObjectMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected