Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-21263

DruidStorageHandler should not disable the druid datasource when a hive external table is dropped

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.0
    • Fix Version/s: None
    • Component/s: Druid integration
    • Labels:
      None

      Description

      DruidStorageHandler should not disable the druid datasource of the hive external table.

       

      DruidStorageHandler.java$L678

      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

      1. We can not query to the datasource anymore.
      2. 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.

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              seunghyun.cheong Seung-Hyun Cheong
              Reporter:
              seunghyun.cheong Seung-Hyun Cheong
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: