Skip to content

Commit

Permalink
Merge pull request #76 from zapr-oss/develop
Browse files Browse the repository at this point in the history
Version bumped to 2.11
  • Loading branch information
GG-Zapr authored Jan 20, 2019
2 parents 246292f + 1889ef9 commit f27a69c
Show file tree
Hide file tree
Showing 71 changed files with 961 additions and 794 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,12 @@ Supported Features
------------------

#### Queries
Aggregation Queries
* TopN
* TimeSeries
* GroupBy
* Aggregation Queries
* TopN
* TimeSeries
* GroupBy
* DruidScanQuery
* DruidSelectQuery


#### Aggregators
Expand Down
14 changes: 10 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>in.zapr.druid</groupId>
<artifactId>druidry</artifactId>
<version>2.10</version>
<version>2.11</version>

<name>Druidry - Druid Java Client</name>
<description>Druidry is an open-source Java based utility library which supports creating
Expand All @@ -16,7 +16,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson.version>2.9.7</jackson.version>
<jackson.version>2.9.8</jackson.version>
<jodatime.version>2.9.7</jodatime.version>
<lombok.version>1.16.14</lombok.version>
<testng.version>6.11</testng.version>
Expand Down Expand Up @@ -236,13 +236,19 @@
<name>Gagan Gupta</name>
<email>[email protected]</email>
<organization>ZAPR Media Labs</organization>
<organizationUrl>http://www.zapr.in</organizationUrl>
<organizationUrl>https://www.zapr.in</organizationUrl>
</developer>
<developer>
<name>Nihit Alamuru</name>
<email>[email protected]</email>
<organization>ZAPR Media Labs</organization>
<organizationUrl>http://www.zapr.in</organizationUrl>
<organizationUrl>https://www.zapr.in</organizationUrl>
</developer>
<developer>
<name>Abhi Sapariya</name>
<email>[email protected]</email>
<organization>ZAPR Media Labs</organization>
<organizationUrl>https://www.zapr.in</organizationUrl>
</developer>
</developers>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ public SelectorFilter(@NonNull String dimension, Integer value) {
this(dimension);
this.value = value;
}

public SelectorFilter(@NonNull String dimension, Long value) {
this(dimension);
this.value = value;
}
}
3 changes: 2 additions & 1 deletion src/main/java/in/zapr/druid/druidry/query/QueryType.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public enum QueryType {
SEGMENT_METADATA("segmentMetadata"),
DATASOURCE_METADATA("dataSourceMetadata"),
SEARCH("search"),
SCAN("scan");
SCAN("scan"),
SELECT("select");

private String value;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* Licensed 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 in.zapr.druid.druidry.query.select;

import com.fasterxml.jackson.annotation.JsonInclude;
import in.zapr.druid.druidry.Context;
import in.zapr.druid.druidry.Interval;
import in.zapr.druid.druidry.dimension.DruidDimension;
import in.zapr.druid.druidry.filter.DruidFilter;
import in.zapr.druid.druidry.granularity.Granularity;
import in.zapr.druid.druidry.query.DruidQuery;
import in.zapr.druid.druidry.query.QueryType;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;

import java.util.List;

/**
* Generate Druid select query.
* See documentation http://druid.io/docs/latest/querying/select-query.html
*/
@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class DruidSelectQuery extends DruidQuery {
private List<Interval> intervals;
private DruidFilter filter;
private Boolean descending;
private Granularity granularity;
private List<DruidDimension> dimensions;
private List<String> metrics;
private PagingSpec pagingSpec;

@Builder
public DruidSelectQuery(
@NonNull String dataSource,
DruidFilter filter,
Boolean descending,
Granularity granularity,
List<DruidDimension> dimensions,
List<String> metrics,
@NonNull List<Interval> intervals,
@NonNull PagingSpec pagingSpec,
Context context) {
this.queryType = QueryType.SELECT;
this.context = context;
this.dataSource = dataSource;
this.filter = filter;
this.descending = descending;
this.granularity = granularity;
this.intervals = intervals;
this.dimensions = dimensions;
this.metrics = metrics;
this.pagingSpec = pagingSpec;
}
}
36 changes: 36 additions & 0 deletions src/main/java/in/zapr/druid/druidry/query/select/PagingSpec.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* Licensed 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 in.zapr.druid.druidry.query.select;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import java.util.Map;

@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
@RequiredArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
public class PagingSpec {
@NonNull
private Integer threshold;

private Boolean fromNext;

@NonNull
private Map<String, Integer> pagingIdentifiers;
}
40 changes: 11 additions & 29 deletions src/test/java/in/zapr/druid/druidry/ContextTest.java
Original file line number Diff line number Diff line change
@@ -1,38 +1,20 @@
/*
* Copyright (c) 2017-present, Red Brick Lane Marketing Solutions Pvt. Ltd.
* All rights reserved.
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Licensed 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* 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 in.zapr.druid.druidry;/*
* Copyright (c) 2017-present, Red Brick Lane Marketing Solutions Pvt. Ltd.
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package in.zapr.druid.druidry;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
22 changes: 10 additions & 12 deletions src/test/java/in/zapr/druid/druidry/IntervalTest.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* Copyright (c) 2017-present, Red Brick Lane Marketing Solutions Pvt. Ltd.
* All rights reserved.
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Licensed 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* 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 in.zapr.druid.druidry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* Copyright (c) 2017-present, Red Brick Lane Marketing Solutions Pvt. Ltd.
* All rights reserved.
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Licensed 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* 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 in.zapr.druid.druidry.aggregator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* Copyright (c) 2017-present, Red Brick Lane Marketing Solutions Pvt. Ltd.
* All rights reserved.
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Licensed 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* 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 in.zapr.druid.druidry.aggregator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* Copyright (c) 2017-present, Red Brick Lane Marketing Solutions Pvt. Ltd.
* All rights reserved.
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Licensed 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* 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 in.zapr.druid.druidry.aggregator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* Copyright (c) 2017-present, Red Brick Lane Marketing Solutions Pvt. Ltd.
* All rights reserved.
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Licensed 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* 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 in.zapr.druid.druidry.aggregator;
Expand Down
Loading

0 comments on commit f27a69c

Please sign in to comment.