Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made changes to build.gradle for doctest and integ-test to make stop Prometheus #270

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
12a4c45
update codeowners and maintainers (#1579)
derek-ho Apr 25, 2023
820a010
Fix plugin compilation (#1580)
GumpacG Apr 26, 2023
8732bc6
Keep up with refactoring in OpenSearch. (#1588)
Apr 27, 2023
0cc18c1
Cross cluster search in PPL (#1512)
seankao-az May 2, 2023
ff8ec7f
Bump org.json dependency version (#1586) (#1598)
dai-chen May 3, 2023
d0d2d9f
Update maintainers list.
Yury-Fridlyand May 4, 2023
7eb6676
Update CODEOWNERS list as proposed.
Yury-Fridlyand May 8, 2023
b432756
Update usage example doc for PPL cross-cluster search (#1610)
seankao-az May 5, 2023
42ee0e1
adding reflections as a dependency (#1559)
dhrubo-os May 9, 2023
abcffb4
Add hash join benchmark doc (#1568)
dai-chen May 9, 2023
3bc00c9
add ani to codeowners and maintainers (#1614)
derek-ho May 15, 2023
c2fbe3b
Add Nested Documentation for 2.7 Related Features (#1620)
forestmvey May 23, 2023
534d7d7
Updating imports to reflect changes in opensearch core. (#1645)
May 23, 2023
f45796e
Fix of protocol rst for change in error for PPL query. (#1662)
MitchellGale May 26, 2023
bc6b748
Made changes to build.gradle for doctest and integ-test to make stop …
MitchellGale May 29, 2023
91042cb
Undoes changes in integ-test gradle
MitchellGale May 29, 2023
550f212
Undoes changes in integ-test gradle
MitchellGale May 29, 2023
6e308a4
Made stopPrometheus a method
MitchellGale May 31, 2023
4d5226a
Added if condition if windows to have startOpenSearch depend on start…
MitchellGale May 31, 2023
94d75ce
Made changes to dependance trees for doctests and integration tests t…
MitchellGale May 19, 2023
f433a39
Bump BWC test version to 2.8 (#1668)
penghuo May 30, 2023
0895e98
Documentation Proposal for `Nested` Function in WHERE Clause (#1640)
forestmvey May 30, 2023
4f7138c
Add Support for Nested Function Use In WHERE Clause Predicate Expresi…
forestmvey May 30, 2023
6f7998a
Create new anonymizer for new engine (#1665)
matthewryanwells May 30, 2023
401cd9b
Release Notes for 2.8.0 (#1676)
acarbonetto May 30, 2023
0e6a648
Support Alternate Datetime Formats (#1664)
GumpacG May 30, 2023
99928e6
Support for pagination in v2 engine of `SELECT * FROM <table>` querie…
May 30, 2023
4eaf8bb
Allow backtick around fields in sort cmd (#1688)
joshuali925 May 31, 2023
7613adb
Moved auth interceptors to common module (#1703)
vamsimanohar Jun 9, 2023
7f70a8f
Add Support for Nested Function Use In WHERE Clause Predicate Expresi…
forestmvey May 30, 2023
630a715
Support for pagination in v2 engine of `SELECT * FROM <table>` querie…
May 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams
* @anirudha @penghuo @ps48 @kavithacm @derek-ho @joshuali925 @dai-chen @YANG-DB @rupal-bq @mengweieric @vamsi-amazon @Yury-Fridlyand @MaxKsyunz
* @pjfitzgibbons @ps48 @kavithacm @derek-ho @joshuali925 @dai-chen @YANG-DB @rupal-bq @mengweieric @vamsi-amazon @swiddis @penghuo @seankao-az @MaxKsyunz @Yury-Fridlyand @anirudha @forestmvey @acarbonetto @GumpacG
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ gen

.java-version
.worktrees
http-client.env.json
http-client.env.json
/doctest/sql-cli/
.factorypath
36 changes: 26 additions & 10 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,35 @@ This document contains a list of maintainers in this repo. See [opensearch-proje

## Current Maintainers

| Maintainer | GitHub ID | Affiliation |
| --------------------- | --------------------------------------------------- | ----------- |
| Peng Huo | [penghuo](https://github.com/penghuo) | Amazon |
| Chen Dai | [dai-chen](https://github.com/dai-chen) | Amazon |
| Chloe Zhang | [chloe-zh](https://github.com/chloe-zh) | Amazon |
| Vamsi Manohar | [vamsi-amazon](https://github.com/vamsi-amazon) | Amazon |
| Max Ksyunz | [MaxKsyunz](https://github.com/MaxKsyunz) | BitQuill |
| Yury Fridlyand | [Yury-Fridlyand](https://github.com/Yury-Fridlyand) | BitQuill |
| Maintainer | GitHub ID | Affiliation |
| ----------------- | ------------------------------------------------- | ----------- |
| Eric Wei | [mengweieric](https://github.com/mengweieric) | Amazon |
| Joshua Li | [joshuali925](https://github.com/joshuali925) | Amazon |
| Shenoy Pratik | [ps48](https://github.com/ps48) | Amazon |
| Kavitha Mohan | [kavithacm](https://github.com/kavithacm) | Amazon |
| Rupal Mahajan | [rupal-bq](https://github.com/rupal-bq) | Amazon |
| Derek Ho | [derek-ho](https://github.com/derek-ho) | Amazon |
| Lior Perry | [YANG-DB](https://github.com/YANG-DB) | Amazon |
| Peter Fitzgibbons | [pjfitzgibbons](https://github.com/pjfitzgibbons) | Amazon |
| Simeon Widdis | [swiddis](https://github.com/swiddis) | Amazon |
| Chen Dai | [dai-chen](https://github.com/dai-chen) | Amazon |
| Vamsi Manohar | [vamsi-amazon](https://github.com/vamsi-amazon) | Amazon |
| Peng Huo | [penghuo](https://github.com/penghuo) | Amazon |
| Sean Kao | [seankao-az](https://github.com/seankao-az) | Amazon |
| Max Ksyunz | [MaxKsyunz](https://github.com/MaxKsyunz) | Improving |
| Yury Fridlyand | [Yury-Fridlyand](https://github.com/Yury-Fridlyand) | Improving |
| Andrew Carbonetto | [acarbonetto](https://github.com/acarbonetto) | Improving |
| Forest Vey | [forestmvey](https://github.com/forestmvey) | Improving |
| Guian Gumpac | [GumpacG](https://github.com/GumpacG) | Improving |
| Anirudha Jadhav | [anirudha](https://github.com/anirudha) | Amazon |

## Emeritus Maintainers

| Maintainer | GitHub ID | Affiliation |
| ----------------- | ------------------------------------------------------- | ----------- |
| Charlotte Henkle | [CEHENKLE](https://github.com/CEHENKLE) | Amazon |
| Anirudha Jadhav | [anirudha](https://github.com/anirudha) | Amazon |
| Nick Knize | [nknize](https://github.com/nknize) | Amazon |
| Nick Knize | [nknize](https://github.com/nknize) | Amazon |
| David Cui | [davidcui1225](https://github.com/davidcui1225) | Amazon |
| Eugene Lee | [eugenesk24](https://github.com/eugenesk24) | Amazon |
| Zhongnan Su | [zhongnansu](https://github.com/zhongnansu) | Amazon |
| Chloe Zhang | [chloe-zh](https://github.com/chloe-zh) | Amazon |
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral() // For Elastic Libs that you can use to get started coding until open OpenSearch libs are available
maven { url 'https://jitpack.io' }
}

allprojects {
Expand All @@ -91,15 +92,19 @@ allprojects {
plugins.withId('java') {
sourceCompatibility = targetCompatibility = "11"
}
configurations.all {
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib:1.6.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-common:1.6.0"
}
}

subprojects {
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
// todo. remove this when lucene 9.4.0 is released
maven { url "https://d1nvenhzbhpy0q.cloudfront.net/snapshots/lucene/" }
maven { url 'https://jitpack.io' }
}
}

Expand Down
21 changes: 21 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,30 @@ dependencies {
api group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
api group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.17.1'
api group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
api group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.9.3'
implementation 'com.github.babbel:okhttp-aws-signer:1.0.2'
api group: 'com.amazonaws', name: 'aws-java-sdk-core', version: '1.12.1'
api group: 'com.amazonaws', name: 'aws-java-sdk-sts', version: '1.12.1'

testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
testImplementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.12.4'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.12.4'
testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.9.3'
}


configurations.all {
resolutionStrategy.force "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}"
resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${versions.jackson}"
resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}"
resolutionStrategy.force "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
resolutionStrategy.force "com.squareup.okhttp3:okhttp:4.9.3"
resolutionStrategy.force "org.apache.httpcomponents:httpcore:4.4.13"
resolutionStrategy.force "joda-time:joda-time:2.10.12"
resolutionStrategy.force "org.slf4j:slf4j-api:1.7.36"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

package org.opensearch.sql.prometheus.authinterceptors;
package org.opensearch.sql.common.authinterceptors;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

package org.opensearch.sql.prometheus.authinterceptors;
package org.opensearch.sql.common.authinterceptors;

import java.io.IOException;
import lombok.NonNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ public enum Key {
*/
QUERY_MEMORY_LIMIT("plugins.query.memory_limit"),
QUERY_SIZE_LIMIT("plugins.query.size_limit"),
ENCYRPTION_MASTER_KEY("plugins.query.datasources.encryption.masterkey"),
DATASOURCES_URI_ALLOWHOSTS("plugins.query.datasources.uri.allowhosts"),

METRICS_ROLLING_WINDOW("plugins.query.metrics.rolling_window"),
METRICS_ROLLING_INTERVAL("plugins.query.metrics.rolling_interval");
METRICS_ROLLING_INTERVAL("plugins.query.metrics.rolling_interval"),

CLUSTER_NAME("cluster.name");

@Getter
private final String keyValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

package org.opensearch.sql.prometheus.authinterceptors;
package org.opensearch.sql.common.authinterceptors;

import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand All @@ -15,7 +15,6 @@
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider;
import com.amazonaws.auth.STSSessionCredentialsProvider;
import lombok.SneakyThrows;
import okhttp3.Interceptor;
import okhttp3.Request;
Expand All @@ -25,7 +24,9 @@
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import org.opensearch.sql.common.authinterceptors.AwsSigningInterceptor;

@ExtendWith(MockitoExtension.class)
public class AwsSigningInterceptorTest {
Expand Down Expand Up @@ -54,15 +55,15 @@ void testConstructors() {
@Test
@SneakyThrows
void testIntercept() {
when(chain.request()).thenReturn(new Request.Builder()
Mockito.when(chain.request()).thenReturn(new Request.Builder()
.url("http://localhost:9090")
.build());
AwsSigningInterceptor awsSigningInterceptor
= new AwsSigningInterceptor(
getStaticAWSCredentialsProvider("testAccessKey", "testSecretKey"),
"us-east-1", "aps");
awsSigningInterceptor.intercept(chain);
verify(chain).proceed(requestArgumentCaptor.capture());
Mockito.verify(chain).proceed(requestArgumentCaptor.capture());
Request request = requestArgumentCaptor.getValue();
Assertions.assertNotNull(request.headers("Authorization"));
Assertions.assertNotNull(request.headers("x-amz-date"));
Expand All @@ -73,16 +74,16 @@ void testIntercept() {
@Test
@SneakyThrows
void testSTSCredentialsProviderInterceptor() {
when(chain.request()).thenReturn(new Request.Builder()
Mockito.when(chain.request()).thenReturn(new Request.Builder()
.url("http://localhost:9090")
.build());
when(stsAssumeRoleSessionCredentialsProvider.getCredentials())
Mockito.when(stsAssumeRoleSessionCredentialsProvider.getCredentials())
.thenReturn(getAWSSessionCredentials());
AwsSigningInterceptor awsSigningInterceptor
= new AwsSigningInterceptor(stsAssumeRoleSessionCredentialsProvider,
"us-east-1", "aps");
awsSigningInterceptor.intercept(chain);
verify(chain).proceed(requestArgumentCaptor.capture());
Mockito.verify(chain).proceed(requestArgumentCaptor.capture());
Request request = requestArgumentCaptor.getValue();
Assertions.assertNotNull(request.headers("Authorization"));
Assertions.assertNotNull(request.headers("x-amz-date"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
*
*/

package org.opensearch.sql.prometheus.authinterceptors;

import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package org.opensearch.sql.common.authinterceptors;

import java.util.Collections;
import lombok.SneakyThrows;
Expand All @@ -21,7 +18,7 @@
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.internal.matchers.Null;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
Expand All @@ -45,13 +42,13 @@ void testConstructors() {
@Test
@SneakyThrows
void testIntercept() {
when(chain.request()).thenReturn(new Request.Builder()
Mockito.when(chain.request()).thenReturn(new Request.Builder()
.url("http://localhost:9090")
.build());
BasicAuthenticationInterceptor basicAuthenticationInterceptor
= new BasicAuthenticationInterceptor("testAdmin", "testPassword");
basicAuthenticationInterceptor.intercept(chain);
verify(chain).proceed(requestArgumentCaptor.capture());
Mockito.verify(chain).proceed(requestArgumentCaptor.capture());
Request request = requestArgumentCaptor.getValue();
Assertions.assertEquals(
Collections.singletonList(Credentials.basic("testAdmin", "testPassword")),
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dependencies {
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.12.4'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '3.12.4'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.12.4'
}

Expand Down
30 changes: 25 additions & 5 deletions core/src/main/java/org/opensearch/sql/analysis/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package org.opensearch.sql.analysis;

import static org.opensearch.sql.analysis.DataSourceSchemaIdentifierNameResolver.DEFAULT_DATASOURCE_NAME;
import static org.opensearch.sql.ast.tree.Sort.NullOrder.NULL_FIRST;
import static org.opensearch.sql.ast.tree.Sort.NullOrder.NULL_LAST;
import static org.opensearch.sql.ast.tree.Sort.SortOrder.ASC;
Expand Down Expand Up @@ -42,13 +43,16 @@
import org.opensearch.sql.ast.expression.UnresolvedExpression;
import org.opensearch.sql.ast.tree.AD;
import org.opensearch.sql.ast.tree.Aggregation;
import org.opensearch.sql.ast.tree.CloseCursor;
import org.opensearch.sql.ast.tree.Dedupe;
import org.opensearch.sql.ast.tree.Eval;
import org.opensearch.sql.ast.tree.FetchCursor;
import org.opensearch.sql.ast.tree.Filter;
import org.opensearch.sql.ast.tree.Head;
import org.opensearch.sql.ast.tree.Kmeans;
import org.opensearch.sql.ast.tree.Limit;
import org.opensearch.sql.ast.tree.ML;
import org.opensearch.sql.ast.tree.Paginate;
import org.opensearch.sql.ast.tree.Parse;
import org.opensearch.sql.ast.tree.Project;
import org.opensearch.sql.ast.tree.RareTopN;
Expand All @@ -63,7 +67,6 @@
import org.opensearch.sql.common.antlr.SyntaxCheckException;
import org.opensearch.sql.data.model.ExprMissingValue;
import org.opensearch.sql.data.type.ExprCoreType;
import org.opensearch.sql.data.type.ExprType;
import org.opensearch.sql.datasource.DataSourceService;
import org.opensearch.sql.exception.SemanticCheckException;
import org.opensearch.sql.expression.DSL;
Expand All @@ -81,12 +84,15 @@
import org.opensearch.sql.expression.parse.ParseExpression;
import org.opensearch.sql.planner.logical.LogicalAD;
import org.opensearch.sql.planner.logical.LogicalAggregation;
import org.opensearch.sql.planner.logical.LogicalCloseCursor;
import org.opensearch.sql.planner.logical.LogicalDedupe;
import org.opensearch.sql.planner.logical.LogicalEval;
import org.opensearch.sql.planner.logical.LogicalFetchCursor;
import org.opensearch.sql.planner.logical.LogicalFilter;
import org.opensearch.sql.planner.logical.LogicalLimit;
import org.opensearch.sql.planner.logical.LogicalML;
import org.opensearch.sql.planner.logical.LogicalMLCommons;
import org.opensearch.sql.planner.logical.LogicalPaginate;
import org.opensearch.sql.planner.logical.LogicalPlan;
import org.opensearch.sql.planner.logical.LogicalProject;
import org.opensearch.sql.planner.logical.LogicalRareTopN;
Expand Down Expand Up @@ -209,7 +215,6 @@ public LogicalPlan visitTableFunction(TableFunction node, AnalysisContext contex
tableFunctionImplementation.applyArguments());
}


@Override
public LogicalPlan visitLimit(Limit node, AnalysisContext context) {
LogicalPlan child = node.getChild().get(0).accept(this, context);
Expand All @@ -220,7 +225,6 @@ public LogicalPlan visitLimit(Limit node, AnalysisContext context) {
public LogicalPlan visitFilter(Filter node, AnalysisContext context) {
LogicalPlan child = node.getChild().get(0).accept(this, context);
Expression condition = expressionAnalyzer.analyze(node.getCondition(), context);
verifySupportsCondition(condition);

ExpressionReferenceOptimizer optimizer =
new ExpressionReferenceOptimizer(expressionAnalyzer.getRepository(), child);
Expand All @@ -229,7 +233,7 @@ public LogicalPlan visitFilter(Filter node, AnalysisContext context) {
}

/**
* Ensure NESTED function is not used in WHERE, GROUP BY, and HAVING clauses.
* Ensure NESTED function is not used in GROUP BY, and HAVING clauses.
* Fallback to legacy engine. Can remove when support is added for NESTED function in WHERE,
* GROUP BY, ORDER BY, and HAVING clauses.
* @param condition : Filter condition
Expand Down Expand Up @@ -563,6 +567,23 @@ public LogicalPlan visitML(ML node, AnalysisContext context) {
return new LogicalML(child, node.getArguments());
}

@Override
public LogicalPlan visitPaginate(Paginate paginate, AnalysisContext context) {
LogicalPlan child = paginate.getChild().get(0).accept(this, context);
return new LogicalPaginate(paginate.getPageSize(), List.of(child));
}

@Override
public LogicalPlan visitFetchCursor(FetchCursor cursor, AnalysisContext context) {
return new LogicalFetchCursor(cursor.getCursor(),
dataSourceService.getDataSource(DEFAULT_DATASOURCE_NAME).getStorageEngine());
}

@Override
public LogicalPlan visitCloseCursor(CloseCursor closeCursor, AnalysisContext context) {
return new LogicalCloseCursor(closeCursor.getChild().get(0).accept(this, context));
}

/**
* The first argument is always "asc", others are optional.
* Given nullFirst argument, use its value. Otherwise just use DEFAULT_ASC/DESC.
Expand All @@ -578,5 +599,4 @@ private SortOption analyzeSortOption(List<Argument> fieldArgs) {
}
return asc ? SortOption.DEFAULT_ASC : SortOption.DEFAULT_DESC;
}

}
Loading