From 5052d081c27f243685fc372864d5cffc5e5b29cb Mon Sep 17 00:00:00 2001 From: neil-xie <104041627+neil-xie@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:50:24 -0700 Subject: [PATCH] Fix GetListWorkflowExecutionsByStatusQuery to set status as int (#5936) --- common/persistence/pinot/pinot_visibility_store.go | 14 +++++++------- .../pinot/pinot_visibility_store_test.go | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/persistence/pinot/pinot_visibility_store.go b/common/persistence/pinot/pinot_visibility_store.go index 29b092fccf6..746e1358bab 100644 --- a/common/persistence/pinot/pinot_visibility_store.go +++ b/common/persistence/pinot/pinot_visibility_store.go @@ -1058,20 +1058,20 @@ func getListWorkflowExecutionsByStatusQuery(tableName string, request *p.Interna query.filters.addEqual(DomainID, request.DomainUUID) query.filters.addEqual(IsDeleted, false) - status := "0" + status := 0 switch request.Status.String() { case "COMPLETED": - status = "0" + status = 0 case "FAILED": - status = "1" + status = 1 case "CANCELED": - status = "2" + status = 2 case "TERMINATED": - status = "3" + status = 3 case "CONTINUED_AS_NEW": - status = "4" + status = 4 case "TIMED_OUT": - status = "5" + status = 5 } query.filters.addEqual(CloseStatus, status) diff --git a/common/persistence/pinot/pinot_visibility_store_test.go b/common/persistence/pinot/pinot_visibility_store_test.go index 5927d5a78e3..c1a1102b51a 100644 --- a/common/persistence/pinot/pinot_visibility_store_test.go +++ b/common/persistence/pinot/pinot_visibility_store_test.go @@ -1535,7 +1535,7 @@ func TestGetListWorkflowExecutionsByStatusQuery(t *testing.T) { FROM %s WHERE DomainID = 'bfd5c907-f899-4baf-a7b2-2ab85e623ebd' AND IsDeleted = false -AND CloseStatus = '0' +AND CloseStatus = 0 AND CloseTime BETWEEN 1547596872371 AND 2547596872371 Order BY StartTime DESC LIMIT 0, 10 @@ -1558,7 +1558,7 @@ LIMIT 0, 10 FROM %s WHERE DomainID = 'bfd5c907-f899-4baf-a7b2-2ab85e623ebd' AND IsDeleted = false -AND CloseStatus = '1' +AND CloseStatus = 1 AND CloseTime BETWEEN 1547596872371 AND 2547596872371 Order BY StartTime DESC LIMIT 0, 10 @@ -1581,7 +1581,7 @@ LIMIT 0, 10 FROM %s WHERE DomainID = 'bfd5c907-f899-4baf-a7b2-2ab85e623ebd' AND IsDeleted = false -AND CloseStatus = '2' +AND CloseStatus = 2 AND CloseTime BETWEEN 1547596872371 AND 2547596872371 Order BY StartTime DESC LIMIT 0, 10 @@ -1604,7 +1604,7 @@ LIMIT 0, 10 FROM %s WHERE DomainID = 'bfd5c907-f899-4baf-a7b2-2ab85e623ebd' AND IsDeleted = false -AND CloseStatus = '3' +AND CloseStatus = 3 AND CloseTime BETWEEN 1547596872371 AND 2547596872371 Order BY StartTime DESC LIMIT 0, 10 @@ -1627,7 +1627,7 @@ LIMIT 0, 10 FROM %s WHERE DomainID = 'bfd5c907-f899-4baf-a7b2-2ab85e623ebd' AND IsDeleted = false -AND CloseStatus = '4' +AND CloseStatus = 4 AND CloseTime BETWEEN 1547596872371 AND 2547596872371 Order BY StartTime DESC LIMIT 0, 10 @@ -1650,7 +1650,7 @@ LIMIT 0, 10 FROM %s WHERE DomainID = 'bfd5c907-f899-4baf-a7b2-2ab85e623ebd' AND IsDeleted = false -AND CloseStatus = '5' +AND CloseStatus = 5 AND CloseTime BETWEEN 1547596872371 AND 2547596872371 Order BY StartTime DESC LIMIT 0, 10