[ 
https://issues.apache.org/jira/browse/DRILL-5956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17116001#comment-17116001
 ] 

ASF GitHub Bot commented on DRILL-5956:
---------------------------------------

akkapur commented on a change in pull request #1888:
URL: https://github.com/apache/drill/pull/1888#discussion_r429915738



##########
File path: 
contrib/storage-druid/src/main/java/org/apache/drill/exec/store/druid/druid/SelectQuery.java
##########
@@ -0,0 +1,214 @@
+/*
+ * 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.druid;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Objects;
+
+public class SelectQuery {
+
+  private static final ObjectMapper objectMapper = new ObjectMapper();
+  public static String IntervalDimensionName = "eventInterval";
+  private static final String ISO8601DateStringFormat = 
"yyyy-MM-dd'T'HH:mm:ss.SSSZ";
+  private static final String NixStartTime = "1970-01-01T00:00:00.000Z";
+  private String queryType = "select";
+  private String dataSource;
+  private boolean descending = false;
+  private ArrayList<String> dimensions = new ArrayList<>();
+  private ArrayList<String> metrics = new ArrayList<>();
+  private String granularity = "all";
+  private List<String> intervals = new ArrayList<>();
+  private PagingSpec pagingSpec = new PagingSpec(null);
+  private String filter;
+
+  public SelectQuery(String dataSource, List<String> intervals) {
+    this.dataSource = dataSource;
+    this.intervals = intervals;
+  }
+
+  public SelectQuery(String dataSource) {
+    this.dataSource = dataSource;
+
+    //Note - Interval is always this by default because there is no way to 
provide an interval via SQL
+    DateTime now = new DateTime();
+    DateTime zulu = now.toDateTime( DateTimeZone.UTC );
+    String interval = NixStartTime + "/" + zulu;
+    this.intervals.add(interval);
+  }
+
+  public String getQueryType() {
+    return queryType;
+  }
+
+  public void setQueryType(String queryType) {
+    this.queryType = queryType;
+  }
+
+  public String getDataSource() {
+    return dataSource;
+  }
+
+  public void setDataSource(String dataSource) {
+    this.dataSource = dataSource;
+  }
+
+  public boolean isDescending() {
+    return descending;
+  }
+
+  public void setDescending(boolean descending) {
+    this.descending = descending;
+  }
+
+  public ArrayList<String> getDimensions() {
+    return dimensions;
+  }
+
+  public void setDimensions(List<String> dimensions) {
+    this.dimensions = (ArrayList<String>) dimensions;
+  }
+
+  public ArrayList<String> getMetrics() {
+    return metrics;
+  }
+
+  public void setMetrics(ArrayList<String> metrics) {
+    this.metrics = metrics;
+  }
+
+  public String getGranularity() {
+    return granularity;
+  }
+
+  public void setGranularity(String granularity) {
+    this.granularity = granularity;
+  }
+
+  public List<String> getIntervals() {
+    return intervals;
+  }
+
+  public void setIntervals(ArrayList<String> intervals) {
+    this.intervals = intervals;
+  }
+
+  public PagingSpec getPagingSpec() {
+    return pagingSpec;
+  }
+
+  public void setPagingSpec(PagingSpec pagingSpec) {
+    this.pagingSpec = pagingSpec;
+  }
+
+  public String getFilter() {
+    return filter;
+  }
+
+  public void setFilter(String filter) {
+    this.filter = filter;
+  }
+
+  public String toJson() throws IOException {

Review comment:
       You are correct. I was lazy when I initially did this. Trying to fix it 
as we go along. Just fixed this file.




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


> Add Storage Plugin for Apache Druid
> -----------------------------------
>
>                 Key: DRILL-5956
>                 URL: https://issues.apache.org/jira/browse/DRILL-5956
>             Project: Apache Drill
>          Issue Type: Wish
>          Components: Storage - Other
>            Reporter: Jiaqi Liu
>            Priority: Major
>              Labels: Enhancement, Storage-Plugin
>             Fix For: 1.18.0
>
>
> As more and more companies are using Druid for mission-critical industrial 
> products, Drill could gain much more popularity with Druid as one of its 
> supported storage plugin so that uses could easily bind Druid cluster to 
> running Drill instance



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to