Skip to content

Commit

Permalink
Fix compile issue, add geo module as dependency (#808)
Browse files Browse the repository at this point in the history
* Fix compile issue, add geo module as dependency

Signed-off-by: penghuo <[email protected]>
  • Loading branch information
penghuo authored Sep 8, 2022
1 parent 10fe75f commit 53cde65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions legacy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ dependencies {
implementation group: 'org.json', name: 'json', version:'20180813'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
implementation group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}"
// add geo module as dependency. https://github.com/opensearch-project/OpenSearch/pull/4180/.
implementation group: 'org.opensearch.plugin', name: 'geo', version: "${opensearch_version}"
api project(':sql')
api project(':common')
api project(':opensearch')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation;
import org.opensearch.search.aggregations.bucket.SingleBucketAggregation;
import org.opensearch.search.aggregations.metrics.ExtendedStats;
import org.opensearch.search.aggregations.metrics.GeoBounds;
import org.opensearch.geo.search.aggregations.metrics.GeoBounds;
import org.opensearch.search.aggregations.metrics.NumericMetricsAggregation;
import org.opensearch.search.aggregations.metrics.Percentile;
import org.opensearch.search.aggregations.metrics.Percentiles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.json.JsonXContent;
import org.opensearch.common.xcontent.json.JsonXContentParser;
import org.opensearch.geo.search.aggregations.bucket.geogrid.GeoHashGridAggregationBuilder;
import org.opensearch.join.aggregations.JoinAggregationBuilders;
import org.opensearch.script.Script;
import org.opensearch.script.ScriptType;
Expand All @@ -34,7 +35,7 @@
import org.opensearch.search.aggregations.BucketOrder;
import org.opensearch.search.aggregations.InternalOrder;
import org.opensearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
import org.opensearch.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder;
import org.opensearch.geo.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder;
import org.opensearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder;
import org.opensearch.search.aggregations.bucket.histogram.DateHistogramInterval;
import org.opensearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder;
Expand All @@ -44,7 +45,7 @@
import org.opensearch.search.aggregations.bucket.range.RangeAggregationBuilder;
import org.opensearch.search.aggregations.bucket.terms.IncludeExclude;
import org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.opensearch.search.aggregations.metrics.GeoBoundsAggregationBuilder;
import org.opensearch.geo.search.aggregations.metrics.GeoBoundsAggregationBuilder;
import org.opensearch.search.aggregations.metrics.PercentilesAggregationBuilder;
import org.opensearch.search.aggregations.metrics.ScriptedMetricAggregationBuilder;
import org.opensearch.search.aggregations.metrics.TopHitsAggregationBuilder;
Expand Down Expand Up @@ -285,7 +286,7 @@ private AggregationBuilder makeRangeGroup(MethodField field) throws SqlParseExce

private AggregationBuilder geoBounds(MethodField field) throws SqlParseException {
String aggName = gettAggNameFromParamsOrAlias(field);
GeoBoundsAggregationBuilder boundsBuilder = AggregationBuilders.geoBounds(aggName);
GeoBoundsAggregationBuilder boundsBuilder = new GeoBoundsAggregationBuilder(aggName);
String value;
for (KVValue kv : field.getParams()) {
value = kv.value.toString();
Expand Down Expand Up @@ -472,7 +473,7 @@ private AbstractAggregationBuilder scriptedMetric(MethodField field) throws SqlP

private AggregationBuilder geohashGrid(MethodField field) throws SqlParseException {
String aggName = gettAggNameFromParamsOrAlias(field);
GeoGridAggregationBuilder geoHashGrid = AggregationBuilders.geohashGrid(aggName);
GeoGridAggregationBuilder geoHashGrid = new GeoHashGridAggregationBuilder(aggName);
String value;
for (KVValue kv : field.getParams()) {
value = kv.value.toString();
Expand Down

0 comments on commit 53cde65

Please sign in to comment.