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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to