Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
3.1.0
-
None
-
None
Description
DruidStorageHandler should not disable the druid datasource of the hive external table.
if (deleteData && MetaStoreUtils.isExternalTablePurge(table)) { LOG.info("Dropping with purge all the data for data source {}", dataSourceName); List<DataSegment> dataSegmentList = DruidStorageHandlerUtils.getDataSegmentList(getConnector(), getDruidMetadataStorageTablesConfig(), dataSourceName); if (dataSegmentList.isEmpty()) { LOG.info("Nothing to delete for data source {}", dataSourceName); return; } for (DataSegment dataSegment : dataSegmentList) { try { deleteSegment(dataSegment); } catch (SegmentLoadingException e) { LOG.error(String.format("Error while deleting segment [%s]", dataSegment.getIdentifier()), e); } } } if (DruidStorageHandlerUtils.disableDataSource(getConnector(), getDruidMetadataStorageTablesConfig(), dataSourceName)) { LOG.info("Successfully dropped druid data source {}", dataSourceName); }
If a druid datasource is disabled
- We can not query to the datasource anymore.
- It takes too much time to enable again a datasource, if the datasource is big.
The data of an external table should be usable, even after the external table is dropped from hive.
So, DruidStorageHandler should not disable the druid datasource when a hive external table is dropped.