[ https://issues.apache.org/jira/browse/DRILL-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16246283#comment-16246283 ]
ASF GitHub Bot commented on DRILL-5923: --------------------------------------- Github user paul-rogers commented on the issue: https://github.com/apache/drill/pull/1021 @arina-ielchiieva, it helps to think about the source of the enum. This is a Protobuf enum. The ordinal values cannot change; they are a contract between sender and receiver. We can add new ones, or retire old ones, but otherwise the values are frozen in time. The array approach captures this reality. We could document the array better: ``` String displayNames[] = { "First Value", // FIRST_VALUE = 0 "Second Value", // SECOND_VALUE = 1 ... }; ``` We can also do a bounds check: ``` if (enumValue.ordinal() >= displayNames.length) { return enumValue.toString(); else return displayNames[enumValue.ordinal()); } ``` But, IMHO a map seems overkill for such a simple task. Yes, it works, but is unnecessary. As they say, "make it as simple as possible (but no simpler)." > State of a successfully completed query shown as "COMPLETED" > ------------------------------------------------------------ > > Key: DRILL-5923 > URL: https://issues.apache.org/jira/browse/DRILL-5923 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP > Affects Versions: 1.11.0 > Reporter: Prasad Nagaraj Subramanya > Assignee: Prasad Nagaraj Subramanya > Fix For: 1.12.0 > > > Drill UI currently lists a successfully completed query as "COMPLETED". > Successfully completed, failed and canceled queries are all grouped as > Completed queries. > It would be better to list the state of a successfully completed query as > "Succeeded" to avoid confusion. -- This message was sent by Atlassian JIRA (v6.4.14#64029)