jon-wei commented on a change in pull request #7133: 6088 - Time Ordering On 
Scans
URL: https://github.com/apache/incubator-druid/pull/7133#discussion_r266170777
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java
 ##########
 @@ -36,26 +40,88 @@
 
 public class ScanQuery extends BaseQuery<ScanResultValue>
 {
-  public static final String RESULT_FORMAT_LIST = "list";
-  public static final String RESULT_FORMAT_COMPACTED_LIST = "compactedList";
-  public static final String RESULT_FORMAT_VALUE_VECTOR = "valueVector";
+  public enum ResultFormat
+  {
+    RESULT_FORMAT_LIST,
+    RESULT_FORMAT_COMPACTED_LIST,
+    RESULT_FORMAT_VALUE_VECTOR;
+
+    @JsonValue
+    @Override
+    public String toString()
+    {
+      switch (this) {
+        case RESULT_FORMAT_LIST:
+          return "list";
+        case RESULT_FORMAT_COMPACTED_LIST:
+          return "compactedList";
+        case RESULT_FORMAT_VALUE_VECTOR:
+          return "valueVector";
+        default:
+          return "";
+      }
+    }
+
+    @JsonCreator
+    public static ResultFormat fromString(String name)
+    {
+      switch (name) {
+        case "compactedList":
+          return RESULT_FORMAT_COMPACTED_LIST;
+        case "valueVector":
+          return RESULT_FORMAT_VALUE_VECTOR;
+        case "list":
+          return RESULT_FORMAT_LIST;
+        default:
+          throw new UOE("Scan query result format [%s] is not supported.", 
name);
+      }
+    }
+  }
+
+  public enum TimeOrder
 
 Review comment:
   We could reuse the `OrderByColumnSpec.Direction` enum here, using `null` to 
represent the default no ordering case

----------------------------------------------------------------
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