drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [drill] paul-rogers commented on a change in pull request #1888: DRILL-5956: Add Storage Plugin for Apache Druid
Date Sat, 14 Mar 2020 07:09:22 GMT
paul-rogers commented on a change in pull request #1888: DRILL-5956: Add Storage Plugin for
Apache Druid
URL: https://github.com/apache/drill/pull/1888#discussion_r392563925
 
 

 ##########
 File path: contrib/storage-druid/src/main/java/org/apache/drill/exec/store/druid/common/DruidBoundFilter.java
 ##########
 @@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.store.druid.common;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashMap;
+
+public class DruidBoundFilter {
+
+  private static final ObjectMapper objectMapper = new ObjectMapper();
+  private String type = DruidCompareOp.TYPE_BOUND.getCompareOp();
+  private String dimension;
+  private String lower;
+  private String upper;
+  private Boolean lowerStrict =  false;
+  private Boolean upperStrict = false;
+
+  @JsonCreator
+  public DruidBoundFilter(@JsonProperty("dimension") String dimension,
+                          @JsonProperty("lower") String lower,
+                          @JsonProperty("upper") String upper) {
+    this.dimension = dimension;
+    this.lower = lower;
+    this.upper= upper;
+  }
+
+  @JsonCreator
+  public DruidBoundFilter(@JsonProperty("dimension") String dimension,
+                          @JsonProperty("lower") String lower,
+                          @JsonProperty("upper") String upper,
+                          @JsonProperty("lowerStrict") Boolean lowerStrict,
+                          @JsonProperty("upperStrict") Boolean upperStrict) {
+    this.dimension = dimension;
+    this.lower = lower;
+    this.upper= upper;
+    this.lowerStrict = lowerStrict;
+    this.upperStrict = upperStrict;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public String getDimension() {
+    return dimension;
+  }
+
+  public void setDimension(String dimension) {
+    this.dimension = dimension;
+  }
+
+  public String getLower() {
+    return lower;
+  }
+
+  public void setLower(String lower) {
+    this.lower = lower;
+  }
+
+  public String getUpper() {
+    return upper;
+  }
+
+  public void setUpper(String upper) {
+    this.upper = upper;
+  }
+
+  public Boolean getLowerStrict() {
+    return lowerStrict;
+  }
+
+  public void setLowerStrict(Boolean lowerStrict) {
+    this.lowerStrict = lowerStrict;
+  }
+
+  public Boolean getUpperStrict() {
+    return upperStrict;
+  }
+
+  public void setUpperStrict(Boolean upperStrict) {
+    this.upperStrict = upperStrict;
+  }
+
+  public String toJson() throws JsonProcessingException {
 
 Review comment:
   Interesting. This class is configured for Jackson, but the JSON is created by hand in this
method. Any reason to not use Jackson to do the work?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message