diff --git a/service/worker/esanalyzer/analyzer.go b/service/worker/esanalyzer/analyzer.go index 6a11722b3ec..5e31a62db2b 100644 --- a/service/worker/esanalyzer/analyzer.go +++ b/service/worker/esanalyzer/analyzer.go @@ -119,10 +119,17 @@ func New( config *Config, ) *Analyzer { var mode readMode + var indexName string + var pinotTableName string + if esClient != nil { mode = ES + indexName = esConfig.Indices[common.VisibilityAppName] + pinotTableName = "" } else if pinotClient != nil { mode = Pinot + indexName = "" + pinotTableName = pinotConfig.Table } return &Analyzer{ @@ -134,8 +141,8 @@ func New( readMode: mode, logger: logger, tallyScope: tallyScope, - visibilityIndexName: esConfig.Indices[common.VisibilityAppName], - pinotTableName: pinotConfig.Table, + visibilityIndexName: indexName, + pinotTableName: pinotTableName, resource: resource, domainCache: domainCache, config: config, diff --git a/service/worker/esanalyzer/domainWorkflowTypeCountWorkflow.go b/service/worker/esanalyzer/domainWorkflowTypeCountWorkflow.go index cdd2cd6d6f6..9ccd173fb43 100644 --- a/service/worker/esanalyzer/domainWorkflowTypeCountWorkflow.go +++ b/service/worker/esanalyzer/domainWorkflowTypeCountWorkflow.go @@ -182,7 +182,6 @@ AND StartTime > 0 GROUP BY WorkflowType ORDER BY count LIMIT 10 -OFFSET 0 `, w.analyzer.pinotTableName, domain.GetInfo().ID), nil } diff --git a/service/worker/esanalyzer/workflow.go b/service/worker/esanalyzer/workflow.go index be1dcd80547..80e01ec5f07 100644 --- a/service/worker/esanalyzer/workflow.go +++ b/service/worker/esanalyzer/workflow.go @@ -164,7 +164,6 @@ WHERE DomainID = '%s' GROUP BY WorkflowType ORDER BY count DESC LIMIT 10 -OFFSET 0 `, w.analyzer.pinotTableName, domain.GetInfo().ID), nil } @@ -185,7 +184,6 @@ WHERE DomainID = '%s' GROUP BY JSON_EXTRACT_SCALAR(Attr, '$.CadenceChangeVersion', 'STRING_ARRAY') AS CadenceChangeVersion ORDER BY count DESC LIMIT 10 -OFFSET 0 `, w.analyzer.pinotTableName, domain.GetInfo().ID, wfType), nil }