You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/10/31 23:48:18 UTC

[GitHub] [incubator-pinot] jihaozh commented on a change in pull request #4768: [TE] deactivate metrics instead of deleting

jihaozh commented on a change in pull request #4768: [TE] deactivate metrics instead of deleting
URL: https://github.com/apache/incubator-pinot/pull/4768#discussion_r341408841
 
 

 ##########
 File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/auto/onboard/AutoOnboardPinotMetadataSource.java
 ##########
 @@ -315,16 +305,24 @@ private void checkMetricChanges(String dataset, DatasetConfigDTO datasetConfig,
       if (!datasetMetricNames.contains(metricSpec.getName())) {
         MetricConfigDTO metricConfigDTO = ConfigGenerator.generateMetricConfig(metricSpec, dataset);
         LOG.info("Creating metric {} in {}", metricSpec.getName(), dataset);
-        DAO_REGISTRY.getMetricConfigDAO().save(metricConfigDTO);
+        this.metricDAO.save(metricConfigDTO);
       }
     }
 
-    // remove deleted metrics from ThirdEye
+    // audit existing metrics in ThirdEye
     for (MetricConfigDTO metricConfig : datasetMetricConfigs) {
-      if (!metricConfig.isDerived()) {
-        if (!schemaMetricNames.contains(getColumnName(metricConfig))) {
-          LOG.info("Deleting metric {} in {}", metricConfig.getName(), dataset);
-          DAO_REGISTRY.getMetricConfigDAO().delete(metricConfig);
+      if (!schemaMetricNames.contains(getColumnName(metricConfig))) {
+        if (!metricConfig.isDerived() && !metricConfig.getName().equals(ROW_COUNT)) {
 
 Review comment:
   Actually, since derived metrics can be created across datasets, it's safer to not de-activate them when one dataset is missing. Also, it's hard to check when to re-activate a derived metric.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org